On the current course, when the wasm tail-call feature is standardized, we'll loose the ability to pass a wasm function pointer to native Rust or C code.
Because the tail-call feature is incompatible with the native calling conventions on Linux and Windows
and Mac
And the current proposal will require all exported functions to be compatible with the tail-call feature.
Currently exported functions are also compatible with the JS ABI (for a lack of better terminology) but that doesn't stop wasm from optimizing calls to those functions when they are imported into a wasm module somewhere else. I'm not really clued into the WASI semantics but could an exported function not have multiple entry points / ABIs, to support this use case properly? The situation seems analogous to the JS case.
(Hm, my avatar looks like the corona virus, maybe time to update.)
It's more than just multiple entrypoints, because we need to fix up the stack pointer on return. We could do it with a wrapper function though.
Last updated: Nov 22 2024 at 16:03 UTC