Re:For Better Computing, Liberate CPUs from Garbage Collection
by babyloneleven on Thursday May 09, 2019 @01:05PM
(#19870032)
Compilers of managed languages already do this optimization when they can prove that a variable has a static lifetime. Look up scape analysis.
The trouble is, this is hard to do for non-trivial code (and in the general case is uncomputable).
Re:For Better Computing, Liberate CPUs from Garbage Collection
by babyloneleven on Thursday May 09, 2019 @01:06PM
(#19870047)
I'm not finding how to edit, but, it's called escape analysis
For those of us who might want some of the performance characteristics of Rust, but not to the extent that we're willing to take on all of the strictures it imposes, what's the feasibility of building a compiler that can avoid GC for objects whose lifetime can be determined statically, while still retaining GC for the rest?
My (wild) guess is that it wouldn't actually gain you any real practical advantage over a good generational GC, but still, I'm curious if anyone has looked into something like that.