ediprolog icon indicating copy to clipboard operation
ediprolog copied to clipboard

Support Trealla

Open jgarte opened this issue 1 year ago • 6 comments

Hi,

Would you accept a patch to add support for trealla in ediprolog?

jgarte avatar Jul 05 '24 22:07 jgarte

Yes absolutely, it would be great to have support for Trealla, one of the newest Prolog systems, also aiming for conformity to the Prolog ISO standard!

The first consideration should be: What are the main differences between the toplevels of Scryer and Trealla Prolog? If they are largely compatible, then setting ediprolog-system to scryer would work also for Trealla. If there are any differences, then ideally the systems can become more compatible.

The ideal solution is described in #2: Implementing in Prolog a toplevel that is portable between different Prolog systems, so that all systems can be treated identically from within Emacs, even though their default toplevels may differ.

triska avatar Jul 06 '24 08:07 triska

Would that ediprolog-system variable value then be called iso instead of scryer or something else?

jgarte avatar Jul 06 '24 12:07 jgarte

Seems to work for the true. term in my screenshot above:

image

But it doesn't seem to know about the modules I've imported in my module like clpz 🦆

WDYT?

ediprolog-system is set to scryer and ediprolog-program is set to "/gnu/store/wg2fl6saa1rk0d2ms1js1c57fky6gzw2-trealla-2.53.47/bin/tpl". I packaged trealla for Guix, hence the funny program path.

jgarte avatar Jul 09 '24 22:07 jgarte

In this example, clpz is imported only locally in your own module, so not directly available from module user. I think it is the same in Scryer.

One way to solve this is to remove the module/2 declaration at the start of the file tetrachords.pl. You can re-add it after development is finished. Then, you can access clpz either by module-qualifying it: clpz:..., or by importing it yourself also at the toplevel, by evaluating the query ?- use_module(library(clpz)).. You then have it available in the module and also on the toplevel.

triska avatar Jul 10 '24 05:07 triska

Great! That works now using the tpl executable (trealla). Thanks!

image

jgarte avatar Jul 10 '24 06:07 jgarte

Where should we go from here?

#2 ?

jgarte avatar Jul 10 '24 06:07 jgarte