by bmitc · 4y ago · 0 comments
Engineers are always looking for technologies to hop onto. Prolog is niche for a reason: I don’t think Prolog scales. In some ways it is too flexible and powerful.
I still avoid it, because yeah, once you solve that problem and avoid those thousands of lines, you are stuck. If you try make the rest of your system in Prolog, it will become a non-viable mess before you even finish it.
That said, I think the main thing that Prolog is missing is easy integration with other languages. If I could define some environment in Haskell, pack it with some Prolog predicate and get a list back, I would use it all the time.
Javascript: http://tau-prolog.org/
Java: https://apice.unibo.it/xwiki/bin/view/Tuprolog/ (also SWI, Ciao and Sicstus have Java bridges)
Go: https://github.com/ichiban/prolog
Common Lisp: https://www.cliki.net/Prolog
Racket: https://docs.racket-lang.org/racklog/
Guile: https://gitlab.com/gule-log/guile-log
Erlang: https://github.com/rvirding/erlog
Also SWI and Ciao have a pretty straight forward FFI for C.
I've been spending a ton of time with the language and its implementation through my day job, and I recently spoke about its use as a DSL for embedded knowledge bases: https://www.youtube.com/watch?v=lYLkaOq7WbU
Sounds like there is a use case for abstraction? Category theory maybe?
Prolog III is considered the origin of constraint logic programming: http://www.prolog-heritage.org/en/ph30.html
That said, I used it for a simple game AI at university. My AI was the best of the class and it was something like 30 LOC. I remember thinking I would have spend 5x more time writing the same thing in C instead of 1 hour (plus some tests and play session)
I do have some ideas for some apps I'd like to tackle at some point. Those primarily consist of interacting with system constraints.