Fortran's source code

Can I see the source code of the Fortran language? I would like to see the code.

Welcome to the forum!

Could you explain your question? Fortran is a programming language and as such compilers have been implemented to turn a piece of Fortran code into a working program. There is no source code for the Fortran language. If you want to see Fortran code, then there are plenty examples in this forum.

Links to the source code of the gfortran compiler are here, and you can find the source for other compilers online. If you are new to Fortran (or some other language) I would not recommend trying to learn about it by examining the source code of a compiler or interpreter.

How do I download it?

We should not forget lfortran either:

Whether you can read the sources will depend on your OS. Either get the compressed *.gz and uncompress or install git (making sure it is in your search $PATH and run:

  $ git clone <repo_url>

Git works on Windows from Powershell or cmd.exe window.

1 Like

In contrast to other Languages (like Python) there is no “reference” implementation of Fortran.

Yes, we could say the source of the Fortran language is the Fortran standard. See that link if you want to read that source:

Fortran 2018 Standard Interpretation Document J3/18-007r1 F2018, specification of the base Fortran 2018 language

And “Fortran has over a dozen open source and commercial compilers” as said here:

1 Like