A Minimal Procedural Language

[ Download | Book | Reference ]

T3X/0 is a small, portable, procedural, block-structured, recursive, and almost typeless programming language, and the latest member of the T3X family of languages. Its compiler is freely available (0BSD license or public domain). T3X/0 syntax is similar to Pascal, its semantics resembles BCPL's.

T3X/0 is used as a teaching language in the book
Write Your Own Retro Compiler.

Here is the simplest "Hello World" program in T3X/0:

USE t3x: t;
DO t.write(T3X.SYSOUT, "Hello, World!\r\n", 15); END

(Of course this program cuts some corners, so here are some more correct versions.)

Here are some more interesting programs written in T3X/0:

Simple Examples
More (or Less) Serious Programs

If you want to learn more about the T3X/0 language, here is

A Very Short T3X/0 Summary
The T3X/0 Language Reference

T3X/0 currently runs on FreeBSD-386, generic 386 Unix (and x86-64 Unix in 32-bit mode), DOS 2.0 (or later), CP/M 2.2, and on the TCVM (Tcode Virtual Machine). It is self-hosting on all supported platforms and can cross-compile to all supported 16-bit platforms.

Download the Compiler

Current Version (, ~200KB)
This is the full source code to the compiler (in T3X/0) and the runtime libraries (in Z80, 8086, and 386 assembly language, and in C). The archive also contains an implementation of the Tcode Virtual Machine in C, a TCVM binary for DOS, additional libraries, example programs, documentation, and pre-compiled compiler binaries for the Tcode machine, CP/M, DOS, and FreeBSD. All in 200K bytes.
Book Version (, ~200KB)
This is the same as above, but the version frozen at the time when the book was published.
Supported Systems
Some Compiler Statistics

contact  |  privacy