T3X

T3X

A Minimal Procedural Language

T3X is a small, portable, procedural, block-structured, recursive, almost typeless, and to some degree object-oriented programming language. Its syntax is similar to Pascal, its semantics resembles BCPL's.

The T3X compilers are small and fast. Some of them support modules and separate compilation. The original compiler was targetted at the 16-bit Tcode machine, but native code backends for various processors exist.

T3X9

T3X9 is the smallest, fastest, and most minimalistic one of the T3X compilers. It self-compiles its own code (about 1600 lines of T3X) in about 0.05 seconds. It runs on FreeBSD and targets the 386 CPU. It is a statement rather than a production tool.

T3X9 is also a good language for first course in compilers! The book Write Your Own Compiler discusses the full source code of T3X9 on little more than 100 pages!

About the T3X language
A T3X9 micro manual
The compiler source code
Example programs
The T3X9 compiler book

T3X Release 7

Version 7.2.3 of the T3X compiler was the last version targetting the original Tcode machine. It was published in 2003 and never worked on 64-bit platforms except for the DEC Alpha. Version 7.3.x (and later 7.x versions) are a cleaned-up package that should compile on modern systems, like the x86-64 (although in 32-bit mode).

The T3Xr7 compiler is an optimizing compiler that targets the Tcode machine, the 8086 processor under DOS, the 386 processor under various Unix systems, as well as the Alpha AXP 21064 CPU under NetBSD. It is self-hosting under all supported systems. The T3Xr7 language supports modules and separate compilation. The compiler package even contains a tiny text-mode IDE.

Hello World
The above T3X9 example programs will also run under T3Xr7 when adding the statements MODULE name(t3x); and OBJECT t[t3x]; at the top of the program. There are more examples in the source code archive.
Lightweight Compiler Techniques
is a book describing the predecssor of T3Xr7. It discusses the language, the compiler, and methods for implementing compilers in low-memory environments in general.
The T3X 7.4.1 compiler bootstrapping kit (zip, ~580KB)
contains the full compiler sources and all tools that are necessary for bootstrapping the compiler under Unix or DOS. A C compiler is needed on Unix, no additional tools are needed on DOS. The kit also contains the full documentation, example programs, and the book "T3X – A Minimal Procedural Language".
The T3X 7.4.1 compiler DOS package (zip, ~470KB)
is a set of pre-compiled DOS EXE files generated from the above source code. Extracted size: about 1220K bytes, i.e. it fits on a single 3.25" HD floppy disk, but no longer on a 5.25" HD floppy disk (although when removing the book text, it would fit easily). This package does not contain the compiler source code, but it can be used to re-build the code in the above boostrapping kit.

XT3X

The XT3X compiler is a version of T3X9 that is intended for writing simple, sprite-based video games as they were popular in the 1980's. It targets an extended Tcode9 machine that provides color graphics and sound and runs under X11.

T3X 8.1.7

T3X 8.1.7 (zip, ~500KB) was the last version of the T3X compiler back in the days. It provided support for 32-bit Tcode, thereby removing the 64KB code and 64KB data limits. The ports may suffer from bit rot, though, so you might want to try version 7.3.x instead.

T3 Release 3

T3r3 (zip, 67KB) was the last T3 compiler before the language was renamed T3X. This is really old and hackish code, but shows nicely where T3X has its roots.


contact  |  privacy