HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
floooh
sokol
C2019–2026
floooh / sokol

sokol

minimal cross-platform standalone C headers

18Distinct people
42Mentions
1Explicit recommenders
10.4KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

minimal cross-platform standalone C headers

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

Well, eye opening was the C++ source code I was able to work with at a previous company, they were an automotive HMI developer company. They had really strict and well planned…

inDigiNeous used a recommendation phrase. One indexed comment matches. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year42 dated mentions

Observed mentions: 2019-11-09 07:02:35 UTC to 2026-10-27 07:24:48 UTC.

02468102019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments20192020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 9 mentions; 0 submissions, 9 comments20222023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 9 mentions; 1 submissions, 8 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 6 mentions; 0 submissions, 6 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 4 mentions; 1 submissions, 3 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC211
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC404
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC505
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC909
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC918
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC606
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC413
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC303

What Hacker News says

42 sources
> but I wish there was a middle ground between it and VK There's WebGPU (probably the best option for teaching), D3D11 and Metal. And (shameless plug): sokol-gfx tries to find a balance between simplicity and modern 3D APIs: https://github.com/floooh/sokol Demos with links to C source and shader code: WebGL2 backend: https://floooh.github.io/sokol-html5/ WebGPU backend (has a couple more demos which use features not available on GLES3.0/WebGL2, like compute shaders): https://floooh.github.io/sokol-webgpu/
In I still teach OpenGL ES 3.0
Floooh is amazing. One of my favourite libraries ever is Sokol, which is used for those emulators AFAIR: https://github.com/floooh/sokol It hits the spot for me in terms of features, small-size and ease of use/embedding. Every other library has way too much I don't need and way too little that I do. It was also a fantastic code reference for me, when I was porting game code between platforms. It has all the answers I need in it, and I know how to navigate it quite well after those years. If one studies it enough it has enough material for a few reference books.
In Tiny Emulators
Yes, technically it's possible by wrapping the ObjC runtime API, see solutions like these: - https://github.com/garettbass/oc - https://github.com/mitchellh/zig-objc Whether that's better than writing ObjC directly is another question, think of ObjC as a convenient syntax sugar wrapper around macOS/iOS APIs which you only need in those parts of your application that talk directly to operating system APIs. Also Apple is maintaining a C++ Metal API wrapper now (ok, technically that's not C): https://developer.apple.com/metal/cpp/ If you just want do to simple 'game-y stuff' (3D rendering, audio, low level touch input) you can also check out the Sokol headers (shameless plug): https://github.com/floooh/sokol, or I guess SDL will work too (especially with the new GPU API in SDL3) - at least the sokol header implementation code needs to be com
Read the rest
piled as ObjC on macOS/iOS though (e.g. pass `-x objective-c` to Clang), since the macOS/iOS specific code paths are written in ObjC. For the general case or when you need to access OS frameworks that are not wrapped by 3rd-party libraries: If your app is mainly C code, have a thin layer of ObjC code that sits on top of the system ObjC APIs and which exposes a C API to the rest of the application. Don't just tunnel every ObjC call through to C, instead wrap small feature blocks in ObjC and expose those features through a much simplified C API. E.g. a hybrid C/ObjC application with only the necessary amount of ObjC code for talking to OS APIs, and all the 'business logic' in C (or another language, like C++, Zig or Rust).
In Is it possible to write plain C iOS app in 2025?
Kitty on Mac has a few visual issues that Ghostty doesn't have: - the text rendering looks slightly blurry when comparing side by side (Kitty looks blurry, Wezterm and Ghostty look crisp) - when resizing the window, the window content 'wobbles' (Ghostty is stable, both Kitty and Wezterm have the resize wobble) This wobbling effect is a known issue with Metal views (no idea tbh why Apple can't fix that in the window system), the solution is to 'anchor' the view to one window side during resizing (although not perfect, since during the maximize transition the window content doesn't scale), but the basic wobbling fix is fairly simple: https://github.com/floooh/sokol/pull/963 In general I have the impression that Kitty feels quite 'heavy' on macOS compared to both Wezterm and Ghostty (and iTerm2 which I used before feels heavier than all thos
Read the rest
e combined).
In Release Notes for Ghostty 1.1.0
If you have somebody on the team who was able to write a Vulkan rendering engine, then that same person can also easily pop out a Metal port ... just be careful, that person probably never wants to touch Vulkan again afterwards ;) Otherwise I would expect that the game either uses a library which abstracts away the differences between the system 3D APIs (shameless plug: https://github.com/floooh/sokol, but also BGFX, WebGPU or AFAIK SDL3 is also getting a cross-platform 3D API), or uses a complete game engine like Godot, Unity or Unreal. > Maintenance is always the time consuming part This is the only thing that matters, it's not the initial port that's the problem, but the long term maintenance and customer support and that often doesn't make business sense on non-mainstream platforms like Linux or macOS. But a cross-platform 3D API does
Read the rest
n't make any of that easier (you'll still have to struggle with driver bugs for instance, or just plain weird configurations, especially on Linux systems - unless going through Proton which I'm sure works around a ton of compatibility issues and driver bugs under the hood).
In Vulkan1.3 on the M1 in one month
Here's something similar by Garrett Bass: https://github.com/garettbass/oc ...I also experimented a bit with parsing macOS system headers via clang-ast-dump and then code-generating C and Zig bindings but that didn't get far: https://github.com/floooh/objc-ast-experiments ...with a bit of effort and maybe using libclang instead of clang-ast-dump that's definitely feasible though. I guess a similar approach is used by the official C++ bindings for Metal: https://developer.apple.com/metal/cpp/ ...also shameless plug: the sokol headers allow to write simple macOS applications (just a Metal canvas in a window) in various non-Apple languages (currently C, C++, Zig, Rust, Odin, Nim): https://github.com/floooh/sokol ...I'm cheating though and use ObjC under the hood to talk to Cocoa and Metal ;)
In C-Macs – a pure C macOS application
I'm using Dear ImGui for my cross-platform projects (which includes running in browsers): - https://floooh.github.io/visual6502remix/ - (start the emulators by clicking the little "UI" icon to get the debugger UI) https://floooh.github.io/tiny8bit/ - (start by clicking the little "UI" icon) https://floooh.github.io/sokol-html5/ Platform abstraction is handled through the sokol headers: https://github.com/floooh/sokol Dear ImGui is small and fast enough for running in browsers (it will add up to a few hundred KBytes of WASM byte code). If this is too much "bloat", there are smaller, but also less powerful alternatives like microui: https://github.com/rxi/microui)
In Container2wasm: Convert Containers to WASM Blobs

Showing the 15 most recent of 42 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.