Stream: cranelift

Topic: WASM backend


view this post on Zulip John Nunley (Sep 08 2023 at 14:19):

Would a WASM backend for cranelift make sense at all? I was thinking about using cranelift for a bootstrapping project of mine

view this post on Zulip bjorn3 (Sep 09 2023 at 12:57):

Yes :) https://github.com/bytecodealliance/wasmtime/issues/2566 Also see https://github.com/cfallin/waffle which may be useful in implementing such backend.

Feature Add a Cranelift backend that compiles to Webassembly. Benefit This would allow a compiler to run in the browser and compile code to run in the browser. Implementation No plan yet Alternativ...
Contribute to cfallin/waffle development by creating an account on GitHub.

view this post on Zulip Kirp (Aug 19 2024 at 23:36):

Have there been any updates on this in the last few months?

view this post on Zulip Chris Fallin (Aug 19 2024 at 23:40):

nope, no one has written a Wasm backend for CL or is working on it to my knowledge; anyone who wants to is encouraged to comment on the issue above

view this post on Zulip bjorn3 (Aug 20 2024 at 07:03):

https://github.com/rust-lang/rustc_codegen_cranelift/blob/waffle/src/driver/wasm.rs has a very bare bones wasm backend.

Cranelift based backend for rustc. Contribute to rust-lang/rustc_codegen_cranelift development by creating an account on GitHub.

view this post on Zulip Vulcain (Aug 20 2024 at 08:49):

I will do it once I'm done with the winch aarch64 implementation :smile:

view this post on Zulip Kirp (Aug 20 2024 at 19:04):

I was going to say I can make a bit of an attempt over next month or so but would definitely be the largest contribution to cranelift I’ve really tried to do

view this post on Zulip fitzgen (he/him) (Aug 20 2024 at 19:18):

https://github.com/bytecodealliance/wasmtime/pull/9089 is a relatively recent example of what adding a new backend to cranelift looks like

This commit adds two new backends for Cranelift that emits 32- and 64-bit Pulley bytecode. The backends are both actually the same, with a common implementation living in cranelift/codegen/src/isa/...

view this post on Zulip Kirp (Aug 23 2024 at 15:11):

Looking at isle instructions, I guess most of this set corresponds to MInsts of the wasm virtual machine https://webassembly.github.io/spec/core/appendix/index-instructions.html


Last updated: Dec 23 2024 at 12:05 UTC