Ask HN: What's Prolog like in 2024?
427 pointsHi, i am a compsci student that stumbled upon prolog and logic programming during my studies.
While i have seen the basics of vanilla prolog (atoms, predicates, cuts, lists and all that jazz) and a godawful implementation of an agent communication system that works on SICStus prolog. I would like to know more because i think that this language might be a powerhouse in per se.
Since my studies are quite basic in this regards i would like to expand my knowledge on it and kind of specialize myself both in this world and another world (ontologies :D) that i really enjoy.
What's prolog like in 2024? what are you wonderful people doing with it?
thanks from a dumbass :D
Comments (276) 60 threads
Show all comments
Showing thread 26 of 60
That narrows down the already small niche where one would choose Prolog by probably a few orders.
In my opinion, this does not imply that proper lisp (and correspondingly prolog) implementations are useless, just because a simple implementation can be written in a different, "more expressive" language.
https://en.wikipedia.org/wiki/MiniKanren
There's a great book in the same series as the "Little Lisper"/"Little Schemer" books called "The Reasoned Schemer" that uses MiniKanren with Scheme.
For many, how the language faces the user, how its paradigms fit the problems at hand and the user's mode of seeing the world, that is more important.
These days, with the terabytes the petaflops and the megajoules, it might be even less relevant how the gears are turning inside the black box.
I don't think that performs like a proper Prolog engine on larger problem.
Real Prologs work by compiling to something called the WAM (Warren Abstract Machine).
I don't think I've ever seen a discussion of Resolution in functional programming textbook implementations of "Prolog". They typically just bodge some depth-first search with backtracking and unification in polish notation and call it "Prolog", or "logic programming". A bit like if I wrote a "lisp" with eval(X):- call(X), then completely ignored all that jazz about lambda calculus and concentrated on garbage collection and linked lists.
A good starting point instead, if one wishes to understand Prolog and not just dismiss it out of hand, is to try and understand Resolution, and what unification does for Resolution, and why it ended up in Prolog (and how) in the first place. I'd start, well, at the beginning:
A Machine-Oriented Logic Based on the Resolution Principle
https://www.semanticscholar.org/paper/A-Machine-Oriented-Log...
Where you can follow the progress from ground Resolution, to unification, the Resolution theorem, and all the way to the (pre-modern) Subsumption Theorem. It's a long way to Prolog from there, but that's where it all begins.
_______________
[1] Although Prolog implemented by DFS is not complete if Prolog implemented by DFS is not complete (etc).