Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Haskell vs. Prolog comparison [closed]

Tags:

haskell

prolog

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?

like image 975
danatel Avatar asked Dec 19 '09 12:12

danatel


People also ask

Why is Haskell not popular?

The reason is quite obvious. The facilities and elegance of Haskell are very different from the needs of most mainstream programming. Haskell just isn't the right tool for these jobs. One of the most common patterns in popular programming is runtime polymorphism.

Is Prolog still used in 2020?

Yes, as mentioned in other answers, Prolog is actually used in IBM Watson. Prolog doesn't get much "hype" and "buzz" these days, but it is absolutely still used.

Why is Prolog not popular?

It's not sufficient for a language to make the hard (or domain specific) things possible, it also needs to make all the easy things easy, and Prolog really does not. So the language either needs to be truly general purpose (and "more general-purpose than SQL" isn't sufficient) or easily integrated with other languages.

What is Haskell not good for?

Still, as a language, Haskell is not ideal for teaching and productivity. There too many different ways of doing things (eg. strings, records); compiler errors need improvement, prelude has too many exceptions-throwing functions (eg.


1 Answers

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.

  • The Reasoned Schemer by Daniel P. Friedman, William E. Byrd, and Oleg Kiselyov
  • Programming Languages: Application and Interpretation by Shriram Krishnamurthi
  • LogicT - backtracking monad transformer with fair operations and pruning
  • Logic programming on Haskell Wiki
like image 138
gknauth Avatar answered Sep 20 '22 03:09

gknauth