Live data from Hacker News

How Thou Canst Maketh a Fine Program in Fortran

digitalocean.com

1–10 of 38 posts

Re: How Thou Canst Maketh a Fine Program in Fortran

#2
I'm thoroughly surprised to see that Fortran is still being updated (with an upgrade still in the works for next year apperantly). I had no idea.

I'll give it a shot as it seems interesting to at least have worked in it a bit, but I do wonder, where is Fortran used these days?

A quick glance at Tiobe[1] shows that it scored a bit higher than Haskell, Scala and Kotlin. Can anyone explain me why?

[1]: https://www.tiobe.com/tiobe-index/

Re: How Thou Canst Maketh a Fine Program in Fortran

#3
post #2

I'm thoroughly surprised to see that Fortran is still being updated (with an upgrade still in the works for next year apperantly). I had no idea. I'll give it a shot as it seems interesting to at least have worked in it a bit, but I do wonder, where is Fortran used these days? A quick glance at Tiobe[1] shows that it scored a bit higher than Haskell, Scala and Kotlin. Can anyone explain me why? [1]: https://www.tiobe…

FORTRAN is deeply ingrained in engineering culture. A lot of legacy (and some new development) is written in it. Though, this is slowly shifting with the prevalence of MATLAB in universities.

Re: How Thou Canst Maketh a Fine Program in Fortran

#4
Needed more https://en.wikipedia.org/wiki/Long_s

Turns

In troth, the Fortran programming language is well suited for those persons who are scientific and who engineer. Named so for the phrase “Formula Translation,” it is a language exquisite for programming machines.

into

In troth, the Fortran programming language is well suited for thoſe perſons who are scientific and who engineer. Named so for the phraſe “Formula Tranſlation,” it is a language exquiſite for programming machines.

Way better.

Re: How Thou Canst Maketh a Fine Program in Fortran

#5
post #2

I'm thoroughly surprised to see that Fortran is still being updated (with an upgrade still in the works for next year apperantly). I had no idea. I'll give it a shot as it seems interesting to at least have worked in it a bit, but I do wonder, where is Fortran used these days? A quick glance at Tiobe[1] shows that it scored a bit higher than Haskell, Scala and Kotlin. Can anyone explain me why? [1]: https://www.tiobe…

> I do wonder, where is Fortran used these days?

Not that I actually know, but what I hear is that it's still used for number crunching, and it's actually faster than C in some respects unless you make heavy use of C99 features. That is, very generally it doesn't support a few features of C that makes it easier to optimize some constructs, nut that C now has keywords which can signal the compiler appropriately so the same optimizations can now happen in C.[1]

I just looked that up from memory of prior discussions here though, so if someone with real experience chimes in, take them over me.

1: https://stackoverflow.com/questions/146159/is-fortran-easier...

Re: How Thou Canst Maketh a Fine Program in Fortran

#6
post #2

I'm thoroughly surprised to see that Fortran is still being updated (with an upgrade still in the works for next year apperantly). I had no idea. I'll give it a shot as it seems interesting to at least have worked in it a bit, but I do wonder, where is Fortran used these days? A quick glance at Tiobe[1] shows that it scored a bit higher than Haskell, Scala and Kotlin. Can anyone explain me why? [1]: https://www.tiobe…

Lots of optimized libraries used in scientific computing are done in Fortran with the language itself making some optimizations easier just because it's more conservative. All the HPC vendors selling supercomputers and such have Fortran on them. The language itself has been updated periodically, too. Add a legacy effect of people just using it for a long time and you get a language that isn't going away.

Re: How Thou Canst Maketh a Fine Program in Fortran

#9
post #2

I'm thoroughly surprised to see that Fortran is still being updated (with an upgrade still in the works for next year apperantly). I had no idea. I'll give it a shot as it seems interesting to at least have worked in it a bit, but I do wonder, where is Fortran used these days? A quick glance at Tiobe[1] shows that it scored a bit higher than Haskell, Scala and Kotlin. Can anyone explain me why? [1]: https://www.tiobe…

I work at NASA Goddard Space Flight Center and I can tell you that Fortran is indispensable. It is the primary language used in numerical simulations, such as climate, stellar dynamics, cosmology, etc. This is partly due to inertia; scientists don't like to spend time learning new programming languages. Also, the various Fortran libraries used in this work are thoroughly understood and no one wants to change them or port them. Most of the code here is in Fortran 95, which may look odd, but has all the things a reasonable "Structured Programming" language should have. Later versions added some Object Oriented features but I don't think they've caught on much around here.

I don't personally work in Fortran, but I'm not repelled by the idea. The thing that would attract me to it, as a former computer graphics programmer, is the decent support for arrays. C99 is better than C89, but it's not where Fortran is. Sure, C++ can do it with classes but, goodness me, that is one complex language. One pays a hefty price if all one wants is decent array handling. And speaking of complex, Fortran has had complex numbers for decades. I've never used complex numbers in C99, so I don't know how they compare. I'm hearing murmurs of moving some things to Rust, when it matures, but I think the jury is still out on that.

I always like to include the quote below in discussions like this:

“I don’t know what the programming language of the year 2000 will look like, but I know it will be called FORTRAN.” – Charles Anthony Richard Hoare, circa 1982

Re: How Thou Canst Maketh a Fine Program in Fortran

#10
post #2

I'm thoroughly surprised to see that Fortran is still being updated (with an upgrade still in the works for next year apperantly). I had no idea. I'll give it a shot as it seems interesting to at least have worked in it a bit, but I do wonder, where is Fortran used these days? A quick glance at Tiobe[1] shows that it scored a bit higher than Haskell, Scala and Kotlin. Can anyone explain me why? [1]: https://www.tiobe…

In general the performance of C vs Fortran is a moot point. However, for numerical performance, Fortran has (at least) two major advantages that I can see, both of which are about usability:

- In-built support for multi-dimensional arrays and operations on arrays. This makes it so much easier to work with numerical datasets than in C.

- BLAS and LAPACK are the two foremost packages used for linear algebra. They're written in Fortran, so it's just a bit easier to use them, rather than their C APIs. I've had unpleasant experiences debugging things across the boundary between C and Fortran.

Post reply on HN