最有用的和有启发性的功能逻辑语言学习 [英] Most useful and instructive functional-logic language to learn

查看:136
本文介绍了最有用的和有启发性的功能逻辑语言学习的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很惊讶Prolog的力量。花了一段时间才弄到头,但对我来说,它似乎是最酷的声明性语言。这就是为什么最近,经过两年对Scala的一些函数式编程之后,我决定再次查看逻辑编程,以训练我的大脑或更好地实际使用。



<结合功能和逻辑编程对我来说学习/巩固这两种声明式范例的概念似乎很有吸引力。我发现还有很强大的类型系统非常有用和引人入胜。

斯卡拉真的在互操作中闪闪发光。我们不要重新发明轮子。它应该能够以另一种主要语言调用代码,并且也可以被调用。但它不一定是Java。 C或Haskell也可以。

那么,今天哪些是最有用和最具启发性的FLP语言,您对此有何看法和建议?



这是我到目前为止发现的:


  1. 水星:声称是快速,强类型的Prolog。纯声明性的,但没有逻辑变量!没有约束编程?似乎是使用最广泛的FLP。 Interop ??

  2. 咖喱:看起来很有前途,也是最先进的,但现在的文档有点低。 实验是否意味着不成熟/不准备潜入?只是基于Haskell或与Haskell实际上良好的互操作性?

  3. Ciao :似乎提供了很多我想要的功能,但Stack Overflow似乎根本不知道它,尽管它自1984年以来就存在了?它出什么问题了? Interop?
  4. drools(java库/ DSL):声称它允许混合前向和后向链接。成熟。直接与Java / Scala交互,但依赖可变数据/命令式结构?它如何与功能性JVM语言集成?
  5. miniKanren:实现存在于多个平台上。 interop如何?高效? 一个href =https://github.com/mmirman/caledon =nofollow noreferrer> Caledon :可能会很好,但理论很重。用处?与Haskell有效的互操作?文档?


  6. Teyjus 。类似于Caledon。


好的但是理论上的读法和偏向于咖喱而不是寻址实际问题:


  • http://doi.acm.org/10.1145/1721654.1721675


  • http://www.informatik.uni-kiel.de/~mh/slides/ETAPS00.pdf

  • 我可以给你一个(略)偏向于库里的建议。

    正如您已经提到的那样,Curry相当先进,虽然仍然是实验性的,但一定可以使用。已经有生产应用的应用。由于库里主要是一门研究语言,因此你不会在实际方面找到很多内容。然而,有一个小而有用的社区阅读和回答咖喱邮件列表:

    http://www-ps.informatik.uni-kiel.de/currywiki/documentation/mailing



    关于互操作性,似乎有两种选择:MünsterCurry Compiler(MCC)支持Haskell外部函数接口的一个子集来调用C代码。

    最近的库里实施,基尔咖喱系统2(KiCS2),编译库里哈斯克尔。当使用
    KiCS2时,有一种从库里调用Haskell代码的示意方法(请参阅 KiCS2手册,附录D)。不幸的是,我不知道从另一种语言调用Curry代码的
    方式。


    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:

    1. 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??

    2. 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?

    3. 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?

    4. 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?

    5. miniKanren: implementations exist on several platforms. How is interop? Efficient?

    6. Lambda Prolog implementations such as:

      1. Caledon: Might be nice, but heavy theory. Usefulness? Effective interop with Haskell? Documentation?

      2. Teyjus. similar to Caledon.

    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.

    这篇关于最有用的和有启发性的功能逻辑语言学习的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆