Haskell vs. Prolog comparison

danatel picture danatel · Dec 19, 2009 · Viewed 30k times · Source

What kind of problems is better solved in Prolog than in Haskell? What are the main differences between these two languages?


Edit

Is there a Haskell library (kind of a logical solver) that can mimic Prolog functionality?

Answer

gknauth picture gknauth · Dec 19, 2009

Regarding the logic library question: If it doesn't exist, it should be possible to build one a variety of ways. The Reasoned Schemer builds logical reasoning capabilities into Scheme. Chapters 33-34 of PLAI discuss Prolog and implementing Prolog. These authors are building bridges between Scheme and Prolog. The creators of PLT Scheme have built as one of their languages a Lazy Scheme after the lazy evaluation feature of Haskell. Oleg Kiselyov's LogicT paper is brilliant as usual--he pushes the boundary for what is possible in many languages. There is also a logic programming example on the Haskell Wiki.