Nova

@trynova.dev

a JavaScript (ECMAScript) and WebAssembly engine written in Rust and following data-oriented design principles

trynova.dev/blog/garbage... Last Sunday I discovered that lifetimes on #Rustlang garbage collected handles should be contravariant on their lifetime parameter. This is an open research question, but I think this opens a path to meaningful lifetimes on self-referential structs. Check it out!

Garbage collection is contrarian · Nova

Modeling unrooted handles to garbage collected data using contravariant lifetimes.

trynova.dev

AapoAlas@aapoalas.trynova.dev · 7mo ago

I'm being a total nutcase, but I found what I think is an important discovery about modeling garbage collected handles to the #Rustlang borrow checker: the lifetime of GC handles is contravariant! Instead of validity "rising up the call stack" it "droops down from the heap". Blog incoming!

The downside in a moving GC with unrooted stack values is that the engine needs to be very careful around things that could trigger GC: Thankfully Rust can make this a build-time check. The upside is that you see all the places where JS code can be called. It's terrifying: How does anything work!