Live data from Hacker News

The Power of Prolog

metalevel.at

51–60 of 69 posts

Re: The Power of Prolog

#51

Prolog always seemed to me like a database query language that can be tricked into computation.

I would love a Prolog database query language. Itch for it every time I use SQL.

When I was building a prototype last year I went with XTDB and using it as relational database with additional super powers worked fairly well.

Re: The Power of Prolog

#52
post #47

I'm curious about this maxim: https://news.ycombinator.com/item?id=13843422

See the "Typing" section of https://sforman.srht.site/PLSemProlog.html Note that there's no implementation of the type inference algorithm, just descriptions of the type relations. That's because Prolog itself is the type inference algorithm.

Re: The Power of Prolog

#53
post #17

Earlier quoted context omitted.

Are there any Prolog scripting engines or embeddable runtimes? It feels like the kind of thing where you might use it to solve a small part of your problem domain and leave the rest to a conventional language.

Off the top of my head: Javascript: http://tau-prolog.org/ Java: https://apice.unibo.it/xwiki/bin/view/Tuprolog/ (also SWI, Ciao and Sicstus have Java bridges) Go: https://github.com/ichiban/prolog Common Lisp: https://www.cliki.net/Prolog Racket: https://docs.racket-lang.org/racklog/ Guile: https://gitlab.com/gule-log/guile-log Erlang: https://github.com/rvirding/erlog Also SWI and Ciao have a pretty straight forwar…

Picolisp has Pilog: https://picolisp.com/wiki/?tutpilog

Re: The Power of Prolog

#54
post #44
post #29

I'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…

I have studied Prolog from time to time over the years and occasionally I run across problems where it strikes me Prolog would be useful but I've never been able to justify adding it. 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).

Doctor Dobb's Journal had a cool article once about using Prolog to prescribe medications, in particular avoiding conflicts with other prescriptions. It would have been in the early 2000s. According to the author, they used Prolog to rewrite the app from a tangled mess of nested if statements. After the rewrite, the rules could be managed by pharmacists instead of programmers. It seemed like a good application to me. I studied Prolog in college but have never used it professionally. I keep hearing good things about Datalog, which I know even less about. . . .

Re: The Power of Prolog

#55
post #43
post #38

Earlier quoted context omitted.

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.

> 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?

I believe in general purpose languages - from the business point of view its better to invest in one platform/language/ecosystem (if possible of course) than to spread too thin - each specialized language is potential liability (its trade-off but still the additional languages have to carry their own weight allowing for example to access more platforms)

Re: The Power of Prolog

#56
post #38

Earlier quoted context omitted.

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.

I think you should do more than read one 4 paragraph comment before you cement an opinion on anything

It depneds on the comment and the article. I actually had some contact with prolog (did a semester in university mamy years ago) and still up till today did not find a reason to use it on real life - mainly because I have responsibily to keep my solutions maintainable for decades and I do not see how could I keep easily find people willing to work on prolog and not switch obver to where reall money is at. So when I saw an interesting insight that somehow maches my very old intuition (that prolog is mainly constraint solver) I wanted to ask more. And I believe that reading this whole introduction could potentially not give me this insight.

Re: The Power of Prolog

#57

This month Prolog is ranked #21 on TIOBE, ahead of Rust (#28) and TypeScript (#43). This probably demonstrates the irrelevance of TIOBE more than it illustrates the relevance of Prolog. I 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 Model…

Contrary to what many geeks think, TIOBE is very relevant, because it is where management looks into when discussing which languages get greenlighted to IT.

The way they get those numbers might seem irrelevant, or even unrealistic, yet that doens't change how many companies select the golden languages for their cogs.

Re: The Power of Prolog

#58
post #56

Earlier quoted context omitted.

I think you should do more than read one 4 paragraph comment before you cement an opinion on anything

It depneds on the comment and the article. I actually had some contact with prolog (did a semester in university mamy years ago) and still up till today did not find a reason to use it on real life - mainly because I have responsibily to keep my solutions maintainable for decades and I do not see how could I keep easily find people willing to work on prolog and not switch obver to where reall money is at. So when I s…

Learning almost any DSL pays off, when the alternative is to macroexpand the same stuff in your head and write out eye-glazing boilerplate.

Re: The Power of Prolog

#59

I found that Prolog is excellent for one-shot solving perfectly well-defined Platonic problems. The moment there is some uncertainty, rough edges, user input, etc it becomes nasty. Is this your experience? Am I doing something wrong?

I’d say that is true of all programming, hehe.

Re: The Power of Prolog

#60
post #56

Earlier quoted context omitted.

It depneds on the comment and the article. I actually had some contact with prolog (did a semester in university mamy years ago) and still up till today did not find a reason to use it on real life - mainly because I have responsibily to keep my solutions maintainable for decades and I do not see how could I keep easily find people willing to work on prolog and not switch obver to where reall money is at. So when I s…

Learning almost any DSL pays off, when the alternative is to macroexpand the same stuff in your head and write out eye-glazing boilerplate.

That seems like main reason any high level language exist - to give us abstraction layer with better building blocks to solve problems. The trick is to choose which DSL to use in project so its maintainable (and cost effective). I even long time ago learned some prolog (had a whole semester in university on it) but I cannot find a reason why I would use it anywhere in real projects.
Post reply on HN