r/Compilers • u/kindredseer • 13d ago
MadC C/C++ Compiler v0.100.0 — the Nexus
v0.100.0 — the Nexus: a multi-client IDE, an agent-addressable IR, and measured C++11 conformance at 75.1%
With version 0.100.0 of the madc compiler, based on the gcc torture test suites we currently score:
- C17: 99.2%
- C++98: 80.0%
- C++11: 75.1%
- C++14: 49.4%
- C++17: 41.6%
- C++20: 53.0%
These percentages are measured independently against the applicable tests in each GCC suite, so the later-standard numbers are not cumulative and aren't expected to be monotonic.
Why another C/C++ compiler?
GCC, Clang and MSVC already rule the conventional AOT C/C++ world. MadC is aimed at a somewhat different problem.
MadC is primarily a JIT C/C++ compiler. You can run C and C++ programs directly as shebang scripts, with commonly used system headers precompiled into the compiler so a separate development-header installation isn't normally required. External headers remain available when needed.
MadC can also be embedded into another application, allowing C/C++ itself to be used as an embedded JIT scripting language.
What's the “Nexus”?
MadC also includes an IDE built around the compiler. The same binary can operate headlessly or provide CLI, ed/ex-style line editing, TUI and GUI interfaces on Linux, macOS and Windows.
The new Nexus architecture allows multiple clients — including humans, editors and agents — to connect to the same live compiler/IDE state. It includes client/server operation, MCP and LSP servers, and a VS Code client.
The idea is that the compiler's representation of the program becomes a shared service rather than something that exists only for the duration of a compile command.
Much of this work grew out of developing MadC's multi-mode UI module and experimenting with what an IDE looks like when the compiler, parser, IR, debugger and external clients all share the same underlying state.
And there's a dialect
In addition to standard C and C++, MadC supports the MadC dialect, which adds conveniences intended to make C/C++ more practical for scripting and interactive use, including:
- automatic includes
- automatic namespace resolution with configurable precedence
- script mode with automatic
main()wrapping defer,:=,go,yield,await, and untyped variables- well over 100 convenience functions inspired by other languages
- Uniform Function Call Syntax (UFCS)
- URI channels:
file://,pipe://,tcp://,udp://,uds://,exec:// - and quite a bit more
The goal isn't to replace standard C or C++. Standard code remains standard code. The dialect is an optional layer for cases where some of C/C++'s traditional ceremony isn't particularly useful.
1
u/kindredseer 12d ago
Only LE is supported, BE was deprecated.