我应该选择F#来开发分布式服务器平台吗? [英] Should I choose F# to develop a distributed server platform?

查看:57
本文介绍了我应该选择F#来开发分布式服务器平台吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在研究一种新的分布式服务器框架,该框架将用于实时仿真(20,000多个客户端).我们已经决定使用C#/.NET作为我们的平台,但是最近有人给我传递了一些有关F#的文章,从表面上看,它看起来像是用于开发服务器的好工具.我正在寻找使用F#解决大型现实问题的人的一些想法.

I am currently in the research phase for a new distributed server framework that will be used for real time simulations (20,000+ clients). We had made a decision to use C#/.NET as our platform, but someone recently passed me some articles on F# and, from the surface, it looks like a great tool to use in developing the server. I am looking for some thoughts from someone who has used F# to solve large, real world, problems.

  • F#是一个很好的工具吗?

  • Is F# a good tool for this?

有哪些陷阱?我们正在处理大量的交互消息和状态变化,尽管这可能会存在于某种类型的数据库云中.函数式编程似乎在处理大规模并行性和分布式计算方面大放异彩,但似乎不鼓励更改任何状态.

What are the pitfalls? We are dealing with lots of interacting messages and a lot of changing state, although that will likely live in a DB cloud of some kind. Functional programming seems to shine in dealing with massive parallelism and distributed computing, but seems to discourage changing any kind of state.

F#是否会留下来?令我感到担忧的是,它太新了,我不想把自己束缚在垂死的平台上(J#,有人吗?)……

Is F# going to stick around? It concerns me that it is so new and I don’t want to tie myself to a dying platform (J# anyone?)…

是否存在使用F#的大型,现实世界的解决方案(最好是服务器)?

Are there any large, real world solutions (preferably servers) that are using F#?

F#与大型工程师团队一起工作是否很好?我敢肯定,答案很简单,但是我还是不太熟悉语言/工具.

Does F# work well with large teams of engineers? I am sure the answer to this is a simple yes, but I am still very unfamiliar with the language/tools.

谢谢您的时间.

推荐答案

过去7个月中,我一直在用F#开发大型的现实世界中大量并发服务器.我无法提供确切的详细信息,但这是有史以来最大的咨询合同我的公司.

I have spent the past 7 months developing a large real-world heavily-concurrent server in F#. I cannot give you precise details but this is the largest consultancy contract my company has ever landed.

我正在寻找使用F#解决大型现实问题的人的一些想法. F#是一个很好的工具吗?

I am looking for some thoughts from someone who has used F# to solve large, real world, problems. Is F# a good tool for this?

是的.我在F#中开发最终的商业产品没有问题(我在此处此处),但使用F#进行快速原型制作常常给我们的客户留下深刻的印象.例如,我最近发现一份内部公司文件,该文件引用了3个工作月来实现C ++中的功能,这使我用F#花了4个小时!

Yes. I have no problem developing final commercial products in F# (I did it here and here) but our clients are often most impressed with rapid prototyping using F#. For example, I recently found an internal company document that quoted 3 man months to implement a feature in C++ that had taken me 4 hours with F#!

陷阱是什么?

What are the pitfalls?

语言中有一些怪异之处,但我遇到的唯一主要问题(使我的工作停滞了数周)是

There are some quirks in the language but the only major problems I have encountered (that blocked my work for weeks) were bugs in .NET and poor support for Infiniband drivers on Windows, neither of which had anything specifically to do with F#. I had some minor issues with bugs in the F# libraries (e.g. TryScan is broken) but they were easy to work around once I had figured out what the problem was. The F# team have always been extremely good at providing support and accepting suggestions.

另外,请注意,我是在工业中率先使用这项技术的少数人之一,因此我希望您遇到的问题比以前更少,而且由于我们已经为您解决了这些问题,因此可以更快地解决它们!

Also, note that I am one of the few people who pioneered this technology in industry so I expect you will hit fewer problems than I did and will solve them more quickly because we already solved them for you!

我们正在处理大量交互消息和状态变化,尽管这可能存在于某种类型的数据库云中.函数式编程似乎在处理大规模并行性和分布式计算方面大放异彩,但似乎不鼓励更改任何状态.

We are dealing with lots of interacting messages and a lot of changing state, although that will likely live in a DB cloud of some kind. Functional programming seems to shine in dealing with massive parallelism and distributed computing, but seems to discourage changing any kind of state.

这是一个常见的误解.实际上,几乎所有函数式编程语言(例如Lisp,Scheme,Clojure,Scala,Standard ML,OCaml,F#,Erlang)都是不纯净的,并且依赖于不受控制的副作用. Haskell是唯一幸存的纯函数式语言,它是完全不相关的.

That is a common misconception. In reality, almost all functional programming languages (e.g. Lisp, Scheme, Clojure, Scala, Standard ML, OCaml, F#, Erlang) are impure and rely upon uncontrolled side effects. Haskell is the only surviving purely functional language and it is completely irrelevant.

在实践中,F#的生产力优势更多地与类型推断,模式匹配和变量类型(来自ML系列语言)以及其他功能(例如异步工作流,邮箱处理器,序列表达式,互操作性等)有关.

In practice, the productivity benefits of F# have more to do with type inference, pattern matching and variant types (from the ML family of languages) and other features like asynchronous workflows, mailbox processors, sequence expressions, interoperability and so on.

F#是否会留下来?令我感到担忧的是,它太新了,我不想把自己束缚在垂死的平台上(J#,有人吗?)……

Is F# going to stick around? It concerns me that it is so new and I don’t want to tie myself to a dying platform (J# anyone?)…

我们使用F#已有4年了,它不断发展壮大.我认为这不太可能很快消失,尤其是因为微软在内部充分利用了F#.例如, F#的份额英国就业市场仅在四个月内就增长了三倍..

We have been using F# for 4 years and it continues to go from strength to strength. I think it is very unlikely to die anytime soon, not least because Microsoft are making such good use of F# internally. For example, the F# share of UK job market just tripled in only four months.

是否存在使用F#的大型,现实世界的解决方案(最好是服务器)?

Are there any large, real world solutions (preferably servers) that are using F#?

是的,很多.微软继续在Bing AdCenter和Halo 3中使用它,而E-ON,Grange和Credit Suisse等其他公司似乎已经在使用它构建了强大的系统.我怀疑还有更多的秘密使用它,就像我们的客户一样.

Yes, many. Microsoft continue to use it in Bing AdCenter and Halo 3 and other companies like E-ON, Grange and Credit Suisse seem to have build substantial systems with it. I suspect there are dozens more using it in secret as our client does.

F#与大型工程师团队合作是否很好?我敢肯定,答案很简单,但是我还是不太熟悉语言/工具.

Does F# work well with large teams of engineers? I am sure the answer to this is a simple yes, but I am still very unfamiliar with the language/tools.

如果您是指由F#程序员组成的大型团队,那么我不知道:我只使用这样的语言在多达4人的团队中工作.

If you mean large teams of F# programmers then I don't know: I have only ever worked in teams of up to 4 people using these kinds of languages.

如果您的意思是将F#引入大型团队的一部分是如何工作的,我可以将我的客户用作案例研究.他们两年前没有F#.如今,生产力最高的前两个团队都在使用F#,他们正在解决在公司引入F#之前无法解决的问题.定期使用F#的人数已从两年前的一个逐渐增加到今天的大约二十个.他们已经停止雇用C ++开发人员,并开始要求F#作为新员工的基本知识.

If you mean how does the introduction of F# into part of a large team work, I can use my client as a case study. They had no F# 2 years ago. Today, the top two most productive teams are both using F# and they are solving problems that were believed to be unsolvable before the introduction of F# at the company. The number of people using F# regularly has increased gradually from one person two years ago to around two dozen people today. They have stopped hiring C++ developers and started requiring F# as basic knowledge for new employees.

尽管有不可避免的政治问题.我的生产力引起了整个公司的关注,管理层开始质疑为什么我如此具有更高的成本效益,这给使用主流语言(C ++和C#)的团队带来了很大压力.因此,我们现在正受到抨击,并失去了公司内部的支持,因为我们使其他人看起来很糟糕.上周五指示我放慢脚步,以免使太多人看上去很糟!因此,我现在已被分配到多个项目,并在此重复此成功". ;-)

There are inevitable political issues though. My productivity has raised eyebrows across the company and management have started to question why I am so much more cost effective, putting a lot of pressure on the teams using mainstream languages (C++ and C#). Consequently, we are now coming under fire and losing buy-in within the company because we're making others look bad. I was instructed on Friday to slow down in order to avoid making too many people look bad! So I have now been assigned to multiple projects and am repeating this "success" there. ;-)

这篇关于我应该选择F#来开发分布式服务器平台吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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