Skip to content

Tracking Issue: Vaporization Checklist #53

@slightknack

Description

@slightknack

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:

  • Remove mutation in closures, enforce only mutable in local scope rule.
  • Add last_use pass to compiler.
  • Add support for CoW in tagged.
  • Modify gen to work off of last_use pass.
  • Add instructions that manage CoW pointers.
  • Add support for instructions in vm
  • Tests and so on - fine-grained extension to more complex data types, like slices of lists.

For those interested, there's a forever-WIP post on vaporization on my blog: https://slightknack.dev/blog/vaporization/.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureFeatures that add something new to the language

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions