3 ms·
This hits on something I've been wondering about lately: For those of us who might want some of the performance characteristics of Rust, but not to the extent
by bunderbunder 7y ago
This hits on something I've been wondering about lately:
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.
- rienbdj 7y agoI think this was the promise of D. For some reason it's not very popular.
- babyloneleven 7y agoCompilers 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).
- babyloneleven 7y agoI'm not finding how to edit, but, it's called escape analysis