Comment by throwawaymaths
6 months ago
you track how the variable is used in the compilation unit which should have a finite set of possibilities?
6 months ago
you track how the variable is used in the compilation unit which should have a finite set of possibilities?
This is about tracking allocated memory, which is different. I know V claimed it could solve this with static analysis, but in practice it didn't work and had to fallback to a GC.
This is true for all similar schemes, that they have something for easy for simple-to-track allocations, and then have to fallback on something generic.
But even that is usually assuming that the language is somehow having a built-in notion of memory allocation and freeing.
It should be possible in zig! Here's a proof of concept, I would guess that if V failed it was because they tried to do it at the language level. If you analyse intermediate representations the work is much, much easier.
https://youtu.be/ZY_Z-aGbYm8?feature=shared