Of the proprietary Prologs I've mostly worked with Sicstus which was the fastest one I've used and had pretty good constraint libraries. It also has a lot of extra features (logical loops etc.) but I mostly used it for legacy reasons and generally prefer a free implementation (for any programming language).
I've heard good things about Eclipse (unfortunate naming, hard to search for) when it comes to constraint programming.
Some random observations: It usually takes my brain a bit to switch to "Prolog mode". You can build some fairly elegant things (constraint based poker hand rankings was the last thing I built) but it's usually not very fast. However I'm not a very proficient Prolog programmer so it could very well be on me for not optimizing enough. If you want some book recommendations I think the best first book is "Prolog Programming for Artificial Intelligence" (best intro section which is the first half of the book so highly recommended even if you don't care about AI at all). The classics are great followups to that (Art of Prolog first, Craft of Prolog second).
I recall this paper, by Joe Armstrong of Erlang... I'll have to go read it again.
"Use of Prolog for developing a new programming language"
https://scholar.google.com/scholar?cluster=23466104209097450...
Hm after scanning it, I think the reason I never really got it the first time around is that I don't know Prolog :) Might be time to fix that.
What turned me off to Prolog is that there's no way to reason about the computational complexity of the algorithm. Declarative languages often have this problem. That's why you have SQL queries that literally take thousands of times longer than a Python script in production (hours vs seconds). Programming models also need performance models.
Reasoning about performance is quite possible; there's good advice in Richard O'Keefe's The Craft of Prolog.
[Edit: fixed the book title, thanks to a friendly correction. The Practice of Prolog is a different book, also good, but less relevant.]
There are real tutorials on DCGs available, e.g.
http://www.pathwayslms.com/swipltuts/dcg/
(BTW, SWI-Prolog, which the tutorial uses, is freely available here:
http://www.mtome.com/Publications/PNLA/prolog-digital.pdf
And there's a set of course materials in HTML for "Natural Language Processing in Prolog", a course at Union College in Schenectady, NY by Patrick Blackburn and Kristina Striegnitz that seems worthwhile:
http://cs.union.edu/~striegnk/courses/nlp-with-prolog/html/t...
That's easy to figure out once you realise your code also has an imperative reading. So for instance it's obvious that reversing a list:
reverse(A, B) :-
reverse(A, [], B, B).
reverse([], A, A, []).
reverse([B|A], C, D, [_|E]) :-
reverse(A, [B|C], D, E).
takes time proportional to the lists' length, since you're walking through the list an element at a time. And it's easy to figure out that consing, as in [B|C], is a constant-time operation.Or, for instance, say you wanted to apply reverse/4 to elements of a list-of-lists:
findall(L_, (member(L, Ls), reverse(L, L_)), Ls_).
You can see that this is going to take the time to go through Ls, times the time to reverse each L. Same goes for the recursive version, except we need to reverse the output also to get it back in the right order: revall(Ls, Ls_):-
revall(Ls, [], Ls_).
revall([], Ls, Ls_):-
reverse(Ls, Ls_)
,!.
revall([L|Ls],Acc,Bind):-
reverse(L, L_)
,revall(Ls, [L_|Acc], Bind).
So it's not different than any other language really, and in fact you can, up to a point, completely ignore the declarative meaning of your program if you just want to think about how fast it's going to go.Logic programming seems to be like monads, either you get it or not, but it is hard to explain to others.
Prolog and Lisp were the two languages we were forbidden to use in compiler design project, as it was considered "cheating" versus using something harder like C.
Haskell/Ocaml/SML? :3
Haskell was still not a thing our department cared about, although we got to read some stuff about Miranda.
SML was never a thing at our university.
feels like lego where prolog is duplo.
The implementation and ecosystem are quite far from something like Python, of course, but it does look like the most beautiful house in the street to me when you just walk past it.
Except for things like the system described in the featured article, where the unique strength of Prolog is the ability to pass around partially instantiated data structures and use full unification. Last time I checked, Mercury still insisted that terms be ground (or completely free variables), which means that for this kind of problem you don't gain much from its flavor of logic programming :-(
"Cheating"? Smells like a chance for the revenge of the pattern-matching metacompiler!
The website text (free) is the first edition of the book; the authors have also published a second edition with updates.