triska / ediprolog

Emacs Does Interactive Prolog
https://www.metalevel.at/ediprolog/
37 stars 8 forks source link

Portable Prolog toplevel #2

Open triska opened 8 years ago

triska commented 8 years ago

ediprolog is currently tailored for Scryer Prolog and SWI-Prolog. The idea carries over to other Prolog systems too of course. Already now, there is also a variant for YAP, and Haitao Zhang has generously contributed a patch to make it work for XSB. See #1 for more information.

Thus, how do we best support the various Prolog systems?

In my opinion, the best way out is to write a portable Prolog toplevel (in Prolog) and include it in the Lisp file. Then, no matter which Prolog system is being used, we could first load our custom toplevel, and then handle all systems in a uniform way. Ideally, only the way in which the system is invoked will need to be adapted for different Prolog systems.

Writing a portable toplevel notably requires a variable_names/2 option in read and write options. There is active work in the Prolog ISO standard to get such options included.