Hacker GitHub

← All repos

nim-lang/c2nim

View on GitHub ↗ ★ 528 Nim

c2nim is a tool to translate Ansi C code to Nim. The output is human-readable Nim code that is meant to be tweaked by hand before and after the translation process.

8 mentions on Hacker News by 8 people: 1 story, 7 comments · first 2018-03-02 · latest 2025-09-01

Mentions per year 8 mentions · busiest year 2021 (2)
20082026
  1. …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…
  2. …I maintain a raylib wrapper https://github.com/planetis-m/naylib As long utilities like c2nim https://github.com/nim-lang/c2nim exist, it's trivial to create bindings of C/C++ libraries. One thing I want to experiment more is making it…
    comment by planetis · 2023-02-12 · in I learned seven programming languages
  3. …3rd order C function pointers. I figure that's probably C code you don't wanna touch if possible. https://github.com/nim-lang/c2nim/blob/11f2c5363dfe7e8c7c8ce... The other annoying one is that "signed" and "unsigned" are basically…
    comment by elcritch · 2022-12-21 · in Checked C
  4. …extensions, etc. OTOH, that also ties it to limitations of backends. Possibly relevant is https://github.com/nim-lang/c2nim & https://github.com/PMunch/futhark & the rather old/probably partly stale in both columns…
  5. …are "c2nim" and "nimterop". c2nim is a Nim official library, while nimterop is a community library. https://github.com/nim-lang/c2nim https://github.com/nimterop/nimterop To preface this: I've spent a fair amount of time on the "codegen of…
  6. …requires it. Finally, there is a tool to help auto-translate C/C++ to Nim with the c2nim tool: https://github.com/nim-lang/c2nim and docs: https://github.com/nim-lang/c2nim/blob/master/doc/c2nim.rst
  7. …One of the tools that can be used to create Nim interface code from existing C header files: https://github.com/nim-lang/c2nim
    comment by komerdoor · 2018-03-02 · in Nim language v0.18.0 released