clax transpiles Clax (.cx) — a small C-with-classes language — to plain
C. It implements the object model described in
Clax-Specification-V2.md: ::, new/delete,
this, Object, typeof, clone, callable (methods as callbacks), NULL
safety, and a generated shared runtime. A bundled standard library (system/*.cx) provides String,
DynamicArray*, HashTable*, and friends.
./configure # or: ./configure --prefix=$HOME/.local
make
sudo make installThis installs:
| Path | Contents |
|---|---|
<bindir>/clax |
the transpiler |
<bindir>/clax_lint |
symlink to clax; lint-only mode |
<datadir>/clax/system/ |
standard library (*.cx) |
<docdir>/ |
the language specification |
<mandir>/man1/clax.1 |
man page |
Defaults follow the GNU layout (prefix=/usr/local). Override any directory:
./configure --prefix=/usr --datadir=/usr/share --mandir=/usr/share/manHonoured variables (flags or environment): CC, CFLAGS, LDFLAGS.
Staged installs work via DESTDIR:
make DESTDIR=/tmp/stage installmake examples— transpile + compileexamples/project(no external deps).make examples-glfw— buildexamples/glfw_project(needsglfw3via pkg-config).make examples-sdl2— buildexamples/sdl2_project(needssdl2via pkg-config).make check— lint the bundled example as a smoke test.make uninstall,make clean,make distclean.
The bundled example projects live under examples/.
clax --init-project ~/myapp # scaffold a new project
cd ~/myapp && ./build.sh # build.sh is pre-wired to the installed system/ lib
# starter projects for graphics (each scaffolds main.cx + Button.cx + a
# pkg-config build.sh; needs the matching dev libraries installed):
clax --init-sdl2-project ~/mygame # SDL2
clax --init-glfw-project ~/mygl # GLFW + OpenGL
# or transpile an existing project directly:
clax --include=/usr/local/share/clax/system ./project
cc -O2 -o program project/generated_c/*.cSee man clax for the full option list.
Damir Šijaković (c) 2026.
