Could you provide a minimal example demonstrating how to use otus to work with WASM? #50
-
As title. I tried owl, first compile .scm to .c, then .c to .wasm with WASI-sdk, but it won't work. So I tried this one, but seems like the CLI usage is different. Thanks a lot! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Try You should be aware of a bug in emscripten for unblocking access to the stdin and other ports. Please check the Ol Makefile for details (line 304, started from Additionally, you can check out the "pacman" sample to understood how to embed olvm into your code. The full usage example can be found at the project page sources (sorry for lot of comments, I'm not a js dev so code is a bit shitty :)). |
Beta Was this translation helpful? Give feedback.
Try
make olvm.wasm
from Otus Lisp repository folder. Emcc should be available by the $PATH (usingsource path-to-the-emscripten/emsdk_env.sh
, for example).You should be aware of a bug in emscripten for unblocking access to the stdin and other ports. Please check the Ol Makefile for details (line 304, started from
# important note: fix for emscripten to asyncify stdin: ...
.Additionally, you can check out the "pacman" sample to understood how to embed olvm into your code.
The full usage example can be found at the project page sources (sorry for lot of comments, I'm not a js dev so code is a bit shitty :)).