sunfishcode commented on Issue #1031:
Cranelift (formerly Cretonne) is currently focusing on "backend" compilation, however if it is successful, we hope to extend it some day with high-level inter-procedural optimizations.
While Cranelift includes the
cranelift-wasm
crate for translating wasm, it isn't sufficient for complete wasm compilation. One needs additional support, such as the support now provided by Wasmtime.It is theoretically possible that Cranelift could output to wasm some day, however it is not set up to do so right now.
Cranelift is indeed meant to be useful in both JIT and AOT configurations. Lucet and rustc_codegen_cranelift are examples of using it in an AOT configuration, and Wasmtime is an example of using it in a JIT configuration.
If you have any further questions, please re-open this issue or file a new one!
sunfishcode closed Issue #1031:
The readme says that cretonne is supposed to be a code generator for WebAssembly, but it's a bit unclear what that means, seeing how there doesn't appear to be anything to actually do with wasm in the code.
- I heard that cretonne is meant to have inter-procedural optimizations as another layer built over top. Is this true, and always going to be the case?
- Does another tool to translate wasm to cretonne IR need to be built in order to generate code for wasm?
- Is it in scope for cretonne to output to wasm, or is it only intended to output to native code? (e.g. will I be able to use cretonne as a pure-rust binaryen alternative?)
- Is cretonne meant to be useful in both JIT and AOT configurations?
Preferably, the readme or documentation should be able to answer these questions.
Last updated: Dec 23 2024 at 12:05 UTC