Live data from Hacker News

Who killed Prolog?

vanemden.wordpress.com

1–10 of 57 posts

Re: Who killed Prolog?

#2
Interesting read. I'm just aware about the logic class of programming language: imperative (1956, Fortran), functional (1959, Lisp), object-oriented (1972, Smalltalk), logic (1974, Prolog). Some Erlang syntax is borrowed from Prolog, so is Erlang a logic programming language or functional (I always thought Erlang is functional)? What other language is under logic class?

Re: Who killed Prolog?

#3
Not to nitpick overmuch, but if functional, object-oriented and logic are the other styles of programming language, then surely the correct adjective to describe Fortran is procedural? Object-oriented languages are also generally imperative—the contrasting term is declarative, which purely functional and logic programming languages are (to some extent).

Interestingly, given the conclusions reached in the article, both Sterling and Shapiro's The Art of Prolog and Lloyd's Foundations of Logic Programming mention the Japanese fifth generation project as an example of Prolog's impending breakthrough into the mainstream.

Re: Who killed Prolog?

#4
One missing bit, I think, is that the declarative-programming alternative that Prolog represented got somewhat incorporated, piecemeal and in non-logic form, into a lot of mainstream languages and frameworks, which reduced its uniqueness. For data-heavy applications, SQL gradually moved up the application stack from where it had once been, to where more and more "logic" was written declaratively in SQL, instead of it being a purely dumb butler of a language whose job was getting things out of cells for you. Parallel to that, SQL's also been gradually incorporating features from Prolog's descendent Datalog that push it towards a more full-featured language in which arbitrary logic can be encoded (recursive queries are one big 1990s addition).

Elsewhere, even in AI, production-rule systems gained popularity from the 1980s as a simplified, propositional form of declarative programming, which also lent itself more naturally to state maintenance (asserting/retracting facts, and updating what changes as a result, as the core interaction loop). The focus on expert systems in the 1980s, and the development of the efficient RETE algorithm in 1983 were probably some factors in taking over an area in that in the 1970s one would've done in Prolog, or hand-coded in Lisp. Even today lots of this kind of "logic" stuff gets done in Jess or Drools, especially in business-logic, which is something of a success for declarative programming, though not for full-on logic programming.

I think a bunch of this kind of thing conspired to make Prolog not nearly as exciting even by the late 1980s as it was in the 70s. Academics moved on, and started focusing on other things. Datalog and other data-querying systems were a big focus for a while: if Prolog wasn't going to take over all programming, well, dammit, at least it was going to take over data querying, where it seemed like a clear win. That did have some impact (modern SQL cribs some features and even algorithms almost directly from Datalog), but it was more in the "influence" than "replace" sense.

Today much of the focus is on answer-set programming (http://en.wikipedia.org/wiki/Answer_set_programming), which targets neither large programs (like Prolog) nor large databases (like Datalog), but relatively small programs/databases with complex deduction and constraints (more in the style of solving combinatorial problems). That might be seen as something of a retreat, towards using logic programming for things that were more traditionally done in logic anyway, rather than as a general programming paradigm. There are some logic-programming-in-the-large descendents, like Mercury (http://en.wikipedia.org/wiki/Mercury_(programming_language)), but AFAIK their communities have always been small. It seems they're a little too hybrid to appeal to theorists, a little too academic-sounding to appeal to real-world types, live in Prolog's shadow, and lack a killer app.

One interesting angle is a very recent trend of pushing some declarative-programming ideas directly into mainstream programming languages. LINQ in C# is probably the most interesting one. It's billed as adding something like SQL into C#, but the way it's used as an actual core programming construct (not just a data-retrieval construct), which you can use to write application logic in a declarative rather than either functional or imperative style, has a very logic-programming flavor. This route is, imo, the most promising angle to get anything like logic programming used to build real, large-scale apps: the possibility that a successor to LINQ will add features that move it closer to logic programming seems much larger than the possibility that a Prolog descendent will break through.

[Note of course that the above is all my personal take. I'm a grad student using ASP and Prolog as tools in my thesis, so I clearly think they have merit, though I can also see why, when confronted with "hey we can write this all in Prolog!", the world's answer might have been, "maybe we can just take some of the cool parts of Prolog instead?" If anyone's qualified to answer the "why did Prolog die?" question definitively, it sure ain't me. But do I think that some of the above factors played a role.]

Re: Who killed Prolog?

#5
post #3

Not to nitpick overmuch, but if functional, object-oriented and logic are the other styles of programming language, then surely the correct adjective to describe Fortran is procedural ? Object-oriented languages are also generally imperative—the contrasting term is declarative, which purely functional and logic programming languages are (to some extent). Interestingly, given the conclusions reached in the article, bo…

There is no real restriction that an object oriented language be imperative and, rule of Demeter aside, I think it's been sort of agreed that always returning a value as a result of any given method invocation makes OO languages much nicer (even if side-effects take place as well). However, procedural implies imperative, I believe.

In any case, I always thought language classifications could get a little fuzzy.

Re: Who killed Prolog?

#6
I'm not sure I'm convinced by the thesis Prolog was killed by association with a Japanese project that was a failure. I thought Prolog died a natural death, for several reasons:

Firstly, Prolog is it was great at the deductive, expert system type of AI, but in 90's, a new generation of AI based on statistics (firstly, fuzzy logic, and then proper statistical reasoning, particularly Bayesian approaches) appeared and showed that truth and failure just don't cut it any more.

Secondly, I don't know if anyone has done the research, but I wouldn't be surprised if Blub programmers are just better at thinking imperatively; Prolog tends to kind of warp the brain away from that, which would put off Blub programmers, but it doesn't provide the kind of killer power that makes expert programmers want to use it either.

Thirdly, Prolog is hard to optimise well, and hard to predict the performance characteristics of. In the 80's and 90's, where apps were getting written in C, this was killer.

Re: Who killed Prolog?

#7

Interesting read. I'm just aware about the logic class of programming language: imperative (1956, Fortran), functional (1959, Lisp), object-oriented (1972, Smalltalk), logic (1974, Prolog). Some Erlang syntax is borrowed from Prolog, so is Erlang a logic programming language or functional (I always thought Erlang is functional)? What other language is under logic class?

Erlang is a mixed paradigm language, which borrows from languages like Miranda and Prolog. Initially it was written using Prolog syntax (relations) and VM was implemented in Prolog too. Later it's Prolog syntax was adapted to the current functional style (i.e. functions).

Re: Who killed Prolog?

#8
I doubt whether this is the actual reason that Prolog was killed off. AFAIK during the 90s there was still research going on with Prolog and parallelization. However, this seems to have been killed off during the end of the 90s because of lack of results.

IMO the thing that killed Prolog is that there has never been a good way to do parallelization without having to massively rewite Prolog programs.

Re: Who killed Prolog?

#9
What people wanted Prolog to do, it couldn't do. People wanted to step away from the control flow specification of imperative language, the message-passing of OOP, and let the compiler solve your problem for you by feeding it a specification of the constraints the completed system would follow. Prolog did not, and cannot do this, because it is not strong AGI. When people realized this, they gave up on it, because it is easier to tell the computer how it should branch than to forcefully guide stupid heuristics around.

When there exists a large, universal library of "common sense", of the kind people build up from years of childhood sensory experience, declarative programming will come back. But not until then.

Re: Who killed Prolog?

#10

Interesting read. I'm just aware about the logic class of programming language: imperative (1956, Fortran), functional (1959, Lisp), object-oriented (1972, Smalltalk), logic (1974, Prolog). Some Erlang syntax is borrowed from Prolog, so is Erlang a logic programming language or functional (I always thought Erlang is functional)? What other language is under logic class?

Erlang is a functional language (among other paradigms) but not a logic language. Logic languages are based on relations instead of functions. Datalog and Oz and Mercury are other examples of logic languages.
Post reply on HN