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

sokol-nim

nim bindings for https://github.com/floooh/sokol

2Distinct people
4Mentions
0Explicit recommenders
104GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

nim bindings for https://github.com/floooh/sokol

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

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, 5:04:57 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 year4 dated mentions

Observed mentions: 2018-04-09 14:13:39 UTC to 2025-09-01 20:30:06 UTC.

012018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20182019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments20212022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2025

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
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC101
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC000
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC000
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC000
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC101
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC101
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC000
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC101

What Hacker News says

4 sources
This is a bit controversial, but in my opinion, just manually write bindings for the API surface you care about. There are tools to help automate the process ([c2nim](https://github.com/nim-lang/c2nim), [futhark](https://github.com/PMunch/futhark)), but these tools are mostly for C. Theoretically if you want to import a large C++ API (e.g. if you were importing Google's C++ codebase*), you could do so with libclang. I was working on an alternative to c2nim that supported Objective-c and C++, which used libclang, but it's currently in my project graveyard. If you're expecting a @cImport from Zig, then the closest you have to that is tools mentioned above to help with the process. * to be clear, I understand why Google does not want to use Nim instead of creating a new language (Carbon). i.e. readable code output, full control of the compil
Read the rest
er and language design, etc. The amount of manual work to write bindings is minimal, i.e. you can do so simply by declaring a prototype for a procedure and then appending `{.importcpp, header: "<path>".}`, the same for types. And then compile with `nim cpp`. Compare the way you wrap libraries in Python, Nim requires so much less work - and yet the Python community wraps every C/C++ library you can think of. Again, in my opinion, if you really want a library: wrap it yourself (ideally the subset you need) or rewrite it in Nim. Also, most of the libraries you have listed have bindings already: - Qt: https://github.com/jerous86/nimqt or [seaqt](https://forum.nim-lang.org/t/12709) - ImGUI: https://github.com/nimgl/imgui - SFML: https://github.com/oprypin/nim-csfml - SDL: https://github.com/nim-lang/sdl2 - sokol: https://github.com/floooh/sokol-nim If there's a popular enough C or C++ library, it's probably already wrapped, especially within the gamedev community.
In A review of Nim 2: The good and bad with example code
I maintain auto-generated bindings for my C libraries for Zig and Nim (and Odin and Rust - although the Rust bindings definitely need some love to make them a lot more idiomatic). I think looking at the examples (which is essentially the same code in different languages) gives you a high level idea, but they only scratch the surface when it comes to language features (for instance the Zig examples don't use any comptime features): Zig: https://github.com/floooh/sokol-zig/tree/master/src/examples Nim: https://github.com/floooh/sokol-nim/tree/master/examples Odin: https://github.com/floooh/sokol-odin/tree/main/examples Rust: https://github.com/floooh/sokol-rust/tree/main/examples
In Nim 2.0
> they're nontrivial to bind to from non-C languages This particular library doesn't seem to follow the STB convention where the implementation is inside an #ifdef IMPLEMENTATION block, but that would be trivial to fix. Once you have that it's just as trivial to use from other languages as a regular .h/.c library, just include the implementation into a C source file and compile that into a static link library or DLL, then include the declarations (without IMPLEMENTATION define) into your language (if the language can directly include C headers) or use the header to auto-generate the bindings. For example: - https://github.com/floooh/sokol-zig - https://github.com/floooh/sokol-nim - https://github.com/floooh/sokol-odin These are all auto-generated from STB-style single-file libraries: https://github.com/floooh/sokol
In Tinyphysicsengine: Minimalist 3D C99 single-header physics engine
Awesome, this is exactly how I wish all 'better C' languages would allow C interop instead of going through separate binding-generator tools. The C (not C++) language itself is simple enough that at least a struct/function declarations parser shouldn't add too much code to any compiler (even if not using LLVM for this). The best solution would be to also allow directly referencing .c implementation files from D source, for separate compilation and linking with the D program. Nim does allow something like this: https://github.com/floooh/sokol-nim/blob/master/sokol/gfx.ni..., but I guess since Nim compiles to C this is much easier to achieve :)
In Include C headers in D code

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.