second-state / wasm-learning

Building Rust functions for Node.js to take advantage of Rust's performance, WebAssembly's security and portability, and JavaScript's ease-of-use. Demo code and recipes.
https://www.secondstate.io/articles/getting-started-with-rust-function/
485 stars 102 forks source link

Why .\wasmedge.exe --reactor .\add.wasm add -10 1 results in 4294967287? #43

Open rgl opened 1 year ago

rgl commented 1 year ago

While trying https://wasmedge.org/book/en/quick_start/run_cli.html#call-a-webassembly-function-compiled-from-rust on Windows 10 as:

.\wasmedge.exe --reactor .\add.wasm add -10 1

It returned an unexpected value of:

4294967287

Is this expected? From what I understood, the rust add example uses a rust i32 (signed integer), so this result is unexpected to me.