40 points · by ijelliti · 5y ago · 18 comments
What is the trade off here with auto free ? Is it still possible to have memory leaks in some scenarios ?
What about concurrency or multi threaded situations ?
For mutable objects shared across threads, reference counting will be used.
V has the same issue and autofree will not be able to fix it.
Reference counting is also necessary even in entirely single threaded programs to handle some situations.
It's concerning you state things that are categorically false with such certainty.
* It falls back on RC when it can't guarantee something's lifetime, so it still does some RC.
* Can't store objects on the stack. (Lobster mitigates this with other aspects of their memory model, I'm not sure if vlang does)
* Vulnerable to cycle leaks. IIUC vlang has no weak refs to break these cycles yet.
* Space overhead per object to store the RC.
Still, its nice to see more languages not using GC. Hopefully as Lobster innovates, vlang can adopt more of their techniques.
i first heard of him via Volt app. and then he went on to create vlang which looks very good from what i've seen
I no longer work alone though, we have a large team, and I think only about 50% of code is written by me at this point.
Although the autofree engine this video is about is fully my work.
I guess community and adoption will make it or break it