Live data from Hacker News

The Power of Prolog

metalevel.at

11–20 of 162 posts

Re: The Power of Prolog

#11
post #2

Thank you very much for the publicity, I greatly appreciate it! This book has been discussed on HN about one year ago: https://news.ycombinator.com/item?id=14045987 Since then, I have added the following new chapters: Prolog Business Cases: https://www.metalevel.at/prolog/business Sorting and Searching: https://www.metalevel.at/prolog/sorting Cryptography with Prolog: https://www.metalevel.at/prolog/cryptography Engi…

I've shared this with anyone who will let me divert the conversation to Prolog. At work we have the Haskell folks, the Lispers who move everything towards Lisp, and I'm the one who moves every conversion towards Prolog, then I send the link to this. :-D

Re: The Power of Prolog

#12
post #9

One of my favorite languages, pity that is has had even harder time than Lisp getting mainstream acceptance.

Let's face it, procedural is just plain easier to debug because you can more easily split it into digestible and dissect-able chunks: divide-and-conquer. Perhaps functional and logical CAN readily have such features, but nobody either figured how, or have not figured out how to explain how to do dissection to normal people. (This is sometimes a criticism of SQL also, but the added WITH clause helps break up big queries into multiple smaller ones.)

For example, with a procedural loop you can stick a debug statement in the middle to look at just about anything:

  while (x=foo(y,z)) {
    a = doStuff(x, z);
    console.write("x={?},y={?},z={?},a={?}", x, y, z, a);
  }

Re: The Power of Prolog

#13
post #8
post #4

Earlier quoted context omitted.

Thank you for the kind words! Regarding companies that use Prolog, here are a few examples: A third of all airline traffic is handled by systems that run SICStus Prolog: https://www.sics.se/projects/sicstus-prolog-leading-prolog-t... A large portion of the New Zealand stock exchange is powered by Prolog: https://dtai.cs.kuleuven.be/CHR/files/Elston_SecuritEase.pdf Oracle uses Prolog in the JVM specification: https://…

Windows NT used to have a Prolog based system for handling interrupts, not sure how much of it is still relevant on W10.

I was pretty sure that it was for configuring network devices.

Re: The Power of Prolog

#14
post #2

Thank you very much for the publicity, I greatly appreciate it! This book has been discussed on HN about one year ago: https://news.ycombinator.com/item?id=14045987 Since then, I have added the following new chapters: Prolog Business Cases: https://www.metalevel.at/prolog/business Sorting and Searching: https://www.metalevel.at/prolog/sorting Cryptography with Prolog: https://www.metalevel.at/prolog/cryptography Engi…

I've shared this with anyone who will let me divert the conversation to Prolog. At work we have the Haskell folks, the Lispers who move everything towards Lisp, and I'm the one who moves every conversion towards Prolog, then I send the link to this. :-D

Where do you work? Sounds neat!!

Re: The Power of Prolog

#15
post #12
post #9

One of my favorite languages, pity that is has had even harder time than Lisp getting mainstream acceptance.

Let's face it, procedural is just plain easier to debug because you can more easily split it into digestible and dissect-able chunks: divide-and-conquer. Perhaps functional and logical CAN readily have such features, but nobody either figured how, or have not figured out how to explain how to do dissection to normal people. (This is sometimes a criticism of SQL also, but the added WITH clause helps break up big queri…

Prolog has print statements you can stick anywhere. (It also has proper debuggers that allow you to go forward and backward and all that.)

Also, Prolog code is often "split into digestible chunks". Even more than other languages, in fact, because it's rather hard to write nested loops or nested predicates or nested many other things.

If you were ever taught Prolog, it seems that you weren't taught well. You might want to risk a second look.

Re: The Power of Prolog

#16
post #12
post #9

One of my favorite languages, pity that is has had even harder time than Lisp getting mainstream acceptance.

Let's face it, procedural is just plain easier to debug because you can more easily split it into digestible and dissect-able chunks: divide-and-conquer. Perhaps functional and logical CAN readily have such features, but nobody either figured how, or have not figured out how to explain how to do dissection to normal people. (This is sometimes a criticism of SQL also, but the added WITH clause helps break up big queri…

I am curious if you used a visual debugger for prolog? (or for a procedural language) printing things to the console is the poor man debugger.

Re: The Power of Prolog

#17
post #9

One of my favorite languages, pity that is has had even harder time than Lisp getting mainstream acceptance.

I once asked my Prolog instructor why this all takes so long. His reply: "How well are you prepared for the next ISO meeting?"

At that point, I realized that if you prepare yourself in earnest for, say, the standardization process, or even to accomplish any concrete improvement in Prolog systems (such as better indexing, more advanced constraints, faster garbage collection etc.), then there is so much to do that there is barely enough time to do it properly!

Hence, I think it is fair to say we are are progressing as fast as we can, and such complex projects as building a full-fledged Prolog system inherently take an amount of time that we are not yet fully accustomed to. Prolog systems have been in development for many decades and are still being improved all the time. In my view, they are only now becoming truly interesting, with many great features such as multiple argument indexing, tabling and expressive constraints.

Re: The Power of Prolog

#19
post #2

Thank you very much for the publicity, I greatly appreciate it! This book has been discussed on HN about one year ago: https://news.ycombinator.com/item?id=14045987 Since then, I have added the following new chapters: Prolog Business Cases: https://www.metalevel.at/prolog/business Sorting and Searching: https://www.metalevel.at/prolog/sorting Cryptography with Prolog: https://www.metalevel.at/prolog/cryptography Engi…

I've shared this with anyone who will let me divert the conversation to Prolog. At work we have the Haskell folks, the Lispers who move everything towards Lisp, and I'm the one who moves every conversion towards Prolog, then I send the link to this. :-D

Thank you for sharing this, I really appreciate you participating in this thread and this awesome anecdote!

One related workplace anecdote that a former fellow student told me: He was working on a rule-based medical recommender system, and he recognized that Prolog was an excellent fit for this project. When he first suggested that the team switch to Prolog, they were very skeptical. But someone high up in the chain was a great fan of Prolog and approved this suggestion. A few weeks later, they had completed the implementation, and the Prolog-based solution was running. My colleague told me that, a few months after that, the whole team regarded Prolog as the only viable solution to all further projects from then on!

Re: The Power of Prolog

#20
post #12

Earlier quoted context omitted.

Let's face it, procedural is just plain easier to debug because you can more easily split it into digestible and dissect-able chunks: divide-and-conquer. Perhaps functional and logical CAN readily have such features, but nobody either figured how, or have not figured out how to explain how to do dissection to normal people. (This is sometimes a criticism of SQL also, but the added WITH clause helps break up big queri…

I am curious if you used a visual debugger for prolog? (or for a procedural language) printing things to the console is the poor man debugger.

A big problem with visual debuggers is that they are too blunt of an instrument. Often I wish to examine specific things under specific conditions and thus use conditionals to narrow down what's being explored instead of bajillion breakpoints and/or log records. Debuggers could add conditional expressions, but then they'd be re-inventing WRITE statements anyhow.

As far as the nearby statement that maybe I didn't learn dissection correctly, that may indeed be the case, but was also my original point: perhaps the real problem is that nobody knows how to TEACH functional/logical programming right, and that's why they have not caught on in the mainstream despite being around several decades. I'd love to "get" the benefits, but it just won't click. Sometimes you have to teach programmers how to think, not just what to think.

Post reply on HN