Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Development Roadmap

colang (the Co language compiler) follows a staged route: first fully implement a C compiler, then tailor and extend it into the Co language.

Version Policy

Versions follow MAJOR.MINOR.PATCH:

  • 0.* — Development and testing. Features and syntax may change; no cross-version compatibility guarantee.
  • 1.* — Official release. Public contracts are frozen; backward compatibility is guaranteed.
  • 2.* — Bootstrapping. The compiler itself rewritten in Co.
  • 3.* — Product finalization. Beyond bootstrapping, converged into a final, production-ready stable form.

Within 0.*, MINOR bumps denote milestones (a key Co-layer capability). PATCH bumps are small Co-layer prerequisites or C-base fixes between two milestones.

0.* Milestones

VersionThemeStatus
V0.1.0C compilerReleased
V0.2.0Co entry model + publicReleased
V0.3.0LinkingReleased
V0.3.1Windows GUI & winapi.coReleased
V0.3.2Linux native ELF toolchainReleased
V0.4.0classReleased
V0.4.1Diagnostics conformance & winapiReleased
V0.6.0Complex core slice + stdlib headers + linker diagnosticsReleased

Details for 1.* / 2.* / 3.* will be finalized by the maintainer before 0.* wraps up.

Released

V0.1.0 — C compiler

  • Full C17 coverage plus key C23 features (_BitInt, nullptr, auto, bool following C++ semantics, attribute syntax, etc.).
  • Hand-made colib standard headers to avoid cross-ABI dependencies.
  • Passes the Fujitsu c-testsuite conformance test suite.
  • Layered compiler structure: lexer → preprocessor → parser → sema → LLVM codegen, producing a single .bc that is handed to an external linker.

V0.2.0 — Co entry model + public

  • Top-level statements execute in source order; a user main is not required (the compiler synthesizes the entry).
  • Coexistence of a user-written main and the synthesized entry; top-level return V; sets the process exit code.
  • The public keyword marks exported symbols; -o *.dll / -o *.so selects the output kind by file extension.
  • Three-way entry rule: bare statements present → normal execution; only main → forward without warning; neither → warn and emit an empty ret 0.

V0.3.0 — Linking

First delivery covers import (.co source merge) and the linking core (checked items below); unchecked items roll to later milestones.

  • import (.co source merge): syntax import * | name [as alias], … from ("file" | module_name);; consumes .co sources only, public being the sole cross-module visibility gate; top-level statements of imported modules run once at first load, unified before the main entry in topological order; path dedup + DFS cycle detection reporting the full chain; identifier form from a equals from "a.co" (same directory only).
  • The compiler links on its own: -c emits a COFF .obj, and the default action links the object into an executable — no dependency on an external clang.
  • -o <name>.dll produces a Windows dynamic library: with an export table, and a .lib import library generated alongside the base name.
  • [[lib("user32")]] declares library attribution, with no command-line flag needed.
  • Static CRT linked by default: the produced exe ships without requiring the VC runtime to be installed.
  • Multi-module .obj merging, .dll / .lib consumption, static library output.
  • import extended to consume .obj / .dll / .lib as importable modules (bundling compile-time declaration metadata).
  • Module-alias-limited access: m.f(), m.x.
  • Refinement of DllMain synthesis and top-level body triggering for DLL outputs.
  • User-visible command-line arguments argv: delivered via route A (.co top-level entry has built-in argc(int) + argv(char**), C-form and self-contained, iterated by the argc count with argv[argc]==NULL), decoupled from the array-with-length infrastructure; argv as a globally visible, self-length-carrying string-array value type still awaits D37 (same batch as string/general arrays).

V0.3.1 — Windows GUI & winapi.co

  • Windows GUI subsystem and WinMain entry: [[subsystem("windows")]] or defining WinMain switches the artifact to a console-less GUI program; WinMain is mutually exclusive with top-level bare statements.
  • winapi.co replaces windows.h: a starting subset, expanded through V0.4.0 to 323 prototypes / 39 struct-union layouts / 396 constants (SDK-verified), library attribution via [[lib(...)]]; a practical subset of programmatic GUI APIs (window, message loop, memory-DC drawing, clipping, text metrics, system colors).
  • const consistency: read-only enforcement (diagnostics matching clang); public const int values flow across modules into array dimensions and switch case labels, with non-constant labels now rejected instead of silently folded to 0.
  • First batch of attribute semantics: [[nodiscard]] / [[noreturn]] in effect; [[deprecated]] same-position duplicates accepted first-wins.
  • C-conformance batch: designated initializers across the chain (chained designators, promoted anonymous aggregates, union hosts, mask-merged bit-field initialization, DFS continuation), sizeof/_Alignof in constant contexts, universal character names (\uXXXX/\UXXXXXXXX) in identifiers and literals, prefixed character constant typing, _Alignas context constraints and cross-declaration consistency, static_assert in more scopes.
  • Diagnostics quality: typedef alias spelling restoration, column alignment with clang, up-front diagnostics for by-value allocation of incomplete types.
  • Flat single-level release package: colang.exe + include/ (standard headers located next to the compiler, no -I needed).
  • Linux (WSL) build brought up: the colang compiler itself builds and runs its regression suite natively on WSL2/Debian (linking at this stage still relies on an external toolchain).
  • Bare tags in the Co layer (C++ style): in .co sources a struct/union/enum may be used as a type without its keyword (Point p;), including a public tag of an imported module.
  • Release version strings extended to four segments MAJOR.MINOR.PATCH.Build (the fourth is a build counter, shown by -v and in the PE version info of artifacts).

V0.3.2 — Linux native ELF toolchain

  • A single target/data-model abstraction (__LP64__/__LLP64__) drives predefined macros, type widths, code generation and linking, eliminating the front-end/back-end data-model split.
  • On Linux an in-process lld::elf statically links the local glibc/libgcc into a native ELF executable (no external linker); crt1.o/libc.a/libm.a/libgcc are located automatically.
  • --target <triple> cross-emits ELF object files and IR.
  • Native colang build on Linux (LLVM 23.1 built from source, X86+lld); the plct matrix aligned to the Windows baseline.
  • Built-in .rc resource compiler and the --resource embedding channel (byte-for-byte alignment with rc.exe); the per-module compilation model promoted (independent closure + same-name routing + qualified access); wchar_t/wint_t made target-aware across the chain; the synthesised DllMain carrier for DLLs; const diagnostics aligned with clang.
  • New default settings header include/colang.h preloaded automatically.
  • Follow-ups (long tail): .so shared objects, dynamic PIE, x86-64 SysV ABI edge cases, ELF mapping of winapi.co, glibc audit of all stdlib headers.

V0.4.0 — class

  • Reference type class with new instantiation and this member access.
  • Four lifecycle protocols: __new__ / __retain__ / __release__ / __delete__.
  • Automatic reference counting and heap-object reclamation; out-of-scope auto-free.
  • public extended to class members.
  • Static class members accessed via the class name with double colon (C::m()).
  • Delivered beyond the original plan: member and parameter types opened up (class handles, struct/union/array embedded by value; parameters borrow, members are owned by the host); the delete statement for forced destruction and cycle breaking; correct release on goto/break/continue path terminations.
  • Follow-ups (long tail): inheritance and virtual functions; cross-module consumption of a public class from an imported module; the class form under multi-obj (--per-module); automatic cycle breaking (currently done with delete).

V0.4.1 — Diagnostics conformance & winapi expansion

  • Diagnostics-conformance wave: compile-time errors/warnings and the diagnostic context realigned with clang and ISO C/C++, converging several silent-wrong-value/misjudgement sites (file-scope bool/integer constant folding now follows “nonzero is true”).
  • Diagnostics: every error/warning now shows the offending line with +/-2 lines of surrounding source and a caret; -fno-diag-context disables it.
  • CLI and source-surface tightening: new -l/--lib to specify external libraries; [[lib]] and class definitions restricted to .co sources (rejected in .c/.h).
  • Co-layer robustness: fixed the degradation/crash when using a cross-module public struct by value inside an imported module.
  • winapi.co continues to expand: up to roughly 356 prototypes / 45 struct-union layouts / 503 constants, adding the winsock (ws2_32) socket family, the crypt32 string-encoding family, and more.

V0.6.0 — Complex core slice + stdlib headers

  • C complex types float _Complex / double _Complex core slice: + - * / arithmetic, == != comparison, the constant I (_Complex_I), and the <complex.h> accessors creal / cimag / conj / cabs / carg / projection (with f variants). Transcendental functions such as cexp / clog / csqrt and the standalone _Imaginary type are not yet supported.
  • Link-time undefined symbol diagnostics now report the real call-site file, line and column.
  • <threads.h> adds the C11 timed functions thrd_sleep / mtx_timedlock / cnd_timedwait, and now includes <time.h> so struct timespec is visible.
  • Fixed duplicate public global declarations in one .co module making cross-module consumers read back the initial value.
  • Note: this release corresponds to the internal development cycle 0.5.5.

Planned

Planned Co-language-layer features for the 1.* line are registered below (each shipped in a backward-compatible manner); 3.* details will be finalized by the maintainer, and the 2.* goal follows.

Planned language-layer features (1.* line)

  • Built-in string / wstring value types: first-class string value types carrying an implicit length, directly comparable and concatenable, added at the Co language layer (beyond C).
  • Cross-module binary import: import currently consumes .co sources only; planned to consume .dll / .lib / .so / .a binaries directly (the production side is already in place).
  • class inheritance / virtual functions / RTTI: on top of the delivered class core, add single/multiple inheritance, virtual functions and runtime type information, with up- and down-casting.
  • Full winapi.co coverage: the Co modular wrapper of the Win32 API keeps expanding, ultimately covering the full API set via a metadata-driven auto-generation pipeline.
  • Structured exception handling (try / catch / throw) (deferred requirement): retained as a language-layer requirement; its design and semantics are not yet finalized or scheduled — this entry registers intent only and is not a release or compatibility commitment.

V2.0.0 — Bootstrap

  • Goal: rewrite the colang compiler’s main body in the Co language itself, so the resulting compiler can compile its own source (bootstrap) — transitioning from today’s C++ implementation to a version written in Co that closes the loop by compiling itself.
  • Prerequisites: the Co language layer must be complete, correct and fast enough to express an entire compiler; the back-end must first be settled — either bind through a pure-C interface (LLVM-C) and link prebuilt libraries, or replace LLVM with a self-owned back-end (full bootstrap); and the whole build chain must be able to compile colang with colang itself. (Inheritance / virtual functions / exceptions are not prerequisites of bootstrap, only optional language conveniences when writing a compiler, and are already listed among the 1.* features above.)
  • Significance: bootstrap is the foundation for reaching product finalization (3.*) — once the compiler can compile itself, it sheds dependence on an external C++ toolchain and enters a long-term self-maintaining stage.

Terminology

  • Internal development documents use “milestone”.
  • Public-facing manuals (this one) use “release version”.
  • Feature wording and error messages reflect actual compiler behavior.