I have only had passing experience with Prolog, many moons ago. It feels like ... and this is hard to express without sounding like I am trivializing it ... it feels like Prolog has a pretty good future as domain-specific language as input to a library called by, well, other programming languages, but on its own, it's a "wow, that's neat" kind of language.
The Power of Prolog
41–50 of 69 posts
Re: The Power of Prolog
#42I think people who don't need to use Prolog think of Prolog in a very idealized way, kind of how they think of other "principled" languages like Lisp or Rust. Many years ago, I took a course at Johns Hopkins called Computational Models of Cognition. It was taught partly in SWI-Prolog. We used Prolog as a simple DSL to write little logical programs. It was different, and fun, and kind of confusing.
But as soon as you want to take Prolog beyond elementary classroom use, you will find that it is a language like many others, and needs to expose a world of little QOL details that go beyond the elegant simplicity of term unification, like argument mode modifiers and continuations and such.
Re: The Power of Prolog
#43Earlier quoted context omitted.
It's been more than a decade since I worked in Prolog, so I cannot give you a direct example but can try to answer :) Basically, Prolog is declarative programming. You can attach properties to your data and then define relations between the data based on whether they have that property (or not). Something along the lines of: X is grandfather of Y if X is man and X has child Z which has child Y. The above statement is…
So You are saying that there is really not much difference between prolog and lets say constraint solver written in Java (DSL on top of another language)? Because if this really true than now I understand why this language never caught on.
Can you illuminate why the language being a constraint solver tells you why it didn't catch on?
Re: The Power of Prolog
#44I've been using Prolog on and off for 20+ years (I actually bought and used Turbo Prolog by Borland under MS-DOS). I have to confess though, I've never quite understood Prolog or what it's for. I've followed Markus Triska and his Power of Prolog videos (watched all of them). I'd like to thank him for his work. This fellow is super smart about programming, and he appears to be singlehandedly re-inventing Prolog. His v…
Lately I've encountered more offline/batch processing problems and I am planning to work on some reimplementations of my solutions in our usual languages using Prolog (as soon as I have some free time, so none too soon).
Re: The Power of Prolog
#45Earlier quoted context omitted.
Prolog is a deep language and can teach so you a lot. The main problem is that any prolog program bigger than, say, a thousand lines of code become difficult to debug and understand. There are ways to make things better e.g. avoid impure prolog etc. but it is still problematic. Engineers are always looking for technologies to hop onto. Prolog is niche for a reason: I don’t think Prolog scales. In some ways it is too…
On the other hand, with dozens of lines of Prolog you can solve some problems that would take many thousands of lines in other languages (and a lot of calm study before you can map them into a real logic or imperative algorithm). I still avoid it, because yeah, once you solve that problem and avoid those thousands of lines, you are stuck. If you try make the rest of your system in Prolog, it will become a non-viable…
Re: The Power of Prolog
#46Earlier quoted context omitted.
It's been more than a decade since I worked in Prolog, so I cannot give you a direct example but can try to answer :) Basically, Prolog is declarative programming. You can attach properties to your data and then define relations between the data based on whether they have that property (or not). Something along the lines of: X is grandfather of Y if X is man and X has child Z which has child Y. The above statement is…
So You are saying that there is really not much difference between prolog and lets say constraint solver written in Java (DSL on top of another language)? Because if this really true than now I understand why this language never caught on.
Re: The Power of Prolog
#47Re: The Power of Prolog
#48Re: The Power of Prolog
#49Prolog always seemed to me like a database query language that can be tricked into computation.
Re: The Power of Prolog
#50Earlier quoted context omitted.
It's been more than a decade since I worked in Prolog, so I cannot give you a direct example but can try to answer :) Basically, Prolog is declarative programming. You can attach properties to your data and then define relations between the data based on whether they have that property (or not). Something along the lines of: X is grandfather of Y if X is man and X has child Z which has child Y. The above statement is…
So You are saying that there is really not much difference between prolog and lets say constraint solver written in Java (DSL on top of another language)? Because if this really true than now I understand why this language never caught on.
As I said, I have never seen one integrated with any language (oh, well, now I have seen Flix).