Live data from Hacker News

Ask HN: Who/What will do for Prolog what Clojure has done for Lisp?

news.ycombinator.com

1–10 of 20 posts

Ask HN: Who/What will do for Prolog what Clojure has done for Lisp?

#1
This question is inspired (i.e. stolen) from Alex Miller at http://twitter.com/puredanger/status/19451154832293888.

Whether you like Clojure or not, it's difficult to deny that it's generated a lot of buzz for Lisp in general. As a nice side-effect, there has been a rise in the number of organizations willing to take a chance on using Lisp for their products and services.

I see some parallels between Lisp and Prolog as families of programming languages. There are likely as many hobby implementations of Prolog as Lisp. Likewise, there is a gross misunderstanding of Prolog and Lisp among the general programmer population. Also, it's unclear how to get started with Prolog and Lisp concerning: implementations, IDEs, documentation, and gurus. To varying degrees, Clojure provides a solid answer to these common misunderstandings for Lisp, but what about Prolog?

Where is the logical successor to Prolog?

Some potential candidates are: Oz, Mercury, some sub-Prolog implementation embedded in another language, some other logic language altogether (e.g. Datalog).

Thoughts?

Re: Ask HN: Who/What will do for Prolog what Clojure has done for Lisp?

#2
Constraint Handling Rules. CHR looks pretty interesting; I saw someone describe an implementation of Fibonacci heaps in CHR[1] as "executable pseudocode", and that's generally a sign of something useful.

[1] http://people.cs.kuleuven.be/~jon.sneyers/presentations/dijk...

Re: Ask HN: Who/What will do for Prolog what Clojure has done for Lisp?

#3
Prolog has its limitations, but it still stands out as one of the oldest, influential and important declarative programming languages.

IMHO, it's hard to say what is the natural successor to Prolog. For all that it shares with Lisp, it definitely has never shared even a fraction of the popularity. They have two entirely different approaches and purposes though, so this isn't terribly surprising. Even if someone does create a new Prolog ala Clojure, it would probably still remain in academia.

I think a better question to ask is what direction is declarative programming headed in? Prolog is just one language in this field, as are some of the Prolog-alternatives listed by the OP. Remembering that SQL is also a declarative programming language, I believe that declarative languages are far from dead; it's a common paradigm, just not one we hear a lot of buzz about.

So all this said, it may be that Prolog doesn't necessarily need a successor. It does it's job well, but logic-based declarative languages are inherently too specialized to expect anything causing a surge of popularity.

One interesting variant of declarative programming is called Answer Set Programming. (http://en.wikipedia.org/wiki/Answer_set_programming). It's particularly good at modeling and solving NP-hard search problems, usually has Prolog-esque syntax, but does well on programs where Prolog would infinite loop (e.g. p :- not q. q :- not p.). As a disclaimer, I'm just beginning research in ASP. :)

Re: Ask HN: Who/What will do for Prolog what Clojure has done for Lisp?

#4
post #3

Prolog has its limitations, but it still stands out as one of the oldest, influential and important declarative programming languages. IMHO, it's hard to say what is the natural successor to Prolog. For all that it shares with Lisp, it definitely has never shared even a fraction of the popularity. They have two entirely different approaches and purposes though, so this isn't terribly surprising. Even if someone does…

You at New Mexico State, by any wild chance? Answer set programming is big there.

Re: Ask HN: Who/What will do for Prolog what Clojure has done for Lisp?

#5
I think Lisp was on an upswing before Clojure came around. Certainly, Clojure has helped a great deal but Paul Graham's essays, Practical Common Lisp and a proliferation of libraries relevant to the problems of today's programmers all preceded Clojure and likely contributed to its popularity.

I suspect any significant gains for Prolog will be in the form of Prolog-like DSL libraries for other languages. It looks like there has been some initial work on one for Clojure, incidentally.

Re: Ask HN: Who/What will do for Prolog what Clojure has done for Lisp?

#6
There won't be a practical successor to Prolog.

Clojure is possible because Lisp already is a general purpose programming language. Prolog isn't. You couldn't do many of the projects in Practical Common Lisp with it. For example, imperatively changing mutable state is really hard to do, yet a very useful approach to many problems.

Re: Ask HN: Who/What will do for Prolog what Clojure has done for Lisp?

#7
post #5

I think Lisp was on an upswing before Clojure came around. Certainly, Clojure has helped a great deal but Paul Graham's essays, Practical Common Lisp and a proliferation of libraries relevant to the problems of today's programmers all preceded Clojure and likely contributed to its popularity. I suspect any significant gains for Prolog will be in the form of Prolog-like DSL libraries for other languages. It looks like…

I agree with this. For instance there's already one for Racket, another Lisp (Scheme), see here: http://docs.racket-lang.org/racklog/index.html

Re: Ask HN: Who/What will do for Prolog what Clojure has done for Lisp?

#9
While not familiar with Prolog, I understand that Erlang's pattern matching comes from that world - so Erlang?

EDIT:

Here's a couple references for the Erlang/Prolog connection...

http://www.erlang.org/faq/academic.html

http://hyperpolyglot.org/logic

Also I found this while looking for the reference for the Prolog/Erlang connection...

http://www.slideshare.net/adorepump/learning-erlang-from-a-p...

Re: Ask HN: Who/What will do for Prolog what Clojure has done for Lisp?

#10
post #2

Constraint Handling Rules. CHR looks pretty interesting; I saw someone describe an implementation of Fibonacci heaps in CHR[1] as "executable pseudocode", and that's generally a sign of something useful. [1] http://people.cs.kuleuven.be/~jon.sneyers/presentations/dijk...

I agree they're useful, but CHR has been included as a standard part of most Prolog implementations since the 1990s. It's possible it just hasn't been fully discovered yet, but it's had some time to attempt to win.
Post reply on HN