Hacker News new | ask | show | jobs
by _delirium 5776 days ago
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.]