TMod-c

A clean, readable, Modula-2 / Pascal-inspired systems language that transpiles to portable C11.

Kinda-C, but not really C. It speaks C to the linker and Pascal to the soul: structured syntax, explicit modules, and safety-minded design — generating standards-compliant C you can compile with gcc, clang, or tcc. Currently built on Linux.

What is TMod-c?

TMod-c (TYPE compiler; historically Mod-c during rebrand) combines the clarity of the Wirth-family languages with a practical C11 backend. It is aimed at readable, reviewable systems and compiler construction code — not at replacing C’s entire ecosystem.

The design is closer to Modula-2 + C than to full Oberon: compile-time types, modules, and optional Oberon-shaped record extension (STRUCT … EXTENDS) with layout and upcasts — without hidden vtables or runtime type tags. When you need discrimination, you add it yourself (the usual enum + union pattern).

Purpose

TMod-c exists so a lifelong language design can be finished enough to run: modules and imports that map to real headers and linkers, types that stay honest at the C boundary, and a grammar simple enough to maintain by hand. Features earn their mass before they earn syntax — simple, but not too simple for real C interop and real Makefiles.

Atomic pudding with lunar discipline. Identifiable pieces (modules, procedures, typed constants) stirred from Pascal clarity, Modula-2 seams, C ABI ground truth, and Oberon’s courage to delete — until it sets into something you can compile today.

Documentation

Language rules live in the Language Report and formal EBNF (single sources of truth in the repo). Status and release notes track the live tree.

Language Report

Prose definition of the language: modules, types, EXTENDS, statements, design notes.

EBNF Syntax

Complete formal syntax (Wirth-style EBNF) kept close to the implemented grammar.

Current Status

Live project focus, completed calm-path items, and suggested next work.

Changelog

Version-by-version history of the compiler and language features.

Current status

Actively developed personal project (from early 2026). Self-hosting compiler under continuous conversion of C sources to TMod-c. Targeting high readability and safety without a mandatory GC.

Downloads: a source archive (tmod-c-0.26.5.179.tgz (from make tar) may be published in the site root next to this page. Prebuilt binaries are not provided; build from the archive or the repository.

Illustrative build on Linux (from source archive)

$ tar xzf tmod-c-0.26.5.179.tgz
$ cd tmod-c-0.26.5.179/
$ make help
$ make
$ ./bin/modc.0.26.5 --help
$ ./bin/modc.0.26.5 hello.mc -C
$ cc -std=c11 -o hello hello.c
$ ./hello

See Current Status for the authoritative version line and next steps.

Not to be confused with…

Contact

For more information, reach out on X: @MScottReynolds.

Designed and developed by M. Scott Reynolds (Salt Lake City, Utah), with Grok (xAI) as a long-running design and documentation collaborator. Compiler source is reviewed and typed in by hand.