Execution in browser - trueagi-io/PeTTa GitHub Wiki
It needs this .js file, invoke from a HTML file:
https://wasm.swi-prolog.org/wasm/swipl-bundle.js
The Prolog code to let the swipl bundle digest:
cd /PeTTa/src
cat *.pl > PETTA
echo "metta(I) :- process_metta_string(I,O), swrite(O,S), format("Result: ~w~n",[S])." >> PETTA
Then in Javascript: Prolog.query('metta("YOUR_METTA_CODE").').once()
Bundle for v1.0.1:
Examples: