3 ms·
I'd love to check that out. Did it unroll a wasm interpreter into wasm_op function calls?
by sitkack 2y ago
I'd love to check that out. Did it unroll a wasm interpreter into wasm_op function calls?
- CryZe 2y agoThere's no interpreter, I just map each instruction to equivalent Rust code. Linear memory is accessed through a trait. The compiler is here: https://github.com/CryZe/wasm-to-rust https://github.com/CryZe/wasm-to-rust I have an example of a GameBoy emulator compiled from AssemblyScript to WASM to Rust here: https://github.com/CryZe/wasmboy-rs/blob/master/src/wasm.rs https://github.com/CryZe/wasmboy-rs/blob/master/src/wasm.rs
- sitkack 2y agoThat is super cool! Have you run into any limitations? Have you tried running in loop, wasm->rust->wasm->rust ? This is not-unlike unrolling an interpreter. There was a lua2c project that did something similar.