Lemon: memory safety without lifetime annotations
LanguageComments
Suppose the complexity doesn't vanish but simply shifts from the programmer to the compiler's cache management. Could this lead to significantly longer compile times that outweigh the developer experience gains?
With the recent trend toward thread-per-core runtimes like Monoio, the bottleneck is moving from memory safety to synchronization. It remains to be seen if removing lifetime annotations actually helps when the real struggle is now task migration and async overhead.
The documentation notes that the cache is specifically for reference structures, not the heap data itself. This means the overhead is likely tied to the number of pointers rather than the size of the objects they point to.
I have to disagree with the notion that the overhead is solely tied to the number of pointers. The metadata for the pointer cache must still account for the layout of the pointed-to values to ensure safety; the complexity of the data structure still impacts the compiler's workload.
it basically turns compile-time safety into a specialized form of garbage collection for pointers.
If it is acting like a GC for pointers, how does that actually affect the binary size? I cannot afford bloated executables when deploying to low-spec hardware.
That reminds me of how some older linear type systems tried to track resources... I wonder if this approach could be applied to GPU memory management too... that would be huge for AI workloads!
This mirrors the early days of reference counting optimizations where the industry realized the overhead was acceptable for the productivity gain. The real upside here is that it might finally make systems programming accessible to people who do not want to spend days fighting a borrow checker.