Fortran ideas,
modern language design
tgFortran is a case-sensitive, curly-brace, zero-indexed language for scientific computing. It keeps array programming central, adds modern data modeling, and stays close enough to the numerical workflows people actually write.
0.10.0 delivers OpenMP-backed parallel execution with chunk coarsening,
atomic compound assignments, and measured multicore speedups on real numerical workloads.
GPU syntax exists, but it is still experimental and gated behind --experimental-gpu.
The stable parallel path today is CPU do parallel.
udt Particle {
real64[:] x
real64[:] y
real64[:] rho
}
program main {
use array: full_real64
Particle p
p.x = full_real64(8, 0.0)
p.y = full_real64(8, 0.0)
p.rho = full_real64(8, 1.0)
int64 i
do parallel i = 0, 7 {
p.x[i] = real64(i)
p.y[i] = 2.0 * real64(i)
}
print(p.x[3], p.y[3])
}
What is in the language
Enough surface to write real numerical programs
Arrays first
Multi-dimensional arrays, slicing, views, whole-array operations, reductions, linear algebra helpers, and shape inquiry intrinsics.
Modern data modeling
enum, udt, dict[K, V], and set[T] are first-class. This is enough to write structured solver code, not only toy kernels.
Modules and clean imports
module, qualified access, and selective use imports keep larger programs manageable.
Parallel loops
do parallel executes across CPU threads via OpenMP with chunk coarsening. atomic compound assignments enable safe shared-array updates.
Broad intrinsic surface
Math, strings, shape, reduction, extrema-by-dimension, random, timing, file I/O, and command-line modules like os and cli are already in.
Compiler and runtime are in-tree
No large C++ runtime dependency stack. Parser generation uses ANTLR; the language frontend, LLVM lowering, containers, and runtime behavior are owned by the project.
Examples
Representative programs already running in tgFortran
| Example | What it demonstrates |
|---|---|
heat_2d | 2D stencil update with do parallel |
heat_3d | 3D structured update and checksum validation |
sph_dam_break_2d | Grid-based SPH dam-break with parallel particle passes |
sph_dam_break_2d_udt | Same SPH solver organized around UDT-backed state |
sph_double_dam_column_2d | More complex SPH geometry with multiple fluid regions and an obstacle |
udt_particle | Nested UDTs and container-backed record fields |
intrinsics_showcase | Broad intrinsic coverage in a compact program |
Each example above links to a full code listing.
Measured baseline
Current benchmark picture
do parallel now executes across CPU threads via OpenMP with chunk coarsening.
Each thread receives a contiguous iteration range, preserving LLVM auto-vectorization of inner loops.
Downloads
Release packages
Self-extracting installers are the intended distribution path. This page publishes the current release artifacts directly.
Current release metadata is 0.10.0. CPU parallelism is the supported parallel path; GPU mode remains experimental.
| Platform | Artifact | Notes |
|---|---|---|
|
|
tgfortran-Darwin-arm64.run |
Installer targets $HOME/.local/tgfortran/0.10.0 and creates $HOME/.local/bin/tgfortran. |
|
|
tgfortran-Linux-x86_64.run |
Installer targets $HOME/.local/tgfortran/0.10.0 and creates $HOME/.local/bin/tgfortran. |
chmod +x tgfortran-Darwin-arm64.run
./tgfortran-Darwin-arm64.run
chmod +x tgfortran-Linux-x86_64.run
./tgfortran-Linux-x86_64.run
On both macOS and Linux, the installer can update your shell profile to add $HOME/.local/bin to PATH.
Open a new shell, or run export PATH="$HOME/.local/bin:$PATH" in the current session after install.
Status
tgFortran 0.10.0
The compiler now delivers real multicore parallelism via OpenMP-backed do parallel with
chunk coarsening and atomic compound assignments. Modules, records, containers, broad intrinsics,
and runnable examples continue to mature alongside benchmark-driven compiler work. GPU syntax exists,
but it is intentionally gated behind --experimental-gpu until the runtime path is trustworthy on real workloads.