Modern language with the advantages of FORTRAN?

后端 未结 12 1975
灰色年华
灰色年华 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:18

    I'm surprised that the consensus here is for modern Fortran, and I grudgingly agree.

    Whatever its failings, Fortran is the only language out there being designed explicitly for scientific programming. Scientific programming is both more subtle (per line) and less complicated (in structure) than, say, a web server, and it just needs different tools. Garbage collection, for instance, is almost never useful for solving large 2d/3d PDEs where your primary data structures are fixed.

    Any programming language that doesn't even have multi-d arrays as first-class objects can be dismissed immediately for scientific programming. and that's all of the C-based languages. Any programming language which is inherently god-awful slow -- Java, I'm looking at you -- can be dismissed immediately. Any programming language which is proprietary and requires thousands of dollars of licensing fees -- Matlab -- can be dismissed immediately.

    Python and related languages are good for prototyping, and plotting is easy, and once you've got things working can write the numerical kernels in compiled languages for speed; but it again suffers from the lack of real arrays (Numpy is good, but not great) and it is s..l..o..w.

    By the way -- don't ever by the Numerical Recipes books. They're crap, the algorithms they pitch are of date, and the code ranges from poor to wrong. Take a real numerical algorithms course - there's good ones on line - or buy a real numerical algorithms book -- and for the love of God, don't type in code from a book to do linear algebra or whatever; use the zillions of real, professional quality libraries out there.

提交回复
热议问题