News for hackers. Stuff that matters.
Re:Fortran Package Manager by mraza007 on Thursday April 29, 2021 @04:15AM (#26978597)
Just curious is Fotran Still being used in Newer Projects
Re:Fortran Package Manager by ktpsns on Thursday April 29, 2021 @04:41AM (#26978747)
I 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 ;-)

Re:Fortran Package Manager by certik on Thursday April 29, 2021 @12:40PM (#26983352)
Also with LFortran (https://lfortran.org) being interactive like Julia, our hope is that it will allow to prototype directly in Fortran.

(I am the original author of LFortran.)

Re:Fortran Package Manager by mraza007 on Thursday April 29, 2021 @02:35PM (#26984745)
Thanks for sharing I’ll definitely check it out
Re:Fortran Package Manager by dionhaefner on Thursday April 29, 2021 @04:35AM (#26978708)
Yes. Fortran is used extensively in climate modelling (even newer models).
Re:Fortran Package Manager by oscardssmith on Thursday April 29, 2021 @05:10PM (#26986756)
If 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
Re:Fortran Package Manager by mraza007 on Thursday April 29, 2021 @04:41AM (#26978744)
Really that’s interesting, just curious fortran over other languages
Re:Fortran Package Manager by enriquto on Thursday April 29, 2021 @05:24AM (#26978997)
In 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.
Re:Fortran Package Manager by chriswarbo on Thursday April 29, 2021 @05:14AM (#26978944)
The 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 ;)

Re:Fortran Package Manager by gspr on Thursday April 29, 2021 @07:24AM (#26979748)
But 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).

Re:Fortran Package Manager by ryl00 on Thursday April 29, 2021 @09:02AM (#26980621)
That'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.
Re:Fortran Package Manager by marshallward on Thursday April 29, 2021 @07:09AM (#26979644)
Weather 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.

Re:Fortran Package Manager by saboot on Thursday April 29, 2021 @06:35AM (#26979440)
Yes, 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.

Re:Fortran Package Manager by pjmlp on Thursday April 29, 2021 @07:11AM (#26979655)
Nota only it keeps being used, the latest versions support generics, modules and OOP.

It even got modules before C++.

Re:Fortran Package Manager by haiguise on Thursday April 29, 2021 @07:52AM (#26979969)
Yes, see for example http://mesa.sourceforge.net/index.html which is a stellar evolution code used a lot in astrophysics.
Re:Fortran Package Manager by physicsguy on Thursday April 29, 2021 @06:05AM (#26979265)
Yes, but I think not as much as advocates of it would suggest.
Re:Fortran Package Manager by pjmlp on Thursday April 29, 2021 @07:12AM (#26979668)
Just like SQL, it suffices to rule on one specific use case to keep being used.
Re:Fortran Package Manager by physicsguy on Thursday April 29, 2021 @10:58AM (#26981998)
Yeah 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.

Re:Fortran Package Manager by certik on Thursday April 29, 2021 @11:48PM (#26989666)
I 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.
Re:Fortran Package Manager by ngcc_hk on Thursday April 29, 2021 @07:28AM (#26979784)
SQL 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_back... the only thing look like the old fortran I know is integer I j and do loop. No go to I guess.

Re:Fortran Package Manager by pjmlp on Thursday April 29, 2021 @07:31AM (#26979812)
Apparently you haven't kept up with times.

https://www.manning.com/books/modern-fortran

Re:Fortran Package Manager by shp0ngle on Thursday April 29, 2021 @09:10AM (#26980684)
SciPy and NumPy both use Fortran :P
Re:Fortran Package Manager by Bostonian on Thursday April 29, 2021 @01:52PM (#26984227)
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.

Re:Fortran Package Manager by shp0ngle on Tuesday May 04, 2021 @11:03AM (#27038354)
Well, it uses FORTRAN code, machine-translated into C.

Which is "C code" but not really C code.