3 ms·
I’ve had a few use cases for a Prolog-suitable solution over the past decade, but there doesn’t seem to be an easily embeddable Prolog system available, or mayb
by baq 3y ago
I’ve had a few use cases for a Prolog-suitable solution over the past decade, but there doesn’t seem to be an easily embeddable Prolog system available, or maybe there wasn’t a couple years ago. I needed a small library without IPC, sockets, forking, watchdogs, etc. Python and node bindings are a gigantic bonus.
- pipo234 3y agoIMHO Prolog is mostly a way of thinking, of designing your software. Making a blazingly fast compiler is an art, but the basic interpreter at the heart of prolog is fairly straight forward to design yourself. Prolog isn't as old as LISP, but keep in mind it had useful applications on contemporary hardware in the 1970s. If you're interested in doing Prolog with Python, have a look at projects like: https://github.com/photonlines/Python-Prolog-Interpreter https://github.com/photonlines/Python-Prolog-Interpreter
- 59nadir 3y agoI worked with a guy that was doing natural language analysis of some sort in Prolog for a contract (we worked at a game development studio, so this was entirely external). I asked him how he actually used it and he basically said what you wrote here: He implemented his own interpreter (in C#) and limited backtracking considerably (as far as I understood) in order to make it useful performance-wise for their use case.
- grose 3y agoFor Node, check out trealla-js: https://github.com/guregu/trealla-js https://github.com/guregu/trealla-js. I tried to make it as easy to embed as possible. This paper is also very interesting. It describes the Janus System, a deep integration between Python and Prolog: https://arxiv.org/pdf/2308.15893v1.pdf https://arxiv.org/pdf/2308.15893v1.pdf
- Avshalom 3y agofor Node there's also http://tau-prolog.org/ http://tau-prolog.org/