-
Notifications
You must be signed in to change notification settings - Fork 157
Open
Description
Hello @mthom! Would it be possible to compile and run scryer as a WebAssembly binary? I worked some time ago on SWI-Prolog WebAssembly port but it turned out to be rather difficult due to:
- Clib/POSIX platform expectations (like getting stuck with the Emscripten's broken readdir and other functions);
- Fighting with the build system (it requires intermediate binary to build itselt);
- Awful difficulties with cross-compiling C as usual.
Also, it was quite inconvenient to provide API for JavaScript. It takes hundreds of lines of handwritten code to bind JS functions to low-level FLI, a SWI-Prolog's FFI.
More info: SWI-Prolog/roadmap#43
It seems like Rust has some support for WebAssembly (https://developer.mozilla.org/en-US/docs/WebAssembly/Rust_to_wasm).
What do you think:
- Would it be possible to build scryer as a WebAssembly binary?
- Could scryer be decoupled from filesystem/POSIX/threading/signals requirements and run without filesystem, clib or any syscalls at all?
- Would it be possible to use wasm-bindgen to generate useful API? (It could be something quick-and-dirty like terms serialized as JSON strings at first)
triska, infogulch, jarble, ndebuhr, guregu and 1 more
Metadata
Metadata
Assignees
Labels
No labels