llrt
llrt copied to clipboard
llrt crashes when trying to load wasm
/*
https://webassembly.github.io/wabt/demo/wat2wasm/
(module
;; add(a, b) returns a+b
(func $add (export "add") (param $a i32) (param $b i32) (result i32)
(i32.add (local.get $a) (local.get $b))
)
)
*/
const bytes = Buffer.from(
'AGFzbQEAAAABBwFgAn9/AX8DAgEABwcBA2FkZAAACgkBBwAgACABagsAGARuYW1lAQYBAANhZGQCCQEAAgABYQEBYg==',
'base64'
)
const wasm = new WebAssembly.Module(bytes)
console.log(wasm)
console.log('wasm loaded!')
llrt outputs nothing (exiting with code 0 right before the console.log
s), while on node this code works fine
$ ./llrt llrt-test.js
$ node llrt-test.js
Module [WebAssembly.Module] {}
wasm loaded!
LLRT (darwin arm64) 0.1.10-beta
Hi @teidesu. Thanks for the report. Unfortunately, WASM is not supported at the moment. WASM requires a warm runtime that will significantly add to the complexity of this project and contribute to startup time. There are lightweight alternatives, but they also need to also interop with our engine QuickJS and Rust that makes it a less prioritized feature right now
at least i think it would be nice for the runtime to tell what's wrong and not just crash
at least i think it would be nice for the runtime to tell what's wrong and not just crash
It should not just crash. Where are you running this? Runnin on my local machine gives:
ReferenceError: 'WebAssembly' is not defined
at <anonymous> (index.mjs:15:18)
Where are you running this?
sorry, should have mentioned in the op
macOS 14.2.1 (23C71), Darwin 23.2.0 MacBook M1 Pro (2021)
just checked on linux arm, works fine indeed