Ask HN: Why is Prolog not gaining traction?

5 0x07ca 2 8/22/2025, 7:54:06 AM
I sometimes enjoy programming in Prolog, although I see that it is not a very popular programming language, despite being invented many years ago. Why is it so?

Personally, I think that these are the three main problems with the current ecosystem: i) there are too many implementations, some more advanced and well-maintained, so it is not clear where to start. Furthermore, these implementations often differ in the syntax, so it is not always possible to directly port a Prolog program developed with one system into another system. ii) there are few libraries and they are not compatible among the different systems, so one often has to reimplement everything from scratch. iii) debugging programs is painful and locating an error is very difficult and time consuming

Comments (2)

tannhaeuser · 4h ago
Prolog does well in the areas where it's uniquely suited: planning, scheduling, optimisation, financial investment allocation, and other constraint-solving problems; at some point the SICStus home page claimed the logistics industry and railway basically run off Prolog.

For general-purpose programming and integration task adjacent to a Prolog planner core there are many alternatives with larger mind share even most Prolog developers will recommend over Prolog, though there's nothing wrong with using Prolog as a web template engine with pattern matching much like XSLT on steroids I guess.

The ISO standardisation of Prolog is a big plus because it let's you jump into Prolog with the comfort of an ecosystem, vendor-independence, and alternatives, in contrast to where you must commit upfront to a nebulous optimisation software package without knowing if it's a good fit for your task. Especially because realistic, large problems require a time commitment, exploration, experimentation, and iterative development.

Prolog has historically also been used for NLP, and has very convenient DSL and parser facilities built into the core. So compilers and other rule-based translators is also something Prolog excels at. There are a couple quite successful approaches combining LLMs and ML with Prolog, think probabilistics and/or neurolinguistics approaches (see recent discussion at [1]), but also just generating Prolog code using LLMs for problems where a satisfying problem description is available, or would be easier to create than encoding the problem in Prolog in the first place due to Prolog's declarative nature) ([2], also discussed in [1|).

[1]: https://news.ycombinator.com/item?id=44926414

[2]: https://news.ycombinator.com/item?id=43558622

jjgreen · 4h ago
Some years ago I had a job coding Prolog (SICStus), a load of fun, but you're right, a rare thing to find. I'd guess the reason is that Prolog is good for small hard problems (I was working on Presburger arithmetic which is known triple-exponential time) but most practical problems are easy but big.