现代Fortran与现代C ++有什么优点? [英] What advantages does modern Fortran have over modern C++?

查看:225
本文介绍了现代Fortran与现代C ++有什么优点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Fortran和C ++之间决定科学计算中的应用程序。我不清楚的是,如果Fortran在性能方面仍然有优于其他语言的优势。例如,我相信,由于Fortran强制执行严格的混叠,与C前的C相比,编译器可以做出更好的优化。

I'm trying to decide between Fortran and C++ for an application in scientific computing. It's not clear to me if Fortran still has advantages over other languages when it comes to performance. For example, I believe since Fortran enforces strict aliasing, better optimizations could be made by the compiler when compared to C before C99. I'm unsure of how C++ fits in here.

推荐答案

我看了一下最新Fortran标准中的一些内容,坦白地说,我印象深刻。很多我讨厌的语言20年前已经走了。没有更多的行号和特殊的列(他们可能在地狱中烧)。

I took a look at some of the stuff in the latest Fortran standards, and frankly I'm impressed. A lot of what I hated about the language 20 years ago is gone now. No more line numbers and special columns (may they burn in hell).

Fortran在工程界已经大量使用了50年了。如果你在这些圈子里工作,这给你两个好处。首先,这些人很关心优化。 这意味着Fortran编译器往往有最好的优化器。

Fortran has been heavily used in engineering circles for 50 years now. That gives you two advantages if you work in those circles. First off, these folks care a lot about optimization. That means Fortran compilers tend to have the best optimizers around. The language itself is a lot more optimizable than Cish languages too, thanks to its lack of aliasing.

第二个优点是,Fortran的库支持数字处理简单地不能被打败,因为它的语言本身比Cish语言更优化。 。最好的代码几乎总是良好调试的代码,你不必写

The second advantage is that Fortran's library support for number crunching simply cannot be beat. The best code is nearly always going to be the well-debugged code you don't have to write.

如果你的应用程序不一般来说,科学,工程或数字研究都属于这种情况,那么上述两种情况都不会对你有很大影响,所以你最好在别处寻找。

If your application doesn't fall under scientific, engineering, or number crunching in general, then neither of the above will be a big deal for you, so you may be better off looking elsewhere.

这篇关于现代Fortran与现代C ++有什么优点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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