针对F#的情况如何? [英] What is the case against F#?

查看:103
本文介绍了针对F#的情况如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

直接的C#/ Java代码非常难以并行化,多线程等。因此,简单的C#/ Java代码将在一个盒子上使用越来越少的总处理能力(因为现在一切都将是多核)。

Straightforward C#/Java code is extremely difficult to parallelize, multi-thread, etc. As a result, straightforward C#/Java code will use less and less of the total processing power on a box (because everything is now going to be multi-core).

在C#和Java中解决这个问题并不简单。可变性和副作用是在C#和Java中完成工作的关键,但这正是使多核,多线程编程变得如此困难的原因。

Solving this problem in C# and Java is not simple. Mutability and side effects are key to getting stuff done in C# and Java, but this is exactly what makes multi-core, multi-threading programming so difficult.

因此,功能性编程将变得越来越重要。

Hence, functional programming is going to become increasingly important.

鉴于J2EE / Ruby世界将在许多功能/多核方法中分裂(就像它几乎所有其他方法一样)虽然.NET人员都会使用F#,但这种思路表明F#将在两年内变得庞大。

Given that the J2EE/Ruby world will splinter amongst many functional/multi-core approaches (just like it does for just about everything else) while the .NET folks will all use F#, this line of thinking suggests that F# will be huge in two years.

这种思路有什么问题?为什么F#不会很明显?

What is wrong with this line of thinking? Why isn't it obvious that F# is going to be huge?

(编辑)Larry O'Brien用此博客文章 :语言方面,在我看来,这是一组C和C ++闪耀的练习 - 至少在多线程的东西之前。具有列表处理习语的语言最初也会表现良好,但可能有内存消耗问题(特别是最终,我认为托管的C派生语言(Java和C#)具有最简单的练习9的路径,然后在练习10中面临严重的缺点,其中并发问题起主要作用。在我看来,并发性是将成为未来五年专业发展的核心问题,因此这些缺点非常重要。

(Edit) Larry O'Brien nails it in this blog post: "Language-wise, in my opinion, this is a set of exercises where C and C++ shine — at least until the multithreading stuff. Languages with list-processing idioms will also do well initially, but may have memory-consumption issues (especially functional languages). Ultimately, I think that the managed C-derived language (Java and C#) have the easiest route to Exercise 9 and then face serious shortcomings with Exercise 10, where concurrency issues play the major role. In my opinion, concurrency is going to become the central issue in professional development in the next half-decade, so these shortcomings are very significant."

推荐答案


直截了可的C#/ Java代码i s
非常难以并行化

Straightforward C#/Java code is extremely difficult to parallelize

如果您使用任务并行库

F#是否变得巨大取决于成本是否/好处就在那里,这一点都不明显。如果.NET开发人员发现他们可以在1/3的时间内使用功能而不是命令式方法编写一些程序(我认为对于某些类型的程序可能是这样),那么F#采用应该有一些动机。

Whether F# becomes huge depends on whether the cost/benefit is there, which is not at all obvious. If .NET developers find out that they can write some programs in 1/3 of the time using a functional rather than an imperative approach (which I think might be true for certain types of programs), then there should be some motivation for F# adoption.

保罗·格雷厄姆关于他在一家初创公司使用Lisp的故事说明了这一过程。 Lisp为他们提供了巨大的竞争优势,但Lisp没有接管世界,不是因为它不强大,而是出于其他原因,比如缺乏图书馆支持。 F#可以访问.NET框架,这给了它一个战斗机会。

Paul Graham's story of his use of Lisp in a startup company is illustrative of this process. Lisp provided them with a huge competitive advantage, yet Lisp didn't take over the world, not because it wasn't powerful, but for other reasons, like lack of library support. That F# has access to the .NET framework gives it a fighting chance.

http://www.paulgraham.com/avg.html

这篇关于针对F#的情况如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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