4 ms·
There is some documentation on the various Nim backends here: http://nim-lang.org/docs/backends.html http://nim-lang.org/docs/backends.html & http://nim-lang.or
by jboy 11y ago
There is some documentation on the various Nim backends here: http://nim-lang.org/docs/backends.html http://nim-lang.org/docs/backends.html & http://nim-lang.org/docs/nimc.html#compiler-usage-generated-c-code-directory http://nim-lang.org/docs/nimc.html#compiler-usage-generated-...
That second link describes the `nimcache` directory into which the generated C code is written. If you poke around in that directory (starting with the generated C version of your Nim code, which will have the same filename but a `.c` suffix instead of a `.nim` suffix) then you can see that the generated C code is really quite readable.
- gcr 11y agoIt's also quite fun digging around the output of other code generation toolkits. Cython code, for example, can look like quite idiomatic C if you add enough type annotations. Theano's output, on the other hand...
- fizixer 11y agoActually I recalled I played with nim about a month ago. Really only created a three liner (print "what's your name", read a string, print "Hello" + string_read). The generated C code was a couple hundred lines. Honestly that turned me off. I'm looking for a high level language that generates really succint human-readable code. Essentially, what a human would do to create the exact program in C. And doing what I did in nim in 3 lines, really only takes less than 10 lines in C.