简体   繁体   English

新工具集:原始F#模块或从OCaml移植

[英]new toolset: original F# modules or ported from OCaml

New language is interesting only if I can use new libraries. 只有我可以使用新库,新语言才有意义。 So I want to know what new libraries I can use in .net with F#. 所以我想知道我可以使用F#在.net中使用哪些新库。 If F# is compatable with ML/OCaml what Ocaml libraries are ported to F# or can be ported. 如果F#与ML / OCaml兼容,那么Ocaml库被移植到F#或者可以被移植。 I'm interesting in signal processing/voice recognition, logic programming/SLD resolution libraries in .NET. 我对.NET中的信号处理/语音识别,逻辑编程/ SLD解析库感兴趣。

I don't think there is a large number of ML/OCaml libraries that have been ported to F#. 我不认为有大量的ML / OCaml库被移植到F#。 The F# programming style has become quite different to what people use in ML/OCaml, so an ML/OCaml library would feel a bit foreign to F# programmers. F#编程风格与人们在ML / OCaml中使用的风格大不相同,因此ML / OCaml库对F#程序员来说有点陌生。

There are however some projects that cross-compile in F# and OCaml. 但是有些项目在F#和OCaml中进行交叉编译。 F# compiler itself used to be like that and I believe that Slayer from MSR is (or was?) another example. F#编译器本身曾经是这样的,我相信来自MSR的Slayer是(或者是?)另一个例子。 However, for the two domains you mentioned, I'm not aware of any F# library around. 但是,对于你提到的两个域,我不知道任何F#库。

If you're interested in compiling OCaml code in F#, then here are a few things that may help you: 如果您对使用F#编译OCaml代码感兴趣,那么以下是一些可能对您有所帮助的事情:

  • The larger language limitation when porting OCaml code to F# is that F# doesn't support functors. 将OCaml代码移植到F#时,更大的语言限制是F#不支持仿函数。
  • Some standard OCaml libraries are implemented in the FSharp.PowerPack.Compatibility.dll assembly (which can be found in F# PowerPack ) 一些标准的OCaml库在FSharp.PowerPack.Compatibility.dll程序FSharp.PowerPack.Compatibility.dll实现(可以在F#PowerPack中找到)

F# includes some ports from OCaml such as the Set and Map collections. F#包括来自OCaml的一些端口,例如SetMap集合。 Other concrete data structures can be easily ported, such as the purely functional data structures from Chris Okasaki's excellent monograph . 其他具体的数据结构可以轻松移植,例如Chris Okasaki优秀专着的纯功能数据结构。 I described a heap sort based upon his leftist heap here in OCaml and F#. 我描述了基于他的左倾堆一个堆排序这里 OCaml中和F#。 I published a more thorough review of several purely functional heaps in F# here . 我发表在F#几个单纯的功能堆的更彻底的审查这里 However, F# does not seem to be capable of expressing abstract data structures (eg catenable lists abstracted over queues) very well because it lacks the higher-order module system that Okasaki uses so expertly. 但是,F#似乎不能很好地表达抽象数据结构(例如,通过队列抽象的可连接列表),因为它缺少Okasaki如此专业地使用的高阶模块系统。 I have also posted some other translations like this Burrows-Wheeler transform in OCaml and F#. 我还在OCaml和F#中发布了一些其他翻译,例如Burrows-Wheeler变换 OCaml has a lot of awesome libraries like ocamlgraph but they are often hard or impossible to translate directly because F# lacks core language features like higher-order modules, polymorphic variants, macros and so on. OCaml有许多令人敬畏的库,如ocamlgraph,但它们通常很难或不可能直接翻译,因为F#缺乏核心语言功能,如高阶模块,多态变体,宏等。

Microsoft were the first F# adopter, of course, moving their TrueSkill ranking system (used in Halo 3 and Bing AdCenter) and their third-party driver verifier software from OCaml to F#. 微软是第一个F#采用者,当然,将他们的TrueSkill排名系统 (在Halo 3和Bing AdCenter中使用)和他们的第三方驱动程序验证软件从OCaml转移到F#。

The Coherent PDF command-line tools for manipulating PDF documents are one of the few code bases being cross compiled in both OCaml and F#. 用于处理PDF文档的Coherent PDF命令行工具是在OCaml和F#中交叉编译的少数代码库之一。

We translated our Smoke Vector Graphics engine and our (discontinued) Presenta application from OCaml to F# and it is now sold as F# for Visualization . 我们将Smoke Vector Graphics引擎和我们(已停产)的Presenta应用程序从OCaml翻译为F#,现在它作为F#以可视化形式出售。 The translation was certainly made easier by the similarity between the languages but it still took days to do and there is no way we'll be cross compiling. 语言之间的相似性肯定使翻译变得更容易,但仍需要数天才能完成,我们无法进行交叉编译。

Most of the code being translated from OCaml to F# is commercial because F# is primarily a commercial language and, consequently, commercial users of OCaml are migrating to F#. 从OCaml转换为F#的大多数代码都是商业代码,因为F#主要是商业语言,因此OCaml的商业用户正在迁移到F#。 Open source F# may begin to take off following the recent release of F# itself as OSS but it is early days yet. 在最近发布的F#本身作为OSS之后,开源F#可能会开始起飞,但它还处于早期阶段。

As for your specific topics (eg signal processing), I'm not sure what to recommend beyond binding to FFTW, which I described in Visual F# 2010 for Technical Computing . 至于你的特定主题(例如信号处理),我不确定除了绑定到FFTW之外还要推荐什么,我在Visual F#2010 for Technical Computing中描述过。

I've found one library that supports evolutionary algorithms development. 我找到了一个支持进化算法开发的库。

F# Artificial Intelligence Library - An Implementation of Differential Evolution: http://fsai.codeplex.com/documentation?version=11 F#人工智能库 - 差异演化的实现: http //fsai.codeplex.com/documentation?version = 11

about evolutionary algorithms there: http://en.wikipedia.org/wiki/Evolutionary_algorithm 关于进化算法: http//en.wikipedia.org/wiki/Evolutionary_algorithm

Also there is a short discussion about "nice to have" SLD resolution engine on F# (and one link to prolog ported to C#) http://cs.hubfs.net/forums/thread/6676.aspx 此外,还有一个简短的讨论,关于F#上的“很好的”SLD解析引擎(以及一个移植到C#的prolog链接) http://cs.hubfs.net/forums/thread/6676.aspx

That's all... 就这样...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM