|
VIntage Fortran (VIF) is my experimental compiler for much vintage Fortran source code. VIF does not emulate the Fortran machine model as do other compilers using C as an intermediate language. VIF cannot compile little-used archaic statements that have no straightforward C equivalent. This is a trade-off between completeness and object code efficiency. Furthermore, VIF has reserved words and spaces in statements are significant, unlike old Fortran. Despite these restrictions, VIF compiles most vintage code. I like to think that at the time, programmers were already keen on coding in a legible and portable way, avoiding Fortran's idiosyncrasies.
In case you need to compile code with statements that have no C equivalent, specifically ENTRY, alternate RETURN, or some EQUIVALENCE statements, you will want to use production-quality FOSS solutions like f2c or GNU fortran. Here you can download the current VIF source distribution.
A goal for VIF was to make available high precision data types REAL*32 and COMPLEX*64, considering that most multi-precision applications require twenty up to sixty digits. VIF is probably the only vintage Fortran implementation offering these types.
A caveat when compiling vintage code is that in the old days, different machines had different representations of types, which are not always compatible with the IEEE standard common today. For instance, a REAL value occupied a 64-bit word in CRAY-1 FORTRAN, a 36-bit word in PDP-10 FORTRAN and a 32-bit word in IBM FORTRAN. Portable programs from the time refer to routines like D1MACH to inquire for limits of a type representation. For example, next trivial code snippet x1mach.f prints machine parameters for REAL*32 analogous to the D1MACH function:
real*32 x1mach do k = 1, 5 print *, k, x1mach(k) end do end
VIF can immediately execute a program upon successful compilation, like WATFOR or WATFIV, or a JCL CLG-type procedure under MVS or z/OS. We can execute above snippet with VIF like so, specifying -g:
$ vif -g x1mach.f ** main ** end of compilation 1 ** linker ** object size 372280 bytes ** statistics ** 1 subprogram, no errors, no warnings ** execution ** 1 3.3621031431120935062626778173217526025980793448464712401088272298088533e-4932 2 1.1897314953572317650857593266280071307634446870965102374726748212332616e+4932 3 1.1319598848533390459386399113609739725853163997673922736978268612419382e-0072 4 2.2639197697066780918772798227219479451706327995347845473956537224838764e-0072 5 3.0102999566398119521373889472449302676818988146210854131042746112710819e-0001
Below is a list with the cross-referenced source files of the current version. VIF builds a library with (selected) FOSS subprograms from BLAS, LINPACK, SLATEC etcetera. These FOSS vintage library subprograms are not indexed here.
File | Synopsis | Lines | |
1 | assign.c | Compile assignment statements. | 180 |
2 | autosave.c | Compile storage classes, SAVE statement. | 181 |
3 | banner.c | Banner for listing files. | 169 |
4 | call.c | Compile subprogram calls. | 167 |
5 | code.c | Routines to emit C object code. | 468 |
6 | common.c | Compiler COMMON statements. | 146 |
7 | data.c | Compile DATA statements. | 336 |
8 | decls.c | Compile declarations. | 309 |
9 | diag.c | Diagnostic routines. | 100 |
10 | dimension.c | Compile DIMENSION statements. | 119 |
11 | emit.c | Emit C object code. | 205 |
12 | equivalence.c | Compile EQUIVALENCE statements. | 233 |
13 | expr.c | Compile Fortran expressions. | 603 |
14 | factor.c | Compile Fortran expression factors. | 315 |
15 | fold.c | Constant folder. | 558 |
16 | format.c | Compile FORMAT statements. | 438 |
17 | fpp.c | Fortran preprocessor. | 155 |
18 | goto.c | Compile GOTO statements. | 137 |
19 | implicit.c | Implicit declaration routines. | 185 |
20 | intrinsic.c | Compile intrinsic functions. | 630 |
21 | macro.c | Compile function statements. | 179 |
22 | modules.c | Compile BLOCK DATA, FUNCTION, PROGRAM and SUBROUTINE. | 602 |
23 | parameter.c | Compile PARAMETER statement. | 75 |
24 | renum.c | Vintage Fortran statement renumbering tool. | 574 |
25 | rts.c | Runtime support. | 295 |
26 | rts-io.c | Runtime support for Fortran IO. | 989 |
27 | rts-jit.c | Just-in-time compilation of FORMAT strings. | 390 |
28 | rts-lapack.c | Runtime support for LAPACK subprograms. | 805 |
29 | rts-math.c | Runtime support for math operations. | 468 |
30 | rts-real16.c | Runtime support for REAL*16 and COMPLEX*32. | 132 |
31 | rts-real32.c | Runtime support for REAL*32 and COMPLEX*64. | 2436 |
32 | rts-slatec.c | Runtime support for SLATEC subprograms. | 384 |
33 | rts-wapr.c | Runtime support implementing the W-function. | 359 |
34 | scan.c | Fortran scanner. | 693 |
35 | slice.c | Compile array slices. | 203 |
36 | statements.c | Compile statements. | 652 |
37 | table.c | Symbol table routines. | 310 |
38 | transput.c | Compile Fortran IO. | 954 |
39 | type.c | Type routines. | 342 |
40 | vif.c | VIF driver. | 662 |
File | Synopsis | Lines | |
1 | fortran-ii.f | FORTRAN II library functions for VIF. | 44 |
2 | fortran-iv.f | FORTRAN IV intrinsic library functions for VIF. | 450 |
3 | ml.f | Machine Learning subprograms for VIF. | 210 |
File | Synopsis | Lines | |
1 | rts-real32.h | Runtime support for REAL*32 and COMPLEX*64. | 321 |
2 | vif.h | VIF include file. | 832 |
The number of source lines in this version is 18291.
|
||
I wrote a simple compiler that translates most Fortran IV/66/77 source code … |
|
||
Recently, Algol68C Release 1.3039 was made public for download … |
© 2002-2024 J.M. van der Veer (jmvdveer@xs4all.nl)
|