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?
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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With