Getting Started
Download options, runtime expectations, and the kinds of programs tgFortran already runs well.
Download
Self-extracting installers are the intended distribution path. Published release artifacts are linked here once a release is cut.
The installer layout targets $HOME/.local/tgfortran/<version>, creates a tgfortran symlink in $HOME/.local/bin,
and can update shell startup files to add that directory to PATH.
| Platform | Artifact | Notes |
|---|---|---|
| macOS arm64 | tgfortran-Darwin-arm64.run |
Release metadata is currently 0.10.0. |
| Linux x86_64 | 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
If the installer updates ~/.zshrc or ~/.profile, open a new shell afterward,
or run export PATH="$HOME/.local/bin:$PATH" in the current terminal.
Access
tgFortran is now available as packaged release builds. The current public focus is on shipping runnable binaries, validating real workloads, and tightening the language/runtime around numerical use cases.
- Packaged binaries are the supported distribution path right now.
- Examples and benchmark numbers shown on the website come from the active compiler/runtime tree.
- The project is focused on practical language/runtime maturity and real benchmarked programs.
- GPU syntax is currently experimental and requires
--experimental-gpu.
CLI programs
Command-line programs should use the current os and cli modules.
That gives a cleaner surface than manually indexing raw argv state everywhere.
program main {
use os
use cli
string[:] args
args = os.argv()
if (cli.has_flag(args, "--help")) {
print("usage: app --config case.json")
return
}
string config
config = cli.option_or(args, "--config", "case.json")
print(config)
}
os.argc()returns the visible argument count.os.argv(i)returns one argument as astring.os.argv()returns the full argument vector asstring[:].cli.has_flag,cli.option, andcli.option_orprovide the current lightweight parser surface.
C ABI interop
tgFortran can import C ABI functions directly. The current interop surface covers
explicit foreign functions, explicit foreign structs, explicit C-style enums, typed pointers,
callbacks, and runtime symbol loading through ffi.
extern udt Vec2 {
real64 x
real64 y
}
extern function vec2_scale(c_ptr<Vec2> v, real64 s)
program main {
use ffi
Vec2 v = Vec2{3.0, 4.0}
vec2_scale(ffi.address_of(v), 2.0)
print(v.x, v.y)
}
For dynamic binding, declare the extern function first and then use
ffi.load_library, ffi.lookup_symbol, or ffi.bind_symbol.
Runtime expectations
- Array programming is a first-class path, not an afterthought.
do parallelalready pays off on heavier kernels such as SPH and larger heat workloads.- CPU
do parallelis the supported parallel path today. - GPU mode is gated behind
--experimental-gpuand should be treated as preview-only. - The implementation is now being tuned against real benchmarks rather than toy syntax tests.
Run example programs
The current example set includes:
heat_2dandheat_3dfor structured stencil-style kernelssph_dam_break_2dfor grid-accelerated SPH with parallel particle passessph_dam_break_2d_udtfor the same solver organized around UDT-backed statesph_double_dam_column_2dfor more complex fluid geometryudt_particleandintrinsics_showcasefor language-surface coverage
The examples are being used internally to drive language completion, correctness validation, and compiler/runtime optimization.
Full code listings are published under Examples.
Run the benchmark harnesses
Benchmark publishing is aligned to the current LLVM/OpenMP runtime path and published from measured runs.
- The compiler/runtime now has a single execution path:
tgfortran. do parallelexecutes across CPU threads via OpenMP with chunk coarsening.- The benchmark page reports separate compile and runtime measurements for the published data set.
Rollout focus
The first public phase is about showing that tgFortran already runs nontrivial scientific workloads and that the compiler/runtime is being driven by benchmark evidence. The work now is performance, not basic syntax completion.