我在这里看到很多关于函数式语言的讨论。为什么你要使用传统语言而不是传统语言呢?他们在哪些方面做得更好?他们更不擅长什么?理想的函数式编程应用程序是什么?
当前回答
我认为你问题的答案更多地在于“工作的正确工具”这句话,而不是最热门的东西。总会有热门的新技术,也总会有人扑上去。
函数式语言已经出现了一段时间,只是现在它们得到了更多的报道。
其他回答
我一定是糊涂了,但我还是不明白。是否有像f#这样的函数式语言编写的小型应用程序的实际例子,你可以查看源代码,并了解如何以及为什么使用这种方法比c#更好?
微软正在Visual Studio上大力推广f#的下一个版本。它是一种像Scala一样的混合语言,并且可以很好地与。net框架的其余部分集成。我认为许多微软公司将使用它来加速高度并行的数据处理应用程序和功能的开发。
它之所以流行起来,是因为它是控制复杂性的最佳工具。 看到的: ——西蒙·佩顿-琼斯演讲《哈斯凯尔的味道》幻灯片109-116 ——Tim Sweeney的《下一个主流编程语言:游戏开发者的视角
当阅读Tim Sweeney的《The Next主流编程语言:A Game Developer’s Perspective》时,我的第一个想法是——我必须学习Haskell。
PPT
谷歌的HTML版本
I don't know whether it will catch on or not, but from my investigations, a functional language is almost certainly worth learning, and will make you a better programmer. Just understanding referential transparency makes a lot of design decisions so much easier- and the resulting programs much easier to reason about. Basically, if you run into a problem, then it tends to only be a problem with the output of a single function, rather than a problem with an inconsistant state, which could have been caused by any of the hundreds of classes/methods/functions in an imparative language with side effects.
FP的无状态本质更自然地映射到web的无状态本质,因此函数式语言更容易让自己更优雅,更RESTFUL的web应用程序。与JAVA和. net框架形成鲜明对比的是,它们需要在本质上无状态的功能平台(如web)上使用VIEWSTATE和SESSION键来维护应用程序状态,并维护有状态命令语言的抽象(有时相当容易泄漏)。
而且,应用程序越无状态,就越容易进行并行处理。如果你的网站很受欢迎,这对网络来说非常重要。向站点添加更多硬件以获得更好的性能并不总是那么简单。