Was just browsing this docu, but couldn’t make head nor tail:
Using SWI-Prolog in your browser (WASM)
https://www.swi-prolog.org/pldoc/man?section=wasm
Is there any way to schedule a callback inside Prolog? This is
easily done in JavaScript via setTimeout(). Its not that I would like
to await some promise, the below setTimeout() is a fire
and forget. I would like to run this example:
tick(0) :- !.
tick(N) :- M is N-1, write('tick '), flush_output,
call_later(tick(M), 1000).
tock(0) :- !.
tock(N) :- M is N-1, write('tock '), flush_output,
call_later(tock(M), 5000).
It should display something along:
?- tick(11), tock(3), sleep(12000).
tick tock tick tick tick tick tock tick tick tick tick tick tock tick true.