4 ms·
The Janus System: Multi-Paradigm Programming in Prolog and Python
- herodotus 3y agoAnyone 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&doi=586617d87c210139f456149f2d2d30e768ec5261 https://citeseerx.ist.psu.edu/document?repid=rep1&type=pdf&d...
- winter_blue 3y agoWow, this is pretty awesome. Does anyone know if there are any languages that implement this?
- deleted 3y ago[deleted]
- bmitc 3y agoI think it would be easier to embed Shen in a language. By implementating the kernel language KLamba, you get Shen, which includes a Prolog.
- leetrout 3y agoRelated... Prolog -(ish)-> Datalog -> Rego & OPA https://www.openpolicyagent.org/docs/latest/policy-language https://www.openpolicyagent.org/docs/latest/policy-language https://pypi.org/project/opa-python-client/ https://pypi.org/project/opa-python-client/
- anentropic 3y agoIt 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://www.swi-prolog.org/pldoc/man?section=janus-intro https://swi-prolog.discourse.group/t/a-bundled-python-interface/6735/97 https://swi-prolog.discourse.group/t/a-bundled-python-interf...
- refset 3y agoJust 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(%27packages/janus.html%27) https://www.swi-prolog.org/pldoc/doc_for?object=section(%27p...
- galaxyLogic 3y agoHow 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.
- convolvatron 3y agothis 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
- galaxyLogic 3y agoThanks for the hint. Very interesting https://www.openpolicyagent.org/docs/latest/ https://www.openpolicyagent.org/docs/latest/
- photon_lines 3y agoCool. 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 https://github.com/photonlines/Python-Prolog-Interpreter
- nurettin 3y agoIt looks great. I guess it is also possible to construct expressions in python directly without parsing a prolog string.