Remix.run Logo
Findecanor 2 days ago

I'm looking at how to introduce unique, borrowed and GC'd reference types into the IR for my VM/runtime.

I'm inspired by the language Lobster's compiler that specialises functions to arguments of either reference type as a way of doing something analogous to using "escape analysis" to allow objects to be owned by the stack. I think that perhaps specialised functions could be re-merged, with compile-time checks replaced with very cheap runtime checks taking advantage of "upper byte ignore" bits in pointers.

The VM will also need to support not just managed source languages, but also languages where unique and borrowed references are statically checked and possibly stored in objects.