3 ms·
Rust belongs to a small collection of languages that can run code with minimal latency, and on hardware directly, ie without an OS. (Others are C, C++, Zig, and
by the__alchemist 3y ago
Rust belongs to a small collection of languages that can run code with minimal latency, and on hardware directly, ie without an OS. (Others are C, C++, Zig, and ADA).
Rust can be argued to be a nice addition to the group. You can view it as "The nicest (in some qualities) in a niche". Nim doesn't have this sort of edge.
- cb321 3y agoNiceness is subjective, but Nim is just as valid an addition to that group. Nim compiles to C and has had an --os=standalone mode for like 10 years from its git history, and as mentioned else-thread (https://news.ycombinator.com/item?id=36506087 https://news.ycombinator.com/item?id=36506087) can be used for Linux kernel modules. Multiple people have written "stub OSes" in it (https://github.com/dom96/nimkernel https://github.com/dom96/nimkernel & further along https://github.com/khaledh/axiom https://github.com/khaledh/axiom). While it can use clang as a backend, Nim does not rely upon LLVM support like Zig or Rust (pre-gcc-rust working). Use on embedded devices is fairly popular: https://forum.nim-lang.org/search?q=embedded https://forum.nim-lang.org/search?q=embedded (or web search). Latency-wise, for a time, video game programming was a perceived "adoption niche" or maybe "hook" for Nim and games often have stringent frame rendering deadlines. If you are interested in video games, you might appreciate https://github.com/shish/rosettaboy https://github.com/shish/rosettaboy which covers all but Ada in your list with Nim being fastest (on one CPU/version/compiler/etc). Note, however, that cross-PL comparisons are often done by those with much "porting energy" but limited familiarity with any but a few of the PLs. A better way to view it is that "Nim responds well to optimization effort" (like C/Ada/C++/Rust/Zig).
- the__alchemist 3y agoPretty cool; didn't know that.