You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-5Lines changed: 22 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# fortran-src
2
2

3
3
4
-
Provides lexing/parsing and early static analyses of Fortran code. The following
4
+
fortran-src is an open-source Haskell library and command-line application for the lexing, parsing, and static analysis of Fortran source code. It provides an interface to build other tools, e.g., for static analysis, automated refactoring, verification, and compilation. The following
5
5
Fortran standards are covered:
6
6
7
7
* FORTRAN 66 (ANSI X3.9-1966)
@@ -13,12 +13,29 @@ Fortran standards are covered:
13
13
Parsing is configurable, and you can select the Fortran standard to target,
14
14
including special extended modes for nonstandard FORTRAN 77.
15
15
16
-
Includes data flow and basic block analysis, a renamer, and type analysis.
16
+
Various static analyses are provided including:
17
+
18
+
* Control-flow analysis (building a super graph) (Language.Fortran.Analysis.BBlocks);
19
+
* General data flow analyses (Language.Fortran.Analysis.DataFlow), including:
20
+
* Reaching definitions;
21
+
* Def-use/use-def;
22
+
* Constant evaluation;
23
+
* Constant propagation;
24
+
* Live variable analysis;
25
+
* Induction variable analysis.
26
+
* Type analysis (Language.Fortran.Analysis.Types);
This package primarily exports a Haskell library, but also builds an executable
19
-
that can be used for testing and debugging. For example usage, see the
20
-
[CamFort](https://github.com/camfort/camfort) project, which uses fortran-src as
21
-
its front end.
30
+
that can be used for testing and debugging.
31
+
32
+
The library is the basis of the [CamFort verification tool](https://github.com/camfort/camfort).
33
+
34
+
## Statement of Need
35
+
36
+
Fortran remains a popular language in the international scientific community. It is not only a mainstay of legacy software, but is also used to write new software. Fortran is particularly notable for its prevalence in earth sciences, e.g., for implementing climate models that inform international policy decisions. In 2024, Fortran re-entered the Top 10 programming languages in the TIOBE Index, showing its enduring popularity. The continued use of Fortran, particularly in scientific contexts, was the catalyst for this software package. A challenge in writing language tools for Fortran is its long history. There have been several major language standards (FORTRAN I-IV, FORTRAN 66 and 77, Fortran 90, 95, 2003, 2008, etc.) Newer standards often deprecate features that are known to be a ready source of errors, or difficult to specify or understand. However, compilers often support an amalgam of features across standards, enabling developers to use deprecated features and mix language standards. This complicates the development of new tools for manipulating Fortran source code; one must tame the weight of decades of language evolution.
37
+
38
+
Our package, `fortran-src`, provides an open-source unified core for statically analysing Fortran code across language standards, with a focus on legacy code over cutting-edge modern Fortran. It is both a standalone tool and a library, providing a suite of standard static analyses as a basis for further programming language tools and systems.
22
39
23
40
## Obtaining
24
41
We provide [prebuilt binaries](https://github.com/camfort/fortran-src/releases)
0 commit comments