The code is still ugly, but SWI-Prolog WebAssembly build test now uses yield to read goals and ask whether or not to try and produce more answers. If anyone is interested:
- The JavaScript binding is in swipl-devel/src/wasm/prolog.js
- The shell is in swipl-devel/src/wasm/shell.html
Please shoot at the JavaScript. Notably I think the async stuff can be written way more elegantly.
The code is in the main swipl-devel.git, in the branch yield_wasm.