top | item 46644790

(no title)

usgroup | 1 month ago

I think this article is problematic because Prolog is truly a different paradigm which requires time to understand. Laments about no strings, no functions and "x is confusing" read like expectations of a different paradigm.

Prolog is also unusual in a sense that it is essential to understand what the interpreter does with your code in order to be able to write it well. For vanilla Prolog, that's not so hard. However, when constraint programming and other extensions are added, that becomes much harder to do.

discuss

order

pjmlp|1 month ago

When I did my degree in Software Engineering, logic programming (with Tarsky's World), and Programming with Prolog were required classes.

There were only two prevalent attitudes, some of us really loved FP (me included), others hated it and could hardly wait to get it done.

Somehow there was a similar overlap with those of us that enjoyed going out of mainstream languages, and those that rather stay with Pascal and C.

usgroup|1 month ago

Yeah that sounds like me too. Prolog became a fetish a few years ago. I used it intensely for 2 years, wrote a lot about it, until it became a part of me. Its intangible what it does to you, but its the dual of what you might expect.

aeonik|1 month ago

Datalog has the same capabilities as prolog but allows strings right?

My understanding is that they have very different evaluation strategies, bottom up vs top down. But with laziness and pruning you can still achieve the same goals in datalog with more ergonomics, right?

I think every language should have a prolog or datalog implementation, kind of like regex.

cmrdporcupine|1 month ago

In many respects "Datalog" doesn't refer to a single language or implementation or standard. It really just refers to a set of approaches for querying relational datasets using something like Prolog's unification.

By which I mean there are Datalogs that look like Prolog a bit, and others that don't. And things that are "Datalogs" that don't even have their own PL but instead more of an API. And no standard at all.

usgroup|1 month ago

No, datalog is a decidable subset of Prolog. That changes everything.

rramadass|1 month ago

> I think this article is problematic because Prolog is truly a different paradigm which requires time to understand.

> Prolog is also unusual in a sense that it is essential to understand what the interpreter does with your code in order to be able to write it well.

100% this!

Coming from procedural/OO paradigms i did not understand how to think about Prolog until i read Robert Kowalski's paper Predicate Logic as a Programming Language - https://www.researchgate.net/publication/221330242_Predicate...

I still have a long way to go but at least i am on the right track.

gota|1 month ago

Agreed, but cuts are confusing even considering the paradigm, though. Especially considering the paradigm, actually!

They are necessary in practice, though. But boy do a cut here and there makes it harder for catching up to some Prolog codebase.