有没有什么算法需要专门用函数式语言来实现

发布于 2024-09-27 22:49:46 字数 85 浏览 0 评论 0原文

我是一名 C# 开发人员,我没有足够的关于函数式语言的信息,

我的问题是是否有任何算法需要专门使用函数式语言来实现?

问候。

I'm a C# developer and I don't have enough information about functional languages,

My question that is there any algorithm needs functional language exclusively to be implemented?

Regards.

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

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

发布评论

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

评论(3

寂寞笑我太脆弱 2024-10-04 22:49:46

只要一种语言图灵完备,就可以实现任何算法其中(根据“算法”的定义)。但正如其他人所说,函数式语言可以更优雅地完成某些事情。 (看看 Haskell。多么可爱的语言啊。) 我还认为有一类问题 OOP 语言做得更好。 (在我看来,GUI,尽管有些人可能不同意。)

As long as a language is Turing complete, any algorithm can be implemented in it (by definition of "algorithm"). But as others have said, functional languages can do certain things more elegantly. (Just take a look at Haskell. What a lovely language.) I'd also argue that there is a class of problems that OOP languages do better. (In my opinion, GUIs, although some may disagree.)

不必你懂 2024-10-04 22:49:46

不,但是函数式语言可能会为可以利用这种语言的功能的算法带来更优雅的实现。例如,需要大递归深度的递归。

No, however a functional language may lead to a more elegant implementation for an algorithm that can exploit the features of such a language. For example, one that requires large recursive depth.

病毒体 2024-10-04 22:49:46

据我了解,这种算法必须翻译成在某些微处理器上执行的一组机器命令(无论您使用编译语言还是解释语言)。目前的处理器都无法“正常运行”。
事实上,这导致了更广泛的断言:任何“功能算法”都可以用 C 或汇编程序实现:)

As I understand it, such algorithm would have to be translated into a set of machine commands executed on some micro-processor (whether you use compiled or interpreted language). And none of the current processors are 'functional'.
In fact, this leads to even broader assertion: any 'functional algorithm' can be implemented in C or assembler :)

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