← Back to context

Comment by alberth

2 years ago

Congrats, fascinating work!

Q: has the GC of Nim caused any challenges?

(And if not, would you attribute that to Nim unique GC that does NOT “stop-the-world”?)

https://nim-lang.org/1.4.0/gc.html

Thanks! As @Tiberium mentioned, Nim 2.0 defaults to using ARC (Automatic Reference Counting), so no runtime GC. The Nim compiler is quite smart about when to copy/move and when to destruct, with some hints like lent/sink for when you want to have a bit more control.

Keep in mind that I also need to use ptr (as opposed to ref) types in a lot of cases when working at a low level, so there might be a need for some manual memory management as well.

1.4.0 is a very outdated docs version (Nim is at 2.0 currently, and 2.0 release brought ORC as default with ARC as an option), you should refer to the updated https://nim-lang.org/docs/mm.html and also https://nim-lang.org/docs/destructors.html

  • Nim should take inspiration out of other languages doc sites where a banner is placed at the top notifying the reader it is for a previous version with a link to the current version. Could also add a rel=canonical meta tag pointing to the latest version so search engines funnel people there.

    "Nim gc" on Google indeed puts you at the 1.4 doc page.

    • Slight OT: are is the best documentation management system these day?

      ReadMe, Docusaurus, Mintlify, etc?