I don’t know whatever that language is doing is called, but it’s not reference counting. It’s doing some kind of static code analysis, and then it falls back to reference counting.
If you call that reference counting, what stops you from calling garbage collectors reference counting too? They certainly count references! Is the stack a reference count too? It keeps track of all the data in a stack frame, some of it might be references!
Garbage collection is pausing the main thread while you go searching the heap for memory to free up. It’s slow and unpredictable about when it’ll happen or how long it’ll take. That’s a very different process indeed and roc doesn’t do it.
Whether you call it static reference counting or not, when roc chooses in-place mutation it’s because it would have satisfied the borrow checker. It can do a wider class of such things when stuff goes out of scope. There’s a webserver platform that does arena allocation, often swerving cache misses as a result, but crucially frees the entire arena in one step. Freeing up all the tiny little bits of memory for lots of individual stuff as you go along as rust would do would be far slower.
Calling that kind of thing garbage collection is I think very misleading indeed.
Optimising your memory management for each problem domain/platform actually give you memory management efficiencies.
I don’t know whatever that language is doing is called, but it’s not reference counting. It’s doing some kind of static code analysis, and then it falls back to reference counting.
If you call that reference counting, what stops you from calling garbage collectors reference counting too? They certainly count references! Is the stack a reference count too? It keeps track of all the data in a stack frame, some of it might be references!
Garbage collection is pausing the main thread while you go searching the heap for memory to free up. It’s slow and unpredictable about when it’ll happen or how long it’ll take. That’s a very different process indeed and roc doesn’t do it.
Whether you call it static reference counting or not, when roc chooses in-place mutation it’s because it would have satisfied the borrow checker. It can do a wider class of such things when stuff goes out of scope. There’s a webserver platform that does arena allocation, often swerving cache misses as a result, but crucially frees the entire arena in one step. Freeing up all the tiny little bits of memory for lots of individual stuff as you go along as rust would do would be far slower.
Calling that kind of thing garbage collection is I think very misleading indeed.
Optimising your memory management for each problem domain/platform actually give you memory management efficiencies.