
Who Killed Prolog? (2010) - ihsoj
https://vanemden.wordpress.com/2010/08/21/who-killed-prolog/
======
roenxi
One of the reasons C is the way it is is that that way is the way the
processor is.

The abstraction isn't perfect, but it is decent enough for a first
approximation. I'm guessing Fortran is similar. Imperitive languages of that
era were used because they worked very closely with the actual actions of the
CPU and gave a fine grained control over execution, allowing efficiencies.
Since then, popular languages have all been improvements that take advantage
of increased computing power to do interesting things.

Sometimes new paradigms rear up - eg, Clojure with its set-and-forget approach
to values. That paradigm is sold on the basis that it is easier to reason
about, debug and as a practical bonus faster in many cases than the
alternative. This is a great reason to learn a new paradigm.

Prolog is an experiment, but has anyone found a domain for the paradigm of
logic programming? I've used it, and I couldn't see any domain where it seemed
to have an advantage. For AI in particular - the way the world is developing,
it seems logic is a weak foundation for intelligence. At this point, given
that we know humans do not use logic for their intelligence, it would be a
little surprising if logic is the best way to approach that particular
problem. In most domains, the error in your sensor overwhelms the existence of
fact and the 'rules' are more what you'd call guidelines.

If I rule out AI, what field is Prolog especially suited for? It doesn't read
like it has a natural advantage in debugability (quite the reverse imo), GUIs,
stream processing, efficiency, etc. With a lack of a killer domain, why not
implement it as an afterthought library in C or lisp, and keep the imperative
languages we have so much research in?

Basically, the default state of Prolog is dead. It doesn't represent how
humans want to think about programming, it doesn't represent how the computer
implements programming and so if it doesn't have a domain where its paradigm
is spot on perfect it isn't going to take hold. It is an interesting idea and
might yet be useful, but someone will need to find a reason to justify it.

~~~
floatboth
> what field is Prolog especially suited for?

Graphs?

SWI-Prolog even comes with an RDF triple store: [http://www.swi-
prolog.org/pldoc/man?section=semweb-rdfapi](http://www.swi-
prolog.org/pldoc/man?section=semweb-rdfapi)

Why aren't people using Prologs instead of graph databases like neo4j?

~~~
mark_l_watson
I got my start with semantic web/linked data using semweb library and SWI-
Prolog. I think that RDF data stores (and more general graph databases like
Neo4j) scale better, but semweb is great for experimenting.

------
xvilka
There is some increasing interest in logic languages recently, mostly as an
extension of DL/ML approach - probabilistic logic for example. Surprisingly
easy probabilistic systems can be built with Prolog [1].

[1] [https://www.metalevel.at/prolog/ai](https://www.metalevel.at/prolog/ai)

------
pryce
I'm thrilled to see Prolog logic-engine concepts heavily contributing to
Clojure's core.logic library[1].

Because Clojure plays so well with the JVM, having industry applications
leveraging logic engines is becoming beautifully feasible.

[1]
[https://github.com/clojure/core.logic](https://github.com/clojure/core.logic)

~~~
billrobertson42
core.logic hasn't really seen any updates in such a long time. I don't think
it's maintained any more.

~~~
gnulinux
The plague of modern software engineering is "there are no updates, it must be
unmaintained". This attitude makes tons of solid, old, working software seem
"outdated" and creates a cultural momentum towards new, shiny, broken shit.
The result is ecosystems like js. Maybe we should believe software can be
complete?

~~~
jmnicolas
I mostly agree but how can you distinguish between unmaintained and complete
software ?

~~~
gnulinux
For example, OpenSSL is a very strong force behind what we call "internet",
without something like OpenSSL we wouldn't have internet today. When
heartbleed was found in OpenSSL the dynamic wasn't to retire OpenSSL and
migrate to GnuTLS or something else, or even something new, but to patch
OpenSSL. Why, because even though OpenSSL development is silent, we know that
it IS maintained. If we find another heartbleed today, nobody will want to
replace the entire cryptographic infrastructure of the internet, instead fix
OpenSSL.

Another examples: zlib, SWI-Prolog, most BLAS implementations, some GCC
backends, Concord (heuristic-based TSP solver), most parts of algo based
libraries (CGAL, Eigen, GMP, GSL etc...) (of course these libraries are
implementing new features, but there are some parts of codebase that didn't
receive any commit for years)...

I think good signals to tell a package is complete: (1) there are no known
critical bugs (2) if we found a critical bug today, we're reasonably sure we
will get a fix in reasonable amount of time (3) project and project goals are
well-documented (4) everything documented as goal is implemented i.e. there is
no on-going development happening.

------
Animats
Pure Prolog can do backtracking and little else. It's a domain-specific
language.

Long ago I wrote something in Turbo Prolog. The algorithm, for configuring
minicomputers, was easy. The drop-down menus were hell.

~~~
nerdponx
As I was seeing another post, it seems like Prolog's advantage would be as an
embedded DSL. So you can write the logic parts in Prolog, then switch to C++
or Java or whatever for the GUI.

~~~
YorkshireSeason
You might find the following papers interesting.

[1] O. Kiselyov, K. Kameyama, _Rethinking Prolog_.
[http://okmij.org/ftp/kakuritu/rethinking.pdf](http://okmij.org/ftp/kakuritu/rethinking.pdf)

[2] E. Barrett, C. F. Bolz, L. Tratt, _Unipycation: A Case Study in Cross-
Language Tracing_. [https://soft-
dev.org/pubs/pdf/barrett_bolz_tratt__unipycatio...](https://soft-
dev.org/pubs/pdf/barrett_bolz_tratt__unipycation_a_study_in_cross_language_tracing.pdf)

------
eadmund
Interesting idea that FGCS hype killed Prolog; on the Lisp side, we tend to
think that AI hype killed Lisp. Also interesting that the author considers
Prolog a competitor to Lisp, when (I think) most programmers don't even think
of Prolog. Similarly, while we Lisp programmers think of Algol-like languages
as our great competitors, I daresay the vast majority of C, Python, C++, Perl,
Java, Go &c. programmers don't even think of Lisp.

I _think_ one can just run a Prolog engine in Lisp these days, which would get
one the best of both worlds. But I'm not a Prolog programmer, so … perhaps I'm
incorrect.

~~~
yourapostasy
You can run Prolog inside Common Lisp:

[https://www.cliki.net/prolog](https://www.cliki.net/prolog)

I don't know how good those implementations are compared to dedicated Prolog
environments, though.

~~~
fiddlerwoaroof
And you can run Common Lisp inside prolog:
[https://github.com/TeamSPoon/wam_common_lisp](https://github.com/TeamSPoon/wam_common_lisp)

~~~
kazagistar
And you can't run a JVM in either, so now we know that Java is the best. Or
maybe that this measure was pointless?

~~~
profalseidol
There's Prolog in Java via GNU Prolog for Java:

[https://www.gnu.org/software/gnuprologjava/](https://www.gnu.org/software/gnuprologjava/)

We can use that to run Common Lisp which can run Prolog. Lmao

~~~
kazagistar
If you reread my comment, you will notice my claim was the other way around. I
was trying to point out that the encompassing argument is pointless but
showing that neither lisp nor prolog can evaluate full Java code (because the
reverse is certainly assumed to be possiblr, of course there is jvm lisps and
prologs).

But really which language is bigger is pointless to begin with.

------
sordina
I can't remember where I heard this, but I was told that the death of logic
languages occurred due to the poaching of the majority of good active
researchers and developers by the big database companies.

~~~
olliej
“Poaching” implies theft.

Are you saying researchers belong to their university? Or are you saying once
someone is a researcher they are no longer allowed to move to industry?

Also in my experience a lot of researchers are grad students, who move to
industry on completion of their degree - does getting a job after graduating
mean you were “poached”?

~~~
sordina
Is this a serious comment? Poaching is a pretty common term for actively
hiring someone, especially groups of people from another position of
employment. Similar to head hunting not referring to actual collection of
heads.

------
tralarpa
If you are interested in logic programming languages (like Prolog) and in
functional programming languages (like Haskell), you should definitely take a
look at the _Curry_ language.

For people who know Haskell, such a type definition should look very familar:

    
    
       data IntTree = Leaf | Branch Int IntTree IntTree
    

The mind-bending stuff starts when you see "function" definitions like

    
    
       choose x y = x
       choose x y = y

~~~
adimitrov

        choose x y = x
        choose x y = y
    

:-) That's mind bending if you don't know logic programming. So how can the
above statement even make sense? You have to understand that a logic program
will try _all possible statements_ until it finds a match, or simply all
possible statements if its job is to do an exhaustive search of the problem
space.

So in the _choose_ function above, the execution algorithm (the runtime, as it
were) would try to choose x first, and see if that yields a result that
matches the query. It then chooses y. This may yield no, one, or many results,
depending on the exact constraints of the search space.

If you posed the problem as _choose 'a' 'b'_ then the answer would be _' a'_
if you're content with _any_ solution (it gives you the first it finds), or _[
'a','b']_ if you wanted _all_ solutions.

Man, now I wanna go do some Prolog… pity there's nobody who's gonna pay me to
do it, and I have to do PHP and JS.

------
mark_l_watson
Interesting read. The mention of the book “The Fifth Generation” by Edward A.
Feigenbaum and Pamela McCorduck (that I read in 1983, and was totally into at
the time) made me think of Kai-Fu Lee's new book "AI Superpowers: China,
Silicon Valley, and the New World Order" that markets the idea that China will
win the AI war because they have more data and entrepreneurs and established
companies who go deep with developing online to offline businesses (invest
heavily in supporting physical infrastructure).

History is not kind the the Japanese 5th generation project. My hunch is that
Kai-fu's predictions will be more accurate than Edward's and Pamela's
predictions.

I used to use Prolog a lot, now I just occasionally play with it. Contrasting
to Lisp: until I started my current job 15 months ago (Python ML), Lisp was
one of the cornerstones of my work and consulting business for 35 years.

------
js8
Maybe I have the history wrong but it seems to me that researchers moved on
from classical logic to lambda calculus and intuitionist Martin-Lof type
theories and associated programming languages (ML, Miranda, Ocaml, Haskell,
Coq).

Am I wrong in thinking that Coq for example can be considered a replacement of
Prolog?

~~~
arnobastenhof
Languages like Prolog and Haskell represent different views on the relation
between logic and computation. Prolog models computation as proof search,
whereas Haskell models it as proof normalization. In the former case your
program basically consists of a bunch of formulas that are used as assumptions
in an attempt to answer a query at runtime. With Haskell, your program
consists of terms, which correspond directly to proofs under the Curry-Howard
isomorphism. From the type theory perspective, with functional programming
languages like Haskell the programmer writes terms (proofs) of some given type
(formula), whereas with logic programming it's the runtime that tries to
answer whether a given type is inhabited (i.e., if a proof exists). I'm being
a bit sloppy here in that I'm disregarding the differences between classical
and intuitionistic logics, although the former as well have been studied in
type theory via their double negation translations.

I think Girard's ludics, among other goals, tried to unify these two views,
although I know too little about it.

Finally, note Coq, like Haskell, models computation as proof normalization,
although it's design goals are very different from Haskell.

------
opless
Did you know that there was a prolog in Windows?

[http://web.archive.org/web/20040603192757/research.microsoft...](http://web.archive.org/web/20040603192757/research.microsoft.com/research/dtg/davidhov/pap.htm)

Dr Dobbs (bad formatting) [http://www.drdobbs.com/cpp/extending-c-with-
prolog/184409294](http://www.drdobbs.com/cpp/extending-c-with-
prolog/184409294)

Prolog mentioned above, has been preserved on archive.org, but here for
posterity... [https://github.com/opless/small-prolog-walnut-creek-
original](https://github.com/opless/small-prolog-walnut-creek-original)

------
giardini
FWIW This article has been posted/discussed 3 times over the last 8 years. A
follow-up article was also posted/discussed once. To see them just search for
"Who killed Prolog" using the HN search function at bottom of
news.ycombinator.com.

~~~
macintux
Even easier: there’s a “past” link embedded at the top of each discussion. (I
just discovered this after being here for several years.)

------
profalseidol
Since I don't know Prolog (except for it being mentioned in some computer
history subject in school), I search for a crash course and found this:

[http://www.learnprolognow.org/lpnpage.php?pagetype=html&page...](http://www.learnprolognow.org/lpnpage.php?pagetype=html&pageid=lpn-
htmlse1)

Good fast tutorial for it.

Side-note: The tutorial calls the condition the 'body' and the resulting facts
as 'head' took me awhile to absorb since my brain can't stop thinking of the
common syntax: if(conditions){body}

~~~
tom_mellior
That tutorial is fast, but it's a pretty bad tutorial that will teach you
terrible habits and a very incomplete understanding of Prolog. Unfortunately
there are no good free ones.

Many people seem to like
[https://www.metalevel.at/prolog](https://www.metalevel.at/prolog) (featured
here several times). Although I don't think it's very good from a didactic
point of view, many disagree, and at least the author really knows what they
are talking about.

I have a PDF of the fifth edition of "Programming in Prolog" by Clocksin and
Mellish lying around here. I could swear it was available for free as open
access for a while, though a very quick web search doesn't confirm this.

~~~
profalseidol
Thanks. Looks like a good proper learning material for Prolog. However, I just
needed to get a feel or taste of what Prolog is without spending too much time
reading concepts.

Thanks for the book suggestion. Quick duckduck for it gives me this pdf:

[http://www2.cs.arizona.edu/classes/cs372/spring15/Programmin...](http://www2.cs.arizona.edu/classes/cs372/spring15/ProgrammingInProlog5eC-M.pdf)

~~~
tom_mellior
That's the one, thanks for digging it up!

------
HugoDaniel
The operators precedence killed Prolog

------
chajath
In my mind Prolog is enjoying a health afterlife in the form of Erlang (and
Elixir)

~~~
colanderman
Beside syntax, those languages are nothing like Prolog. Notably lacking are
backtracking and logic variables.

~~~
macintux
True, but Erlang was originally built using Prolog, so it’s true in a
historical sense even if not particularly relevant now.

