Fortran compiler for the COR24 24-bit RISC ISA (future/research).
Part of the COR24 ecosystem.
FTI-0
A small educational FORTRAN subset compiler in SNOBOL4 targeting PL/SW.
sw-cor24-fortran is an experimental educational compiler project.
The first language subset is FTI-0:
- a small, fixed-form, integer-only FORTRAN-like subset
- implemented in SNOBOL4
- targeting PL/SW
- designed for clarity, testability, and historical flavor rather than full FORTRAN compatibility
The initial goal is to compile small educational programs such as:
- integer assignment
- simple expressions
GOTO- counted
DO PRINTREAD- one-dimensional integer arrays
The project is intentionally staged:
- normalize and parse fixed-form source
- build symbols and resolve labels
- lower control flow to a simple normalized form
- emit readable PL/SW
- later revisit floating point and richer FORTRAN features
A working Hello, World! end-to-end demo is live, even though the
full FTI-0 compiler is still under construction:
scripts/fortran examples/hello.f > /tmp/hello.s
cor24-asm /tmp/hello.s -o /tmp/hello.lgo
cor24-emu --lgo /tmp/hello.lgo --quiet --speed 0
# prints "Hello, World!"
For now, scripts/fortran short-circuits examples/hello.f to a
hand-written examples/hello.s (Path A per
tools/briefs/dcftn-fortran-hello-world.md).
The pre-built examples/hello.lgo is the demo
deliverable that the dwftn web frontend will embed.
Run scripts/test-hello.sh to regression-check the pipeline.
The full FTI-0 compiler (the SNOBOL4-based pipeline that consumes
arbitrary .f sources) is a separate parallel effort -- see
docs/snobol4-blockers.md for status.
This repository currently defines:
- the project structure
- the FTI-0 language subset
- the compiler architecture
- the PL/SW mapping contract
- the milestone plan
- a Path-A hello-world fixture (
examples/hello.s+examples/hello.lgo)
Compiler implementation is expected to begin with source normalization and statement classification.
docs/-- product, architecture, design, plan, subset definitionsnobol4/-- compiler source and testsexamples/-- sample FTI-0 input programsplsw/-- runtime helpers and generated outputscripts/-- development helpers
The first executable milestone is:
- accept a tiny
.fsource file - normalize fixed-form statements
- classify statements
- dump normalized statement records
No code generation is required for the first milestone.
- Repository:
sw-cor24-fortran - Subset language:
FTI-0 - Compiler executable:
fti0c
FTI-0 does not initially support:
- floating point
FORMATCOMMONEQUIVALENCE- statement functions
- separate compilation
- optimization
- multidimensional arrays
- full FORTRAN compatibility
Possible later stages include:
- richer FORTRAN subset levels
- arithmetic IF
- subroutines and functions
- software floating point
- direct or indirect lowering into COR24-oriented toolchains
See docs/research.txt for detailed design research and historical context.
| Repository | Description |
|---|---|
| sw-cor24-emulator | COR24 emulator + ISA |
| sw-cor24-x-assembler | COR24 assembler |
| sw-cor24-project | Ecosystem hub |
- Blog: Software Wrighter Lab
- Discord: Join the community
- YouTube: Software Wrighter
Copyright (c) 2026 Michael A. Wright
MIT License. See LICENSE for the full text.