Hacker News new | ask | show | jobs
by infotainment 156 days ago
I always felt like Prolog's ability to execute programs was entirely accidental.

To me, it feels like a data description language that someone discovered could be tricked into performing computation.

3 comments

Check out datalog! https://learn-some.com/ The tutorial there uses Clojure syntax but Datalog normally uses a Prolog syntax.
This datalog implementation uses prolog syntax, can even run the queries in prolog to contrast the model: https://des.sourceforge.io/
It's the other way around. We kind of stumbled on the whole idea of computation thanks to work on First Order Logic, that Prolog borrows its syntax and semantics from.

It's all the other programming languages that have weird syntax, including LISP btw. Prolog's syntax is the quintessential syntax of a formal language for computation.

As to the "data description" part this is just a leaky abstraction almost universally adopted by programming languages, other than LISPs and logic programming languages. In truth, there is no separation between data and computation. And so there is no need for special syntax for either. Prolog is a "data description" language only in the sense that you can describe data and computation in one go.

... a bit like life ...
Conway's Life? Or DNA?
yes