Hacker News new | ask | show | jobs
by mratsim 2459 days ago
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.

1 comments

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.