Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

1. Nim uses 'var' modifier to pass by reference, e.g. "proc (n: var int)...", default behaviour is pass by value. And there're also raw pointers and references (safe pointers).

>is a no-gc mode available?

You can disable gc, but most of standard library depends on it. But in Nim 2.0 there's finally support for ARC and ORC (ARC + cycle collector).



> default behaviour is pass by value

Is not exactly true, smaller than 24 bytes is passed by value, the compiler optimizes larger calls and passes by reference implicitly.


I've been searching and can't find it: A in ARC is for automatic, what does the O stand for?


O is a visual pun because it adds a cycle collector to ARC.


I assumed the O was for "optimised", but apparently it stands for "cycle":

https://nim-lang.org/blog/2020/12/08/introducing-orc.html




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: