4 ms·
Nim compiles down to C and can produce code to run directly on bare metal. My understanding is that Go and Rust (to a lesser degree) require a runtime. Perhap
by eaurouge 12y ago
Nim compiles down to C and can produce code to run directly on bare metal. My understanding is that Go and Rust (to a lesser degree) require a runtime. Perhaps someone with better knowledge of all three languages could chime in.
- samatman 12y agoRust's runtime has been reduced to bounds-checking of array access, IIRC. So to a much lesser degree, and I believe Nim also provides this behavior by default. Go is garbage collected and has an opinionated ABI and runtime. Completely different beasts.
- haberman 12y agoYes, agreed, though I really wish Rust could compile to C: http://www.reddit.com/r/rust/comments/2e8t9k/my_1_wish_list_item_for_rust_robust_compiling_to/ http://www.reddit.com/r/rust/comments/2e8t9k/my_1_wish_list_... Someone has revived the LLVM C Backend. Hopefully this could be a path to Rust->C compilation: https://github.com/draperlaboratory/llvm-cbe https://github.com/draperlaboratory/llvm-cbe Compiling to C is so important to me that I may check out Nim as an alternative to Rust, despite liking Rust very much.
- FreeFull 12y agoRust has been used to write code that runs on bare metal too. Typically, this is done by using #![no_std], since the standard library depends on things like jemalloc and libc stuff. Everything that doesn't depend on these is in libcore.