Works fine, except for one problem. It doesn’t allow me
to put everything into /foo/bar, it somehow requires to
put everything into /wasm, except maybe for the shell.
Shouldn’t things on the web work with relative links? Like
once I have something like in the shell:
<script src="<path>/swipl-web.js"></script>
The JavaScript file swipl-web.js should orient itself, and be able to
fetch swipl-web.data and swipl-web.wasm from the same <path>.
Ok, problem could be local store, if for example I have multiple
<path1>, <path2>, … SWIPL WASM on the same server, like
different versions. Will the browser access the same local store?
Or is it bound to the document? I am not so familiar with local
store, but the relative path request is independent.
By changing locateFile you can make it find the WASM components from where you want, (probably even simply from SWI-Prolog WASM demos. See emscripten docs.
How would I use SWIPL WASM from for example within JSFiddle, without much coding on my side. Currently the page shell.html contains a hell lot of code. Is there some xxx.js
I can refer to and everything works fine?
A test case would be for example from Tau Prolog:
Not yet. Eventually something like that should emerge. As is, if you just want Prolog and no shell, you need some 20 lines of code. This can be shortened a bit further by moving initialization everyone needs into prolog.js (and from there to swipl-web.js).
Possibly some parts of shell.html should move there too. Most of that file is concerned with the (very minimal) user interface though.