SlimeFORTRAN — FORTRAN → modern FORTRAN bit-exact transpiler
Deterministic modernization of FORTRAN 77 assets running at NASA, ECMWF, JAEA, and university labs — to modern FORTRAN.
Generational refresh of HPC numerical code, executed not as a human-review-gated refactor but with bit-exact correctness, audit chains, and tamper detection. Shares S2-S5 / S7-S9 with SlimeCOBOL, SlimeMUMPS, SlimePL/I, and SlimeRPG — only S1 (FORTRAN FST) and S6 (modern FORTRAN emitter) are language-specific.
- 5-dialect fingerprint detection — F77 fixed (col 1-72) / F90 fixed / F90 free / IBM VS / DEC/VAX
- S9 bench: all 5 axes 100% (25/25) + S6 byte-exact regression 25/25 PASS + gfortran compile 25/25 PASS(measured 2026-05-08)
- HPC F77 essentials — SUBROUTINE / typed FUNCTION / RETURN / CALL / COMMON blocks / SAVE / EXTERNAL / function-as-argument / PARAMETER
- Full file I/O —
OPEN(UNIT=N, FILE=..., STATUS=...)+WRITE / REWIND / READ / CLOSE+WRITE(unit, label)form + numbered FORMAT statements (`100 FORMAT('X=', I5, F8.2)`) - Full F66/F77 obsolescent compatibility — arithmetic IF (
IF (X) 10, 20, 30), computed GOTO (GOTO (10,20,30) X), labeled CONTINUE auto-restructured todo/end do, automaticIMPLICIT NONEinjection
Implements the bit-exact + instant tamper detection + 100% gfortran compile guarantee required by HPC. Auditors can re-verify "no information lost in conversion" after the fact — the world's first deterministic FORTRAN 77 → modern FORTRAN transpiler (per our research).
Headline metrics (measured 2026-05-08)
all 25 samples emit F2018 that compiles clean and runs as expected
actual/.f90 and expected/.f90 match exactly
dialect / token / gfortran / mutation / determinism — all PASS
core syntax → SUBROUTINE/FUNCTION → CHARACTER/DO WHILE/2D arrays → COMMON/SAVE/EXTERNAL → file I/O / arith IF / computed GOTO
F77 fixed / F90 fixed / F90 free / IBM VS / DEC VAX
DO/CONTINUE → do/end do, auto IMPLICIT NONE, identifiers lower-cased, .GT./.LT./.AND. → .gt./.lt./.and.
Market context — the world's FORTRAN legacy
| Weather / geophysics | ECMWF / Japan Meteorological Agency / NOAA / NCAR numerical weather prediction (IFS / GFS / WRF), earthquake and tsunami simulation. Cores written in 1980s-90s F77 and still maintained. |
|---|---|
| Nuclear / particle physics | JAEA / Sandia / Argonne transport, neutron diffusion, Monte Carlo. F77 + extensions carry 30+ years of validated heritage. |
| Computational chemistry | Gaussian / GAMESS / NWChem / VASP atomic / molecular codes. F77/90 mix on HPC clusters with OpenMP/MPI parallelism. |
| Climate / ocean | POP / CCSM / MOM / NEMO ocean general-circulation models, CESM climate model. Long-term climate prediction at research labs. |
| Market scale | Estimated tens of billions of LOC worldwide; running at 60%+ of TOP500 HPC sites. Competitors (NAG Fortran Modernization Tool / Plusoft / open-source fixed2free) charge per-LOC at multi-million-USD scale, or do not preserve semantics. SlimeFORTRAN charges only the WASM converter tool — generated modern FORTRAN is perpetually free to deploy. |
Supported features (Phase 1-5)
| Control flow | IF/THEN/ELSE/ELSEIF/ENDIF / DO label V=a,b[,step] + label CONTINUE → structured do/end do / DO WHILE (cond) / arithmetic IF (IF (X) 10, 20, 30) / computed GOTO (GOTO (10,20,30), X) / GOTO label / STOP / RETURN |
|---|---|
| Types | INTEGER / REAL / DOUBLE PRECISION / CHARACTER*N → character(len=N) / LOGICAL + .TRUE. / .FALSE. |
| Data structures | 1D arrays (INTEGER A(5) / DIMENSION A(5)) / 2D arrays (INTEGER M(2,3)) / DATA initialization (DATA A /1, 2, 3/) / PARAMETER constants |
| Procedures | SUBROUTINE NAME(params) + CALL NAME(args) / typed FUNCTION (INTEGER FUNCTION SQR(X)) / RETURN / function-as-argument (EXTERNAL F + F(X)) / INTRINSIC ABS, SQRT |
| Variable sharing | COMMON blocks (COMMON /SHARED/ X, Y) / SAVE attribute (state persists across CALL) |
| Operators | arithmetic (`+ - * / **`) / relational (.EQ. .NE. .LT. .GT. .LE. .GE. → .eq. .ne. .lt. .gt. .le. .ge.) / logical (.AND. .OR. .NOT.) / string concat (//) / identifiers and keywords auto lower-cased |
| I/O | PRINT *, / WRITE(*,*) / unit-numbered WRITE(unit, label) + READ(unit, label) / numbered FORMAT statements (100 FORMAT('X=', I5)) / OPEN(UNIT=N, FILE='...', STATUS=...) + REWIND + CLOSE |
| Auto-normalization | IMPLICIT NONE auto-injected (right after PROGRAM/SUBROUTINE/FUNCTION) / fixed-form col 1-72 truncation + col 6 continuation recognition / identifiers lower-cased / case preserved inside string literals |
Conversion example — function-as-argument (EXTERNAL + higher-order)
A typical HPC idiom compiles and runs unchanged as modern FORTRAN:
PROGRAM ETEST
EXTERNAL DBL
INTEGER DBL, APPLY, X
X = APPLY(DBL, 5)
PRINT *, 'RESULT=', X
END
INTEGER FUNCTION APPLY(F, X)
INTEGER F, X
EXTERNAL F
APPLY = F(X)
RETURN
END
INTEGER FUNCTION DBL(N)
INTEGER N
DBL = N * 2
RETURN
END
! Generated F2018 (deterministic, byte-exact) program etest implicit none external dbl integer :: dbl, apply, x x = apply (dbl, 5) print * , 'RESULT=', x end program integer function apply(f,x) implicit none integer :: f, x external f apply = f (x) return end function integer function dbl(n) implicit none integer :: n dbl = n * 2 return end function
Algorithms verified end-to-end (Phase 1-5)
- Core syntaxHello World / arithmetic (INTEGER 7×6=42) / IF/ELSE numeric branching / DO loop accumulation (1+2+3+4+5=15) / REAL + SQRT (3-4-5 hypotenuse=5)
- Arrays / types1D array sum-of-squares (1+4+9+16+25=55) / DOUBLE PRECISION division (1.0D0/3.0D0=0.333..) / 2D array (M(I,J)=I*10+J, M(2,3)=23) / DATA initialization (10+20+30=60) / PARAMETER constant (PI×R²=12.566)
- ProceduresSUBROUTINE PRSUM (Σ i=1..N=10) / typed FUNCTION SQR (7²=49) / function-as-argument APPLY(DBL, 5)=10 / SAVE attribute (3 CALLs → COUNT=1,2,3)
- Strings / logicalCHARACTER*20 + concat
//(`Hello, World`) / DO WHILE accumulation / LOGICAL +.AND. .NOT.range check (`in range`) - F66/F77 obsolescentarithmetic IF 3-way (X=-5 → `neg`) / computed GOTO 3-way (X=2 → `two`) / GOTO + labeled statement / DIMENSION on a separate line
- Variable sharing + I/OCOMMON block (X+Y=30) / numbered FORMAT (`X= 42 Y= 3.14`) / OPEN/WRITE/REWIND/READ/CLOSE round-trip (SUM=600) / INTRINSIC ABS+SQRT
Audit fitness (HPC validation heritage / weather / nuclear)
- Bit-exactSame F77 source → same F2018 sha256. Includes arrays, SUBROUTINE, COMMON blocks, function-as-arg — fully deterministic.
- Byte-exact regression
make testdiffs actual/.f90 against expected/.f90 — 25/25 PASS(2026-05-08 baseline). Future emitter changes that introduce unintended drift are detected immediately. - gfortran compile 100%All generated F2018 passes
gfortran 13.3(25/25). Runtime output remains bit-identical to the F77 original after structuring. - Audit chainPluggable into the SlimeNENC shared S7 stage (SHA-256 monotonic chain). Aligns with 30-year retention requirements for weather / nuclear validation.
- Hallucination detectionTrigram + bigram language model. Axis 2 rejects 100% of mutations.
- Build-time LLMLLM is used only at rule-construction time. Runtime is deterministic rules — basis of the 99.9995% claim.
Multi-target roadmap (revised 2026-05-08)
Reordered priorities based on speed, talent pool, and the “array hell” resolution:
C++ first → C second → Rust third.
The decisive factor is C++23 std::mdspan, which makes the array-hell problem (column/row major + stride + arbitrary base) a native language feature.
| ① modern FORTRAN | ✅ Implemented in Phase 1-5 (F77 fixed → F2018 free), 25/25 byte-exact, natural HPC migration target. |
|---|---|
| ② C++23 (Phase 7, 3-4 mo.) | Primary investment target. std::mdspan + layout_left resolves ~80% of array hell at the language level; direct fit for the HPC ecosystem (Eigen / Kokkos / RAJA). Mode A (column-major maintain) targets SHA-256 parity with gfortran outputs. |
| ③ C (Phase 8, 1-2 mo.) | Downgraded from the C++ Phase 7 output by replacing mdspan with #define IDX2D macros; for legacy environments (older CUDA / RHEL 7 / older AIX). Low effort — trivially derived from the C++ emitter. |
| ④ Rust (Phase 9, 3-4 mo.) | ndarray Array2 + Order::ColumnMajor; memory-safety premium for mission-critical migration (financial quant libraries, computational chemistry). |
| ⑤ CUDA (Phase 10, future) | Subset of C++ Phase 7 for GPU offloading; one NAS Parallel Benchmark conversion as proof. |
The “array hell” problem and SlimeFORTRAN’s per-array mode selection
FORTRAN and C/C++/Rust differ on six axes regarding array semantics
(index base / memory layout / lower bound / slice notation / whole-array ops / shape-knowing).
Even a trivial A(I,J) conversion requires solving all six axes simultaneously to preserve behaviour.
SlimeFORTRAN selects, per array, one of four conversion modes via the Slot IR, optimised for use case:
| Mode | Approach | bit-exact | Use case |
|---|---|---|---|
| A: Column-major maintain | Preserve FORTRAN’s column-major layout and 1-based index in C++/C/Rust (mdspan layout_left / IDX2D macro / Order::ColumnMajor) | ✅ Fully preserved (memory order match → round-off matches too) | Numerical kernels, BLAS, CFD, signal processing (primary) |
| B: Row-major transpose | Transpose to match the target language’s convention | ❌ Not preserved (cache-locality / SIMD reduction order changes) | GUI / I/O / string processing dominated code (secondary) |
| C: Strided descriptor | mdspan layout_stride for runtime-specified lower bound / stride / layout | ✅ With function inlining (negligible overhead) | Assumed-shape A(:,:) arguments, generic libraries |
| D: ISO_C_BINDING + retain FORTRAN | Keep the computational kernel as compiled FORTRAN (.o via gfortran); thin C++/Rust wrapper calls in | ✅ Fully preserved (original code executes) | Phased migration; rewrite UI in C++ but keep the kernel |
Which array used which target / mode is recorded in the audit chain — auditors can re-verify after the fact.
Conversion example (Mode A, C++23)
! FORTRAN (column-major, 1-indexed) REAL :: A(M, N) A(I, J) = 3.14 // C++23 (Mode A, bit-exact, std::mdspan) #include <mdspan> std::vector<double> data(M*N); auto A = std::mdspan<double, std::dextents<size_t,2>, std::layout_left>(data.data(), M, N); A[i-1, j-1] = 3.14; // SHA-256 parity with FORTRAN A(I,J)
License model
License model
| Charged | WASM/WASI converter tool (developer side) |
|---|---|
| Free | Generated modern FORTRAN source (customer asset, perpetual deploy) |
| Method | Ed25519-signed 144B license + 3-hop air-gap activation (HPC / nuclear audit-ready) |
| Parallelization (PSDP) | Not bundled with this product. See PSDP as a separate SKU under SlimeNENC. |
Resources
- Tech overviewSlimeNENC Technical Overview (FORTRAN chapter in preparation)
- Patent applicationJP 2026-046620 v15b — claims 11 / 14d cover legacy dialect processing for COBOL / MUMPS / PL/I / RPG / FORTRAN explicitly
- Sibling productsSlimeCOBOL / SlimeMUMPS / SlimePL/I / SlimeRPG / SlimeJCL share the same S2-S5 / S7-S9 backbone
- BenchmarksS9 bench harness (5-axis correctness);
make testins6_modern_emit_fortran/gives byte-exact regression 25/25;make compile-testgives gfortran compile 25/25
FORTRAN PoC / Materials Back to SlimeNENC family SlimeRPG SlimePL/I
