未来有可能F#将优于其他.Net语言吗? [英] Is it possible that F# will be optimized more than other .Net languages in the future?

查看:136
本文介绍了未来有可能F#将优于其他.Net语言吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

微软可能会在虚拟机执行时或在编译时更有可能制作F#程序,检测到程序是用功能语言构建的,并自动将其更好地并行化?

现在我相信没有这种努力可以自动尝试和执行一个作为单线程程序构建的程序。

也就是说,开发者会编写一个单线程程序。编译器会吐出一个编译好的程序,在需要的时候用多线程完成多线程和同步。



这些优化是否可以在任务管理器中在进程线程数中看到,还是会低于这个水平?

解决方案

我认为这是不太可能的。如果确实发生了,我认为它更可能在IL级别(程序集重写)而不是语言级别(例如F#/编译器专用的东西)。这是一个有趣的问题,我期望一些优秀的头脑一直在关注这个问题,并会继续关注这个问题一段时间,但在近期内,我认为重点将放在让人类更容易指导线程/并行化程序,而不是像魔术一样发生。

(像 F#异步工作流程和类似任务的库并行库等等)都是近期进展的好例子;它们可以为你做大部分工作,特别是当你的程序比声明式更具说明性时,但仍然需要程序员选择,在分析正确性/意义,并且可能对代码的结构进行微小的改变以使其全部工作。)

无论如何,这都是猜测;谁可以说未来会带来什么?我期待着发现(并希望使其中的一些发生)。 :)

Is it possible that Microsoft will be able to make F# programs, either at VM execution time, or more likely at compile time, detect that a program was built with a functional language and automatically parallelize it better?

Right now I believe there is no such effort to try and execute a program that was built as single threaded program as a multi threaded program automatically.

That is to say, the developer would code a single threaded program. And the compiler would spit out a compiled program that is multi-threaded complete with mutexes and synchronization where needed.

Would these optimizations be visible in task manager in the process thread count, or would it be lower level than that?

解决方案

I think this is unlikely in the near future. And if it does happen, I think it would be more likely at the IL level (assembly rewriting) rather than language level (e.g. something specific to F#/compiler). It's an interesting question, and I expect that some fine minds have been looking at this and will continue to look at this for a while, but in the near-term, I think the focus will be on making it easier for humans to direct the threading/parallelization of programs, rather than just having it all happen as if by magic.

(Language features like F# async workflows, and libraries like the task-parallel library and others, are good examples of near-term progress here; they can do most of the heavy lifting for you, especially when your program is more declarative than imperative, but they still require the programmer to opt-in, do analysis for correctness/meaningfulness, and probably make slight alterations to the structure of the code to make it all work.)

Anyway, that's all speculation; who can say what the future will bring? I look forward to finding out (and hopefully making some of it happen). :)

这篇关于未来有可能F#将优于其他.Net语言吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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