The Wayback Machine - https://web.archive.org/web/20180611035611/https://github.com/nim-lang/c2nim
Skip to content
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. http://nim-lang.org/docs/c2nim.html
Nim C++ C
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

c2nim

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 after the translation process. c2nim is no real compiler!

Please see the manual here.

Installing

Install https://github.com/nim-lang/nimble#installation, clone this repository and run nimble build in your checkout.

Translating

c2nim is preliminary meant to translate C header files. Because of this, the preprocessor is part of the parser. For example:

  #define abc 123
  #define xyz 789

Is translated into:

  const
    abc* = 123
    xyz* = 789

c2nim is meant to translate fragments of C code and thus does not follow include files. c2nim cannot parse all of Ansi C and many constructs cannot be represented in Nim: for example duff's device cannot be translated to Nim.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.