5 ms·
I would assume not. Consider ARC vs GC. With ARC the programmer manages memory and with GC the compiler manages it. People choose one or the other because of th
by tarwich 11mo ago
I would assume not. Consider ARC vs GC. With ARC the programmer manages memory and with GC the compiler manages it. People choose one or the other because of the style they're going after. Could you set a flag for it. Maybe if all libraries you download were pre-compiled perhaps.
Personally, I just prefer to know that the team that supports the tool I'm using is dedicated to "that one thing" I'm after.
- mpweiher 11mo agoHuh? ARC stands for Automatic Reference Counting. The compiler manages the reference counts.
- Verdex 11mo agoThey may have been thinking rust where it means atomic reference counting. (Although the compiler inserts ref count inc and dec calls automatically, so ...)
- AnimalMuppet 11mo agoYou could do it. You could allocate something as garbage-collectible or not at allocation time. You probably would want them to be different types, though, so that the type system keeps track of whether you need to manually deallocate this particular thing, or whether the garbage collector will do so. It could be done... but I'm not sure what it would gain you. It seems to me that knowing that it will do one or the other is better than having to think about which it will do in each instance.
- Imustaskforhelp 11mo agoNim language iirc can have either of arc or gc and even manual etc. via their Multi-paradigm Memory Management Strategies Source: https://nim-lang.org/1.4.0/gc.html https://nim-lang.org/1.4.0/gc.html