Vaporization is not yet implemented, as there are other features that need to be in place before it makes sense to add it in. Here's how we'd need to do this, from #52:
To do so, we'll need to add a new pass to the compiler, potentially named last_use.rs or something, that walks the AST backwards and records the first occurrence (i.e. last use) of each variable. The second thing we need to do is add support for Rust's Cow pointers (clone on write) in tagged.rs. After that, we'll need to modify the generation step (gen.rs) to take last use into account, and emit instructions for moving out of shared Cow references. Finally, the VM will need to add minor runtime support around instructions for copying shared references. I'll open an issue with a tracking list so we can keep track of work wrt that.
Here's that issue! And, as promised, the checklist:
For those interested, there's a forever-WIP post on vaporization on my blog: https://slightknack.dev/blog/vaporization/.
Vaporization is not yet implemented, as there are other features that need to be in place before it makes sense to add it in. Here's how we'd need to do this, from #52:
Here's that issue! And, as promised, the checklist:
last_usepass to compiler.CoWintagged.gento work off oflast_usepass.CoWpointers.vmFor those interested, there's a forever-WIP post on vaporization on my blog: https://slightknack.dev/blog/vaporization/.