# Prolog

97 Hacker News commenters recommended Prolog and 30 criticized it, November 2025 to November 2026. It was recommended in 12 of 13 months; owners who said how long report a median of 18 years (6 owners). It meets the Hacker Approved badge rule.

**Verdict:** Recommended as a mind-expanding declarative language that solves search, parsing and rule-based problems in very concise code, though critics say it's narrow and hard to learn.

## Why people recommend it

- Declarative rules, interpreter handles execution (7 comments): "The nice thing about prolog is that you write logical rules, and they can get used in whatever order and direction that is needed." ([source](https://news.ycombinator.com/item?id=46528344)) "Prolog searches through a space of logical proposition (constraints) and finds conditions that lead to solutions (if one exists)." ([source](https://news.ycombinator.com/item?id=45904372)) "Plenty of problems involve a lot of parsing and searching, both could be expressed declaratively in Prolog and it just works" ([source](https://news.ycombinator.com/item?id=46097314))
- Very concise, succinct programs (4 comments): "Prolog has a beautiful unification-based "pattern-matching"-style syntax that results in very succinct programs." ([source](https://news.ycombinator.com/item?id=49409313)) "It's pretty mind-bending what it can accomplish and how concise the resulting programs tend to be." ([source](https://news.ycombinator.com/item?id=49982007)) "Prolog is an excellent language for expressing certain types of problems in a very concise way" ([source](https://news.ycombinator.com/item?id=45913445))
- Mind-expanding way to think (4 comments): "Prolog is a great language to learn. But I wouldn't want to use it for anything more than what its directly good at." ([source](https://news.ycombinator.com/item?id=45907202)) "I find myself reaching for Prolog in cases that are entirely orthogonal to any kind of code I used to write before" ([source](https://news.ycombinator.com/item?id=49199757)) "the value for me of learning Prolog was being awakened to a refreshingly different way of expressing a program" ([source](https://news.ycombinator.com/item?id=45902548))
- Code as data, easy meta-interpreters (4 comments): "I find myself reaching for Prolog in cases that are entirely orthogonal to any kind of code I used to write before" ([source](https://news.ycombinator.com/item?id=49199757)) "Since Prolog programs are just Prolog data structures, it is easy to write Prolog meta-interpreters which generate or consume Prolog code." ([source](https://news.ycombinator.com/item?id=46642973)) "It is designed to be metainterpreted with the same ease in which a for-loop might be written in another language." ([source](https://news.ycombinator.com/item?id=47289487))

## What people warn about

- Only good for narrow problems (4 comments): "Seems more like an interesting research project than something I'd ever deploy in an application serving millions of users" ([source](https://news.ycombinator.com/item?id=46536993)) "Prolog is a great language to learn. But I wouldn't want to use it for anything more than what its directly good at." ([source](https://news.ycombinator.com/item?id=45907202)) "Prolog handles anything you want to say in formal logic very well (at the cost of not doing anything else well)." ([source](https://news.ycombinator.com/item?id=45908858))
- Steep, confusing learning curve (3 comments): "After trying for a while, I got frustrated and asked the teacher if I could do it in Ruby instead." ([source](https://news.ycombinator.com/item?id=47139931)) "I found it very confusing: trying to code A*, N-Queens, or anything in it was just too much." ([source](https://news.ycombinator.com/item?id=45904617)) "It took me a lot to be able to do anything more than simple Hello World level things" ([source](https://news.ycombinator.com/item?id=48118406))
- Search explodes, order-dependent evaluation (3 comments): "as soon as you do something actually complicated, you realize that the different optimization modes of the engine give different results" ([source](https://news.ycombinator.com/item?id=48171455)) "With Prolog, the calls can quickly become a combinatorial explosion of search space, leading to a program which does not finish at all" ([source](https://news.ycombinator.com/item?id=48180277)) "prolog rule evaluation depends on the order the rules are presented in the program" ([source](https://news.ycombinator.com/item?id=48174104))
- Could just be a library (2 comments): "Prolog is a contrived example. It's small and simple enough to be implemented as a DSL embedded in another language" ([source](https://news.ycombinator.com/item?id=46530926)) "It's a language that should have just been a library. There's nothing noteworthy about it" ([source](https://news.ycombinator.com/item?id=45913735))

## Alternatives hackers recommend

- [Rust](https://hackerapproved.com/p/rust.md): 2039 recommend
- [Go](https://hackerapproved.com/p/go-programming-language.md): 1254 recommend
- [Python](https://hackerapproved.com/p/python.md): 1067 recommend
- [Zig](https://hackerapproved.com/p/zig.md): 743 recommend
- [TypeScript](https://hackerapproved.com/p/typescript.md): 574 recommend

## Cite as

Hacker Approved, "Prolog", https://hackerapproved.com/p/prolog/ (counts from 1,795,640 Hacker News comments, November 2025 to November 2026).
