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

发布于 2024-10-02 17:58:53 字数 138 浏览 1 评论 0原文

只有当我可以使用新的库时,新的语言才会有趣。所以我想知道我可以在 .net 中通过 F# 使用哪些新库。如果 F# 与 ML/OCaml 兼容,则 Ocaml 库将移植到 F# 或可以移植。我对 .NET 中的信号处理/语音识别、逻辑编程/SLD 解析库感兴趣。

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#. If F# is compatable with ML/OCaml what Ocaml libraries are ported to F# or can be ported. I'm interesting in signal processing/voice recognition, logic programming/SLD resolution libraries in .NET.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

潇烟暮雨 2024-10-09 17:58:53

我认为没有大量 ML/OCaml 库已移植到 F#。 F# 编程风格与人们在 ML/OCaml 中使用的风格完全不同,因此 ML/OCaml 库对于 F# 程序员来说会感觉有点陌生。

然而,有些项目可以在 F# 和 OCaml 中交叉编译。 F# 编译器本身曾经是这样的,我相信 Slayer 来自 MSR 是(或者曾经是?)另一个例子。但是,对于您提到的两个领域,我不知道有任何 F# 库。

如果您有兴趣在 F# 中编译 OCaml 代码,那么以下几点可能会对您有所帮助:

  • 将 OCaml 代码移植到 F# 时较大的语言限制是 F# 不支持函子。
  • 一些标准 OCaml 库在 FSharp.PowerPack.Compatibility.dll 程序集中实现(可以在 F# PowerPack)

I don't think there is a large number of ML/OCaml libraries that have been ported to 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.

There are however some projects that cross-compile in F# and OCaml. F# compiler itself used to be like that and I believe that Slayer from MSR is (or was?) another example. However, for the two domains you mentioned, I'm not aware of any F# library around.

If you're interested in compiling OCaml code in F#, then here are a few things that may help you:

  • The larger language limitation when porting OCaml code to F# is that F# doesn't support functors.
  • Some standard OCaml libraries are implemented in the FSharp.PowerPack.Compatibility.dll assembly (which can be found in F# PowerPack)
慵挽 2024-10-09 17:58:53

F# 包含 OCaml 的一些端口,例如 SetMap 集合。其他具体数据结构可以轻松移植,例如来自克里斯·冈崎的优秀专着。我描述了基于他的左堆的堆排序这里 在 OCaml 和 F# 中。我在此处发布了对 F# 中的几个纯函数堆的更全面的评论。然而,F# 似乎不能很好地表达抽象数据结构(例如通过队列抽象的可连接列表),因为它缺乏冈崎如此熟练地使用的高阶模块系统。我还发布了一些其他翻译,例如 Burrows-Wheeler 变换 OCaml 和 F#。
OCaml 有很多很棒的库,例如 ocamlgraph,但它们通常很难或不可能直接翻译,因为 F# 缺乏核心语言功能,例如高阶模块、多态变体、宏等等。

当然,微软是第一个 F# 采用者,他们移动了他们的 TrueSkill 排名系统(用于 Halo 3 和Bing AdCenter)及其第三方驱动程序验证软件(从 OCaml 到 F#)。

用于操作 PDF 文档的 Coherent PDF 命令行工具是在 OCaml 和 F# 中交叉编译的少数代码库之一。

我们将 Smoke Vector Graphics 引擎和(已停产的)Presta 应用程序从 OCaml 翻译为 F#,现已出售如F# 用于可视化。由于语言之间的相似性,翻译当然变得更容易,但仍然需要几天的时间才能完成,而且我们不可能交叉编译。

从 OCaml 翻译为 F# 的大部分代码都是商业代码,因为 F# 主要是一种商业语言,因此 OCaml 的商业用户正在迁移到 F#。随着最近将 F# 本身作为 OSS 发布,开源 F# 可能会开始腾飞,但现在还为时过早。

至于您的特定主题(例如信号处理),我不确定除了绑定到 FFTW 之外还推荐什么,我在 用于技术计算的 Visual F# 2010

F# includes some ports from OCaml such as the Set and Map collections. Other concrete data structures can be easily ported, such as the purely functional data structures from Chris Okasaki's excellent monograph. I described a heap sort based upon his leftist heap here in OCaml and F#. I published a more thorough review of several purely functional heaps in F# here. However, F# does not seem to be capable of expressing abstract data structures (e.g. catenable lists abstracted over queues) very well because it lacks the higher-order module system that Okasaki uses so expertly. I have also posted some other translations like this Burrows-Wheeler transform in OCaml and F#.
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.

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#.

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#.

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. 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#. Open source F# may begin to take off following the recent release of F# itself as OSS but it is early days yet.

As for your specific topics (e.g. signal processing), I'm not sure what to recommend beyond binding to FFTW, which I described in Visual F# 2010 for Technical Computing.

薄暮涼年 2024-10-09 17:58:53

我找到了一个支持进化算法开发的库。

F# 人工智能库 - 差分进化的实现:
http://fsai.codeplex.com/documentation?version=11

有关进化算法的信息:
http://en.wikipedia.org/wiki/Evolutionary_algorithm

另外还有一个关于“的简短讨论”很高兴在 F# 上拥有“SLD 解析引擎(以及移植到 C# 的 prolog 的一个链接)
http://cs.hubfs.net/forums/thread/6676.aspx

就这样...

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

about evolutionary algorithms there:
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

That's all...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文