Skip to content(if available)orjump to list(if available)

Fortran for C Programmers

Fortran for C Programmers

14 comments

·May 17, 2025

Extigy

One of my favourite features of Fortran is in its array implementation. You can index arrays however you like.

Do you like your initial value to be at index 1? Cool. Prefer to index arrays from 0 instead? Sure, go ahead.

How about an array with indexing symmetric around zero?

    double precision :: arr(-100:100)
Beautiful!

SoftTalker

Still used in scientific computing. Perhaps also in some financial settings? Otherwise it’s pretty dead.

pjmlp

That narrow minded approach is one of the reasons OpenCL lost to CUDA, by not taking Fortran support seriously.

I was on a OpenCL Webminar panel, where Khronos folks said exactly the same thing.

Meanwhile, NVidia's investment into PGI compilers really paid itself out.

johnisgood

Real programmers use Fortran! (Reference to that old saying.)

I do not think Fortran is dead though.

almostgotcaught

It's always the people that are chronically online here that comment with most lowbrow stuff. Yes Fortran is so dead that NVIDIA and Intel are both building new compilers for it

https://www.intel.com/content/www/us/en/developer/articles/r...

https://developer.nvidia.com/cuda-fortran

https://flang.llvm.org/docs/

pjmlp

As I point out in a sibling comment, it was definitely one of the reasons OpenCL lost, not being able to dump Fortran HPC workloads into GPUs.

xeonmc

To be fair, in frontendland a framework is considered dead if it hasn’t updated for more than two weeks.

90s_dev

I hate to be superficial, but languages without braces just feel weird to me. I can use them and have even for a paycheck, but... no thanks. Even Lua, one of my favorite languages (if not #1), always feels at least slightly weird when I use it because of do/end.

jmclnx

Very nice, my first professional job was with Fortran IV, but my 19 year old self made lots of mistakes back then :)

Anyway I eventually ended up with c. Recently I started playing with gfortran, but so much have leaked out of me I have been having a tough time of it. I expect this will help me a lot!

Edit: No functions ? OK, noticed it is handled under Subprograms. Seems there have been many changes.

readthenotes1

I haven't used a modern Fortran, but for older versions , the biggest surprise was the lack of reentrance.

adrian_b

Indeed, reentrance and recursivity and the use of stacks and/or heaps for dynamic memory allocation have appeared in programming languages that have descendants still used today only in 1960, in ALGOL 60 and LISP I. These features have become ubiquitous in the later programming languages, all of which have been at least partially inspired by ALGOL or LISP.

Fortran is the only surviving programming language older than that (first specification in 1954 and first implementation in 1956). Cobol is the only surviving programming language equally old with LISP and ALGOL, so that it has not been influenced by either of them. Thus now Fortran and Cobol are the only surviving programming languages from the era when only static memory allocation was used in programs, though their later versions have added most modern programming language features.

pjmlp

Depending on where you place them, there are still some folks having to deal with NEWP, PL/I and RPG, which are of similar vintage.