HACKER Q&A
📣 timxor

Production Prolog in 2020?


Seeker of logic programmers!


  👤 pjmlp Accepted Answer ✓
Upcoming Rust lifetime analysis engine, Polonius.

http://smallcultfollowing.com/babysteps/blog/2018/04/27/an-a...


👤 TheUndead96
I think Prolog and logic programming will have a second renaissance. I think at the very least a general artificial intelligence would require a logical inference engine similar to Prolog.

👤 jmnicolas
Our pay software at work needs a Prolog engine (SWI). I think it's exactly where it shines : a complex logic with a lot of small rules that would be a nightmare to implement and maintain with a if / else logic.

👤 thanatropism
There was a minor hype cycle with SMT solvers in 2019.

For a while I was extremely fascinated by SAT as an encoding for hard problems that somehow had heuristic fast solvers; particularly by SATPLAN, the blocks world, etc.

But there's an useful contrast with Lisp, the other thing everyone within a radius of HN would like to emerge as winner. Lisp is essentially a syntax concept. It isn't particularly opinionated about problems -- on the opposite, it's indefinitely extensible to accomodate nearly everything. So we have Clojure and Hy (a Lisp that superficially imitates Clojure but compiles to the Python AST) and people doing scikit-learn ML on Lisp.

Logic programming, on the other hand, wants problems to be formulated on its terms. It needs the world itself to change to "win big". Of course logic programming problems aren't going to disappear, as sparse linear algebra programs won't. But this isn't a paradigm, it's an application.


👤 PedroCandeias
TerminusDB is a new project being implemented in Prolog: https://github.com/terminusdb/terminusdb-server

👤 tluyben2
I really like working with https://mercurylang.org/ ; I think there are a few companies that use it for production software.

👤 CyberFonic
I did some work with SWI-Prolog. It is useful when the problem can be effectively translated into Prolog's preferred form of terms and rules. But the solver mechanism only solves a subset of logical inference needs. Prolog's use of logic in AI should not be conflated with the AI/ML systems which use networks of floating point operations, i.e. not boolean operations.

As always, best to choose the tool / language that best suits the problem.


👤 ghufran_syed
Datomic uses Datalog, a dialect of prolog, that's what I would look at first if I needed prolog in production in 2020.

👤 q3k
Gerrit (code review) uses Prolog for submission rules. I guess that counts as production prolog.

https://gerrit-review.googlesource.com/Documentation/prolog-...


👤 badtuple
Kind of offtopic, but does anyone know a good resource around implementing a simple prolog/similar language? My previous attempts at learning logic programming have failed, and it just _feels_ like a thing that becomes clear after you've seen how it works under the hood.

👤 soedirgo
Yarn 2 uses Prolog for workspace constraints.

https://dev.to/arcanis/introducing-yarn-2-4eh1#workspace-con...


👤 carapace
I'm writing a constraint solver-based scheduler for lab work with social distancing. It's going to be used by at least one lab.

(Reminds me I've got to get to work on it! Anybody ping me if you want to help.)


👤 The_rationalist
A tangeant question is: Which non-niche language are having push for integrating a subset of logic programming extensions ?

There was a (unlikely to be merged at least in its current form) proposal for Kotlin -> https://github.com/Kotlin/KEEP/pull/199/files

Maybe LINQ from .NET could be included

There is also chalk from Rust https://github.com/rust-lang/chalk


👤 paloaltokid
Is this related to Datalog also? I've watched a few presentations by Rich Hickey (creator of the Clojure programming language) and I feel like he often name-drops Datalog as a great tool.

👤 tmaly
I have used Prolog in a few professional projects.

I think if they came out with a version in hardware like they use to have lisp machines, it would have much better performance.


👤 _neural_
To the degree that it counts as 'production' Prolog, DFS-Tools -- a toolkit for Distributional Formal Semantics -- is actively used in a number of ongoing scientific projects: https://github.com/hbrouwer/dfs-tools

👤 frompdx
I'm not a prolog or logic programming buff, but have you looked at something like Clojure's core.logic? https://github.com/clojure/core.logic

👤 brudgers
Any system that uses Datalog uses a subset of Prolog. Loosely, this would include systems using Clojure's Datalog. To the degree the goal is logic programming, the looseness is more appropriate. YMMV.