Re:I missed Nim (2014)
by kirbyfan64sos on Thursday January 21, 2016 @06:09PM
(#10949280)
In most cases, though, the GC is light enough that it can stay enabled, and you'll rarely ever end up with raw pointers.
For threading, you can use the capabilities at:
- Nim had a lot of undefined behavior. Dereferencing a null pointer, for example, led to undefined behavior because of compiling to C.
- Nim seemed to have less flexible data race prevention (though the abstract interpretation stuff that Nim does to determine disjointness of arrays could be more ergonomic than Rust's split_at_mut, albeit more complex). Data races were also more of a problem in Nim because the lack of a thread-safe GC meant that races could result in use-after-free.
- Nim was in the typical "memory safety requires a GC; opt out of GC and you lose memory safety" category of languages (reference counting being a form of GC). Rust, by contrast, retains safety even when GC is not used (which it rarely is).
This was many months ago, so it may well have changed.