Interface between Julia and SWI-Prolog (Discussion)

I would suggest you make it a pack, that way it will be much easier to install and build for the prolog community:
https://www.swi-prolog.org/howto/Pack.html

@haldai,

Instead of using kw(Key, Value) for keyword arguments, why not just use Key=Value? It is much closer to Julia, and it is just as easy to do from the prolog point of view.

By the way, I find your package really useful for quickly plotting and analyzing data. Thanks!

Great resource. Note that if calling C is your target you can also use the ffi pack (which also contains demo code to call Python)

1 Like

Thank you for the suggestions, I am using kw/2 because inside of Julia the keywords assignments in functions are parsed as Expr(:kw, :Key, :Value) rather than Expr(:=, :Key, :Value). But I agree that it is not difficult to make them more natural.

I will update and make the interface available as a pack soon!

Thank you very much! I will try the ffi pack, it looks awesome!

On the repo readme file you wrote:

This package is only tested on Linux, not sure if it will compile on MacOS (maybe) or Windows (very unlikely).

After installing Julia using MacPorts, replacing all references to .so libraries with .dylib in the repo files and running make, all the examples I tried from the readme file work as expected :slightly_smiling_face:

Thank you so much for testing! I’ll try to revise the code to make it compatible with both Linux and Mac in the next version :grinning:

1 Like