|
|
|
|
|
by brabel
931 days ago
|
|
I want to write low level code and was considering Nim because I want to compile to C, so I can benefit from Cosmopolitan Actually Portable binaries.
Do you think Nim is feasible for this? Do you know other languages that could do that, it seems my options are VERY limited (despite there being thousands of languages, there's almost none that can compile to C and gives you good memory control)... I think Zig can't compile to C yet, Rust doesn't either (except for some experimental compiler) and other options are GC'd with a "heavy" runtime which is the last thing I want. |
|
In more words: You should be able to use Cosmopolitan libc: https://github.com/Yardanico/cosmonim
If something does not work for you, Yardanico is super duper helpful in all things Nim.
Nim also compiles to Javascript (nim js) and C++ for integration with legacy codebases, but that is probably more to the side of your interests.
While I have never seen it done and always meant to give it a try, compiling to C should allow one to also do things like write Linux kernel modules in Nim without any special support from the Linux team.