Fortran in Fortran (FORTRAN I transcompiler in Fortran 2008)
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 17 commits ahead of bbohrer:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE
Makefile
README.md
average.f
compiler.f90
reverse.f
runtime.c
runtime.h
test.f

README.md

fif

Fortran in Fortran: A FORTRAN I transpiler, written in Fortran 2008. Translates FORTRAN I code to ANSI C, then compiles it. Please see the lecture on nostalgic programming in Fortran for further information. The details of the language are specified in the Programmer’s Reference Manual from 1956.

Build

Use BSD make to build the transpiler:

$ make

Or run GNU Fortran directly:

$ gfortran7 -Wl,-rpath=/usr/local/lib/gcc7/ -o compiler compiler.f90

If you prefer Flang, run:

$ flang -fno-backslash -o compiler compiler.f90

Compile

Compile your FORTRAN I code with:

$ ./compiler <input> <output>

For instance:

$ ./compiler average.f average

This outputs the translated C code to average.c and runs the C compiler to build it.

Copyright

Copyright © 2018, Brandon Bohrer. Licenced under MIT.