Side-by-side, interactive cheatsheets for Fortran programmers
comparing Fortran to other languages. Every example runs live in your browser — no
setup, no installation.
Choose your own path by reordering languages
The other ubiquitous systems language — but C is row-major where Fortran is column-major, and passes by value where Fortran passes by reference, two classic sources of real interop bugs between them.
intent(out) parameter needs an explicit pointer and & in Cpow() from <math.h> is the only way, and ^ means bitwise XORBuilt for exact money math, not floating-point science. COBOL's PIC 9V9 fixed-point fields store decimal digits exactly — the opposite tradeoff from Fortran's binary REAL/DOUBLE PRECISION, which is precisely why COBOL, not Fortran, runs the world's bank ledgers.
PIC 9V9 fixed-point decimal fields store money exactly — no IEEE 754 rounding error the way Fortran's REAL always carriesprogram ... end program blockINTENT system, just shared global WORKING-STORAGE fieldsLOGICAL type — there is no boolean type otherwiseMOVE, not =, is the assignment verb, and CALL can only invoke a genuine subprogram, never a paragraphA close cousin from the same structured-programming era. Pascal's var/const parameter modes map almost directly onto Fortran's intent(inout)/intent(in) — but Pascal has no whole-array arithmetic at all, unlike Fortran.
var and const parameters mirror Fortran's intent(inout)/intent(in) almost exactly — a rare direct correspondenceprices := prices * 0.9 needs an explicit for loop, unlike Fortran's native array arithmetic** exponentiation operator — Power() from the Math unit is the only way to raise to a powerrepeat...until is a post-tested loop with no direct Fortran equivalentBuilt for exactly Fortran's audience — high-performance numerical computing — with Python-like syntax and an intent-like argument model.
mut parameters map onto Fortran's intent(inout) almost directly — borrowed (read-only) is the default, just like intent(in)SIMD[DType, width] vector types are an explicit, type-level take on the same hardware vectorization Fortran's compiler infers automaticallyraise/raises gives Mojo a genuine catchable-error mechanism Fortran has never hadBuilt explicitly to replace Fortran in scientific computing. Julia arrays are column-major for BLAS/LAPACK compatibility, just like Fortran — but * means real matrix multiplication in Julia, not the elementwise operation it always is in Fortran.
* between two matrices is genuine linear-algebra multiplication in Julia; Fortran's * is always elementwise, with matmul() for the real thingArray programming taken to its extreme. Where Fortran writes a loop over each element, APL has no loop at all — 2×1 2 3 4 5 doubles a whole array in one glyph, and reduction operators replace both sum() and hand-written accumulator loops alike.
2×numbers scales a whole array with no do loop, more radical than even Fortran's own native array arithmetic2×3+4 is 14, not 10, a rule Fortran's ordinary math notation shares nothing with+/, ×/, ⌈/) replace Fortran's sum(), product loops, and maxval() all with one composable operator(+/÷≢) is the average function, something Fortran has no syntax to expressThe other vector-native language — but where Fortran demands exact shape conformance for elementwise arithmetic, R silently recycles mismatched-length vectors to fit.
numbers * 2 needs no loop in either languageLOGICAL equivalent — a variable's type is just whatever value it currently holdsNA is a first-class missing-value marker with no Fortran equivalent — the closest approximation is IEEE NaN