Comment by zahlman
1 day ago
Prolog admittedly mystifies me even more than the Haskell family. How do you do anything effectful, like read from a file, or output arbitrary data to standard out, or set up a loop to process keyboard events every 1/n seconds? How do you make system calls?
By thinking in LP terms, like FP, LP requires rewiring the brain to think differently how to approach algorithms.
Here is a sample on how to read a file.
https://lpn.swi-prolog.org/lpnpage.php?pagetype=html&pageid=...
How to make syscalls,
https://www.swi-prolog.org/pldoc/man?section=foreign