olynch opened issue #10222:
Feature
Provide a webassembly codegen backend for cranelift, in parallel to the x86_64, aarch64, etc. backends.
Benefit
- This would enable compilers that target CLIF to also produce WASM; specifically debug builds for rustc could target WASM.
- Cranelift could be used as a WASM-to-WASM optimizer like binaryen.
Implementation
Unfortunately, I don't have an implementation plan and I probably would not work on this, but I would use this in a compiler if it existed.
Alternatives
Compilers could instead emit WASM directly, and then pass that WASM through cranelift to achieve native compilation and optimize it with binaryen for WASM output.
bjorn3 commented on issue #10222:
Duplicate of https://github.com/bytecodealliance/wasmtime/issues/2566
cfallin closed issue #10222:
Feature
Provide a webassembly codegen backend for cranelift, in parallel to the x86_64, aarch64, etc. backends.
Benefit
- This would enable compilers that target CLIF to also produce WASM; specifically debug builds for rustc could target WASM.
- Cranelift could be used as a WASM-to-WASM optimizer like binaryen.
Implementation
Unfortunately, I don't have an implementation plan and I probably would not work on this, but I would use this in a compiler if it existed.
Alternatives
Compilers could instead emit WASM directly, and then pass that WASM through cranelift to achieve native compilation and optimize it with binaryen for WASM output.
Last updated: Feb 28 2025 at 02:27 UTC