Re:Mastering Nim – now available on Amazon
by warangal on Thursday June 30, 2022 @12:36AM
(#31928751)
Even though Nim by default works with a GC to manage memory, I regularly use Nim to work with direct-memory/raw-pointers and can still have increased memory safety by using HOOKS and ARC. I have written about my experience here[1], in case somebody is curious.
1. https://ramanlabs.in/static/blog/raw_memory_management_patte...
Re:Mastering Nim – now available on Amazon
by elcritch on Wednesday June 29, 2022 @10:01PM
(#31927981)
Its nice being able to go all the way from fully GC reliant cyclic data-types with closures all the way to memory control-freak every byte and microsecond matters by using stack objects and 'var' parameters. Often you can keep 90% of the code and just tweak a few slow points.
So it's just hard to justify using Rust, for me. Unless you're writing a DB or something where a GC is a no go. But Nim's memory management seems pretty good, and many things are stack allocated.