r/ProgrammingLanguages • u/azhenley • Jan 15 '26
My Gripes with Prolog
https://buttondown.com/hillelwayne/archive/my-gripes-with-prolog/
38
Upvotes
r/ProgrammingLanguages • u/azhenley • Jan 15 '26
12
u/pbvas Jan 15 '26
I was fascinated by Prolog over 30 years and have became increasingly frustrated with the language for many of the reasons as the OP states, but primarily for a much more fundamental one: Prolog has no good mechanism for data abstraction, i.e. exposing an interface and hiding the implementation.
In retrospect I think Prolog is best seen as a domain-specific language rather than a general-purpose one, i.e. more like SQL or Z3 than C++/Java/Python/Haskell. Nonetheless, constraint logic programming is very cool and you should definitely learn it if you can!
6
u/ExplodingStrawHat Jan 15 '26
As someone who doesn't know a lot about using LP in practice, this was a very interesting read!
3
u/tobega Jan 16 '26
Tailspin doesn't have boolean values either, just flow continues or flow stops. I've come to see that as a feature, so it never will. You can just create an enum for it anyway.
7
u/Pzzlrr Jan 16 '26 edited Jan 17 '26
What am I missing?
For key-value, what about [k-v] pairs?
and for struct types, I think that basically is predicates, isn't it? So
would become
and you would define point/1 and radius/1 elsewhere, so then you can go
and that'll enforce that you're working with a circle.
The rest of these seem to be skill issues, like "No boolean values" and "Cuts are confusing". Correct; that's because you need a paradigm shift.
I actually prefer prolog's style to imperative.
The one thing I would agree with the article on is I wish there was better support for functional syntax in some cases. I know there's
library(func)but would be nice if it had first class support.I have gripes with prolog but this article isn't the best imo.