FYI Rust RFC 3729 is up. Oli (Scherer) was telling me about this, and how it will make it possible to teach the Rust compiler about externrefs, which should be useful for our Rust bindgen.
Raising it here since this seems relevant for us. Want to make sure that at least @Alex Crichton, @Dan Gohman, and @fitzgen (he/him) have seen this.
This might also be relevant to the way Rust interacts with Wasm GC types I believe.
I suspect that this certainly doesn't hurt the future externref story for Rust but I also don't think it will necessarily trivially unlock it. For example it's possible to have an externref
function parameter or local variable but it's not possible to take the address of it (without further language/codegen changes). Basically the fact that externref
effectively lives in a different address space makes it particularly problematic.
If it's possible to use this RFC to statically have a type that can be used in function parameters, function locals, and returns, but NOT be able to use it in structs/enums then that'd be perfect for externref. Effectively externref won't work for now in structs/enums because it can't live in memory and it basically doesn't make sense to even construct a value of those types. As a primitive though it can possibly be useful
I seeeee - ty for looking into this and sharing your analysis!
Last updated: Dec 23 2024 at 14:03 UTC