Hacker News new | ask | show | jobs
by leshow 2456 days ago
Zig and Rust both don't have a runtime/GC, they should be on par with performance in C, meaning they are slightly faster than the others (of course this all depends). Go is the only one you listed that doesn't have some kind of parametric polymorphism support (generics). Rust is the only one that will validate your program is memory safe at compile time, they call this 'data race freedom'.

I think in the end it's really up to your tastes which you prefer. Have a look at the tenets of each of the languages and see which resonates with you.

1 comments

I didn't try Crystal, but Nim is definitely on par with C.

Actually you can use just plain (stack) objects and ptr object and you have no GC involved.

Pass the flag -d:useMalloc (or just call your preferred allocator) and you have the full C experience and speed.

Maybe, but libraries that you use in Nim will probably use the GC, so will many functions in the std library (I imagine). Additionally, the binary you ship will still probably include the runtime & GC. So it's not really fair to say it's on par with C/Rust, there's reasons to avoid GC besides just performance. Say you are writing an embedded application for example. I don't know any Nim, so correct me if I'm wrong.
> not really fair to say it's on par with C/Rust

It is. The GC is inline, thread-local and can be run manually, disabled completely, or switched to the new owned reference.