ciao-lang / ciao

Ciao is a modern Prolog implementation that builds up from a logic-based simple kernel designed to be portable, extensible, and modular.
https://ciao-lang.org
GNU Lesser General Public License v3.0
268 stars 20 forks source link

(playground) read/1 gives end_of_file #58

Open Jean-Luc-Picard-2021 opened 2 years ago

Jean-Luc-Picard-2021 commented 2 years ago

I just tried read/1, it gives immediately end_of_file:

ciao_read

jfmc commented 2 years ago

Thanks. A known issue and documented in limitations. Stdin and signals (including C-c, timeouts) are not working yet. As you know abort is implemented as a hard reset. We have all the pieces to make it work but we are making sure that we touch the right places and do not break anything.

Jean-Luc-Picard-2021 commented 2 years ago

What do you mean by "documented", do you have a link?

Edit 09.08.2022: Ok, I got it, if I scroll down here:

Reading input from standard input (read/1) is currently not directly supported, due to WebAssembly limitations. We plan also to fix this soon

https://ciao-lang.org/ciao/build/doc/ciao_playground.html/ciao_playground_using.html

jfmc commented 1 year ago

Reopening since this is still not fixed.

jfmc commented 4 months ago

Reopening, still not fixed. The proposal https://v8.dev/blog/jspi-ot may help here but we'd need to wait until it is commonly available in browsers. Another alternative is to yield from Prolog whenever we are reading/writing from the console (but this is hard from C).