2 ms·
ARC is not new, it was used by Apple in their languages for at least 10 years now.
by coliveira 5y ago
ARC is not new, it was used by Apple in their languages for at least 10 years now.
- ______-_-______ 5y agoObviously parent is not claiming that Nim invented the concept of reference counting. They're saying that it's a recent addition to Nim, and Nim's other memory management strategies have been part of the compiler for longer.
- elcritch 5y agoThat and that Nim's ARC system extends the concept a bit further to include move semantics and limited ownership rules. Nim had a traditional RC garbage collector before, but ARC is case where "the whole is greater than the sum of parts". Swift and Obj-C's ARC system relies on atomics and their associated issues (explained well here: https://news.ycombinator.com/item?id=15046481 https://news.ycombinator.com/item?id=15046481). Nim's ARC system relies on ownership rules that require a single thread to "own" any ARC-managed memory which removes the need for locks or atomics in the reference counts. That eliminates the non-determinism of locks & atomics when doing the RC accounting, overall improving latency and performance. Move semantics increase performance and enables "giving" ownership of ARC-managed memory to another thread.