4 ms·
Nim is garbage-collected, actually. It has an option to disable garbage-collection (though I thought there was talk of removing that at some point) but then it
by TheFlyingFish 4y ago
Nim is garbage-collected, actually. It has an option to disable garbage-collection (though I thought there was talk of removing that at some point) but then it just leaks memory, it doesn't have a comprehensive system for GC-less memory management like Rust does.
- Tozen 4y agoNim is also not the only language with the combination of optional GC and memory management. Dlang and Vlang are two others, where the GC is optional and are compiled languages. Golang appears to be more seriously experimenting with various forms of manual memory management, so at some point, we might see it offer a choice of memory management options too. In fact, Dlang even has an experimental borrow checker. Care should be taken to not be in so much of a bubble, to not realize that other languages have viable solutions too or are developing alternatives to what's presently available. If our choice for one or the other, is more a matter of personal preference, it would arguably be better to acknowledge such.
- planetis 4y agoFriend nim does have gc less memory management https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc-in-nim.html https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc... and can also collect cycles similar to PHP. Imo the new system is more intuitive than rust's which will be a huge win when it comes out (soon).