
Not Your Father’s FORTRAN - pmarin
http://hackaday.com/2015/10/26/this-is-not-your-fathers-fortran/
======
srott
I've liked more this article [https://bitbucket.org/eric_t/modern-
fortran/wiki/Home](https://bitbucket.org/eric_t/modern-fortran/wiki/Home)

------
musgravepeter
I first learned FORTRAN in high school, where we used optical sense cards to
create code. The teacher took them each night to the board office and brought
back our output for the next class. If you had ten days for an assignment, you
had ten chances to compile/run. The next year the school got a Commodore PET
and I had a chance to use that.

I still code - and have just finished converting some FORTRAN astrophysics
simulation code from 1974 into C# for a Unity project.

~~~
baldfat
> converting some FORTRAN astrophysics simulation code from 1974 into C# for a
> Unity project

But FORTRAN is SOOOO fast. In R there is still plenty of FORTRAN code running.
I still would want the code running FORTRAN and try to figure a way for it to
run as is.

I understand the need for it to run in Unity but just I hate the idea of all
FORTRAN code needs to be converted.

~~~
musgravepeter
Yeah - I hear you. Converting 1000 lines was a BIG drag.

I did experiment with native and f2c versions - but when targeting for mobile
it meant a bunch of Android and iOS packaging that was kinda irritating.

The specific code I targeted (3 body evolution using KS regularization, the
triple code at
[http://www.ast.cam.ac.uk/~sverre/web/pages/nbody.htm](http://www.ast.cam.ac.uk/~sverre/web/pages/nbody.htm))
was modest and not CPU intensive.

I'd love to do the same for NBODY6 and that would have to be native.

Look for an update to my ThreeBody app with this code (and a cool gallery of
new 3B solutions) sometime late in the year.

~~~
baldfat
So I am hoping you read the SciFi book the Three Body Problem?

------
moomin
Pedantic point: Grace Hopper's work predated FORTRAN by several years:
[https://en.wikipedia.org/wiki/FLOW-MATIC](https://en.wikipedia.org/wiki/FLOW-
MATIC).

FORTRAN is the first general purpose computer language still in use, but
that's not the same thing as being the first.

------
loginusername
"John W. Backus suggested to IBM a language to replace assembly language."

And today, in a world with far more CPU homogeneity, we have an endless stream
of nerds suggesting to HN languages to "replace" C.

I am never sure what "replace" means when used in this context. I'm still
using assembly language; other languages cannot match it. In the same way,
FORTRAN is still being used. Perhaps "supplement" should be substituted for
"replace".

Enduring fact: "Your Father's" languages are more performant than the new ones
you hold in high regard.

Because performance will always be important to some people, I doubt these old
languages will ever disappear from use.

Unless someone can construct a compiler that accepts a different "language"
and produces more performant object code, these languages will never be
"replaced".

~~~
lucozade
> I am never sure what "replace" means when used in this context

It means the use of assembly is replaced with the use of Fortran. At which it
was very successful in scientific computing.

I don't believe it was ever meant to mean exterminate. Bear in mind that all
programming was done in assembly or machine code prior to the introduction of
Fortran. Since then a relatively tiny (though important) proportion of
programmers program in assembly _. That was the intent and it worked
swimmingly.

_ And only masochists program in machine code.

------
leephillips
One reason Fortran is still so performant is that processor manufacturers
devote a lot of resources to making sure that there are highly optimized
compilers for their latest architectures. This is partly so that they will
look good in benchmarks, but the scientific computing community benefits.

[http://arstechnica.com/science/2014/05/scientific-
computings...](http://arstechnica.com/science/2014/05/scientific-computings-
future-can-any-coding-language-top-a-1950s-behemoth/1/)

------
avmich
A language efficiency is about how convenient it is to use for humans to
express and absorb ideas about solving a problem.

A lot goes into that. It starts with programmers training to look into problem
some way, which allows to formalize the task - as in conversion of a physical
problem to a mathematical model.

Then it proceeds to offer good abstractions to use for problem statement.
Those abstractions should be convenient - a reasonable set, a generic nature,
a good correspondence to "the real world".

Then composability of those abstractions should allow more convenient canned
solutions to common subproblems - which are libraries.

Last two parts require to carefully select the language syntax.

It turns out it's tricky to have a language which is good enough for every
possible problem to solve. It's also hard to have a good set of composability
features - usually you have one set of several possible, and you don't have at
the same time all possible mechanisms to combine and use primitives.

I'm not sure Fortran compares well with existing offerings. Literal "formula
translation" is a basis of several language philosophies (APL comes to mind),
and in non-numeric applications there are other issues.

~~~
AnimalMuppet
> A language efficiency is about how convenient it is to use for humans to
> express and absorb ideas about solving a problem.

That's one kind of efficiency. There are others. One kind that often comes up
Fortran is "efficiency of using the CPU". Fortran is pretty good at that kind
of efficiency. For people using months of supercomputer time, that kind of
efficiency is pretty important.

~~~
avmich
> One kind that often comes up Fortran is "efficiency of using the CPU".

I think that's rather efficiency of implementation of the language's compiler.

Yes, given particular hardware properties, it might be beneficial to have
language enforcing programmers to use mechanisms, which are easier (for
translator) to convert to hardware instructions.

------
ggchappell
<ahem> My _mother_ was a FORTRAN programmer in the early 1960s. :-P

