Modern language with the advantages of FORTRAN?

后端 未结 12 2002
灰色年华
灰色年华 2021-02-05 19:04

I\'ve been working with a lot of FORTRAN 77 lately, and though I had reservations at first, I now see some great qualities of the language. It is:

  • Simple to learn
12条回答
  •  日久生厌
    2021-02-05 19:19

    I think Fortran 95 should be your choice it looks more modern and extends Fortran 77 quite significantly. The Fortran 2003 standard is not completely supported by most compilers. The great advantage of Fortran is that there is an optimized subroutine for every mathematical problem (such as root finding, matrix multiplication, eigenvalue problems, etc.). Other people mentioned legacy libraries and lapack is just one very powerful example. A major disadvantage of Fortran is that nobody is using it in the real world.

    The best book around is is my opinion "Fortran 90/95 for Scientists and Engineers".

    Of course all other suggestions are valid, but matlab is not free while Fortran is.

    Python is free and has support for a lot of scientific applications through extra packages such as Numpy and Scipy. Python is however rather slow when it comes to numerical performance. It's probably a good option for small projects that don't require a lot of computational power. The syntax is very easy to understand.

    C is of course also a free option and has a lot of (constantly updated) scientific libraries available. However, when it comes to readability it cannot beat Fortran. Fortran is well set-up to work with vectors and arrays.

    C++ is a superset of C so it's definitely also a possible choice. However, it is a language that might be to complex for the problems that you're looking at. The number of scientific C++ libraries is rather limited. There are some around but they cannot beat the Fortran versions (or are just wrappers of those). It's probably a very good option for very big projects but some very big programs that run on the world's fastest computers are written in Fortran. C++ is definitely worth learning since it is used for a broad number of real world applications.

    There are of course other languages or tools but I think these are the most commonly used across scientific disciplines.

提交回复
热议问题