Hacker News new | past | comments | ask | show | jobs | submit login
The Janus System: Multi-Paradigm Programming in Prolog and Python (arxiv.org)
85 points by woolion on Sept 1, 2023 | hide | past | favorite | 11 comments



Anyone interested in calling Prolog from an imperative programming language might be interested in this 1995 paper:

https://citeseerx.ist.psu.edu/document?repid=rep1&type=pdf&d...


Wow, this is pretty awesome. Does anyone know if there are any languages that implement this?



I think it would be easier to embed Shen in a language. By implementating the kernel language KLamba, you get Shen, which includes a Prolog.


How about (creating) a Prolog interpreter which consumes and outputs JSON?

Then use #SheBang to make any such prolog-file interpreted by that interpreter to return JSON to the caller. Then it could be integrated to ANY program written in any language which uses the Unix shell-calling conventionss.


this is certainly a very useful idea. the Rego datalog language leans on this pretty heavily, although its emphasis is on access policy more than general transforms.

ddlog is another datalog variant that supports this, but I believe you need to specify the schema as a rust type


Thanks for the hint. Very interesting

https://www.openpolicyagent.org/docs/latest/


It appears that this originated with XSB Prolog but subsequently SWI Prolog is offering something similar/compatible too:

https://www.swi-prolog.org/pldoc/man?section=janus-intro

https://swi-prolog.discourse.group/t/a-bundled-python-interf...


Just noting that the documentation found at your first link is much easier to skim by clicking on the parent section - i.e. https://www.swi-prolog.org/pldoc/doc_for?object=section(%27p...


Cool. I wrote a subset of Prolog using only a few lines of Python and if anyone is interested, you can find it here: https://github.com/photonlines/Python-Prolog-Interpreter


It looks great. I guess it is also possible to construct expressions in python directly without parsing a prolog string.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: