8 ms·
Just curious is Fotran Still being used in Newer Projects
by mraza007 5y ago
Just curious is Fotran Still being used in Newer Projects
- dionhaefner 5y agoYes. Fortran is used extensively in climate modelling (even newer models).
- mraza007 5y agoReally that’s interesting, just curious fortran over other languages
- chriswarbo 5y agoThe intuition is similar to "why C over other languages?": speed. Many programmers treat C as the fastest/lowest-level cross-platform language, but Fortran sometimes has a slight edge (especially with specialised compilers, e.g. I remember Intel's producing very fast binaries). Although it's general-purpose, Fortran skews heavily towards numerical calculations, which is probably why it's not used much outside science and engineering (e.g. most Web stuff is 'string processing' rather than numerical). Fortran was used to write highly optimised numerical libraries like BLAS, which are so widely used and performance-critical that it pretty much cemented Fortran's use; although (a) such libraries can be used by other languages, and (b) they've become so optimised over the decades that they're essentially pure machine-code these days ;)
- gspr 5y agoBut interfacing with Fortran from other languages is easy (well, barring some compiler assumptions that everyone seems to be making anyway). Why not leverage the general purpose strength of languages like Rust or C++ or Python (or even C), while still retaining access to the vast trove of numerical Fortran libraries? (Not that I'm judging, people should use whatever language they prefer).
- ryl00 5y agoThat's what tends to happen, at least in the code I've worked on. C/C++ for the bits that need to "talk" to the OS, python/perl/bash for scripting purposes, and Fortran for the number-crunching core.
- enriquto 5y agoIn many numerical math, you do not need fancy data structures. Just loops over huge arrays of floating point numbers, performing a simple operation inside the loop. Said operation may have a small bit of complexity inside, thus it cannot be "vectorized" readily. Implementing this kind of algorithms is either cumbersome or extremely slow in Python, but in Fortran or C it is straightforward and fast.
- oscardssmith 5y agoIf you're interested in climate modeling, you should really check out Clima.jl. it's an international collaboration on building a next gen climate model in Julia that uses some cool tricks like heavy usage of surrogate models that would be really hard to do in Fortran
- ktpsns 5y agoI find the trinity of Matlab, Fortran and Julia quite interesting. They all have a similar syntax and I guess Julia can grab quite some people from the other two ecosystems. Clasically, scientists used Matlab for prototyping and Fortran for high performance implementations. With Julia, things might change. However, in science, changes happen slowly and there are still tons of codes (and also new codes) written in Fortran. If given a modern tooling, Fortran is not too bad, thought. It is in some respect a "no bullshit" language which doesn't allow you to spend your time on infrastructure, architecture or meta programming, because it is virtually impossible to do these things within Fortran ;-)
- physicsguy 5y agoYes, but I think not as much as advocates of it would suggest.
- pjmlp 5y agoJust like SQL, it suffices to rule on one specific use case to keep being used.
- ngcc_hk 5y agoSQL is based on set theory and there is a reason for its existence. FORTRAN is based on legacy. Still remember the I j k and 80 columns things ... To be honest reading https://github.com/fortran-lang/fpm/blob/master/src/fpm_backend.f90 https://github.com/fortran-lang/fpm/blob/master/src/fpm_back... the only thing look like the old fortran I know is integer I j and do loop. No go to I guess.
- pjmlp 5y agoApparently you haven't kept up with times. https://www.manning.com/books/modern-fortran https://www.manning.com/books/modern-fortran
- physicsguy 5y agoYeah exactly - it's great for numerical computing. I get a bit annoyed by Fortran advocates complaining about people using C++/Python instead of it, when there aren't libraries for doing really basic things. I think Fpm is a really good step in the right direction though.
- certik 5y agoI am a Fortran advocate, but I don't complain that people use C++ or Python. I use C++ and Python myself, both are great languages. I agree Fortran is missing the library ecosystem, and that is why we started fpm. It takes years to fix this problem.
- saboot 5y agoYes, a nuclear modelling software called MCNP is widely used and written entirely in fortran. Some of its source code can date back to the dawn of computing in the 1940s! Edit to say I missed your newer project specification; MCNP is still under very active development and frequent updates, if that counts.
- marshallward 5y agoWeather forecasting in most countries are based on numerical models written in Fortran. Despite what you may have heard, the language has evolved over the decades and has most of the features one would expect from a modern language.
- pjmlp 5y agoNota only it keeps being used, the latest versions support generics, modules and OOP. It even got modules before C++.
- haiguise 5y agoYes, see for example http://mesa.sourceforge.net/index.html http://mesa.sourceforge.net/index.html which is a stellar evolution code used a lot in astrophysics.
- shp0ngle 5y agoSciPy and NumPy both use Fortran :P
- Bostonian 5y agohttps://www.quora.com/Which-python-packages-besides-Numpy-use-fortran https://www.quora.com/Which-python-packages-besides-Numpy-us... Does NumPy use Fortran? NumPy does not use Fortran. It provides an interface to BLAS (Basic Linear Algebra Subprograms) and Lapack (Linear Algebra Package) for which the reference implementation is written in Fortran.
- shp0ngle 5y agoWell, it uses FORTRAN code, machine-translated into C. Which is "C code" but not really C code.