r/Compilers • u/kindredseer • Oct 16 '26
madc v0.105.0 — Live C/C++ REPL function redefinition, and faster compilation
I've released madc v0.105.0, with some substantial improvements to its interactive C/C++ REPL, compilation performance, and portability.
For those unfamiliar with it, madc is a self-contained C/C++ compiler with JIT execution, native executable output, and an interactive REPL, without requiring GCC, Clang, LLVM, or installed development headers or toolchain.
What's new
- Live function redefinition — redefine a C or C++ function in the REPL and subsequent calls use the new implementation, even from previously compiled callers or existing function pointers.
- Live variable and type redefinition — reinitialize existing variables and redefine classes or structs interactively, with versioning when a type's layout changes.
- Interactive source editing — the REPL includes an ex-style editor. Copy, modify, search and replace code directly in the session, with changes taking effect immediately.
- Restart and Run All — replay the entire REPL buffer in a fresh session, similar to working with a notebook.
- Faster compilation — changes to the precompiled header representation allow madc to load only the parts a program needs, substantially reducing compilation overhead.
Performance
The updated README includes benchmarks against GCC 13.3 and Clang 18.1 on Ubuntu 24.04:
| Task | madc | GCC | Clang |
|---|---|---|---|
| C++ Hello World (JIT vs compile/link/run) | 83 ms | 170 ms | 207 ms |
| C++ STL example (JIT vs compile/link/run) | 209 ms | 252 ms | 275 ms |
| C Hello World (JIT vs compile/link/run) | 9 ms | 21 ms | 37 ms |
These are end-to-end timings for the specified workloads, not claims that madc universally outperforms GCC or Clang.
C/C++ compatibility
Current results against external compiler test suites include:
- C17: 99.2% of GCC's
c-torture/execute - C11: 220/220 on the third-party c-testsuite
- C++98: 81.3%
- C++11: 77.3%
- C++17: 43.2%
- C++20: 53.8%
The C++ figures are pass rates for selected GCC test-suite subsets, not claims of complete standards conformance.
madc is available for Linux, Windows, and macOS (Intel and Apple Silicon).
The companion IDE, madcide, has also been updated to v0.8.0 with the live REPL improvements.
GitHub: https://github.com/derekbsnider/madc
Release: https://github.com/derekbsnider/madc/releases/tag/v0.105.0
View all comments
Show parent comment
2
u/kindredseer Oct 16 '26
So the upcoming v0.106.0 build (still under development) now compiles sqlite and passes all tests, except for the tests that need
-fsanitize(which madc does not yet support). I'm also going to make sure it is able to build redis. Do you have any other suggestions of applications/libraries it should be tested against?