I was pretty amazed by the power of Prolog. It took some time to get the head around, but to me it seemed to be the coolest declarative language out there. That's why recently, after two years of some functional programming with Scala, I decided to take a look at logical programming again, to "train my brain" or better for actual usage.
Combining functional and logical programming seems attractive for me to learn/solidify concepts of both declarative paradigms. I find also find strong type systems very useful and fascinating.
Scala really shined with interop. Let's not reinvent wheels. It should be able to call code in another main language, and preferable also to be callable. But it doesn't have to be Java. C or Haskell would be ok too.
So, which are the most useful and enlightening FLP languages today, and what are your opinions and recommendations on them?
Here is what I found so far:
Mercury: claims to be fast, strongly typed Prolog. Pure declarative, but no logical variables! No constraint programming? Seems to be the most widely used FLP. Interop??
Curry: seems promising and the most advanced, but right now a bit low on documentation. Does "experimental" mean immature/not ready to dive into? just based on Haskell or actually good interop with Haskell?
Ciao: seems to provide many features I want, but Stack Overflow doesn't even seem to know it at all, although it exists since 1984? What's wrong with it? Interop?
drools (java library/DSL): claims it allows hybrid forward- and backward chaining. Mature. Direct interop with Java/Scala, but relying on mutable data / imperative constructs? How well does it integrate with functional JVM languages?
miniKanren: implementations exist on several platforms. How is interop? Efficient?
Lambda Prolog implementations such as:
Good but theoretic reads and biased towards curry and not addressing practical concerns:
I can give you a (slightly) biased recommendation for Curry.
As you already mentioned, Curry is quite advanced and, while still experimental, definitely ready to be used. There are already applications in productive use. You won't find many reads on practical aspects since Curry is mainly a research language. However, there is a small but helpful community reading and answering the Curry Mailing List:
http://www-ps.informatik.uni-kiel.de/currywiki/documentation/mailing
Regarding interoperability, there seem to be two choices: The Münster Curry Compiler(MCC) supports a subset of the Haskell foreign function interface to call C code.
The most recent Curry implementation, the Kiel Curry System 2 (KiCS2), compiles Curry to Haskell. There is a schematic way to call Haskell Code from Curry when using KiCS2 (see the KiCS2 Manual, Appendix D). Unfortunately, I am not aware of a way to call Curry code from another language.
The most profoundly useful nexus of FP and LP has been, as far as I've found, Mercury + Erlang. Both are incidentally interesting from an academic point of view (you really do need to have your fundamentals straight if you want to do good things with either, or both), but both also place a premium on getting products to market and maintaining them as opposed to being research oddities.
I'm not really sure if the OP was weighting "useful" greater than "instructive", and I also don't know if "useful" means "code that usefully solves problems in the real world". But assuming that this is part of the criteria here, Mercury + Erlang is by far the most interesting combination of LP and FP to be had at the moment.
来源:https://stackoverflow.com/questions/17675133/most-useful-and-instructive-functional-logic-language-to-learn