Skip to content
Derek Snider edited this page May 19, 2026 · 32 revisions

C, unbound.

madc is real C with the workflow of a scripting language.

Write C. Run it like a script. Ship it as a native Linux ELF executable. Embed it as a library.

No Makefile. No project ceremony. No VM. No bytecode. No fake runtime.

madc compiles C-family source directly to native x86-64 machine code, uses libc directly, caches compiled objects, and can produce real Linux binaries.


What makes madc different?

Use madc as... Command / API What happens
A script runner madc program.mad JIT-compiles to native x86-64 code and runs immediately
A native compiler madc -o program program.mad Produces a Linux ELF executable
An embedded runtime #include <libmadc/api.h> Hosts madc inside your own C/C++ application

madc gives you the immediacy of a scripting language without giving up native C execution.


Real C, not fake C

madc is not a C-flavoured scripting language, bytecode VM, or toy interpreter.

It compiles to real native x86-64 machine code. It uses libc directly. It supports ordinary C-style programs, pointers, structs, functions, headers, preprocessor directives, and native linking.

madc is still growing toward fuller modern C compatibility, including broader C23 coverage, but standards completeness is not what makes something “real C.”

K&R C was real C. ANSI C was real C. Embedded C compilers are real C. TinyCC is real C.

madc belongs on that spectrum: real C at the core, extended where useful, and improving rapidly.


See it in action

A normal C-style program works exactly how you would expect:

#include <stdio.h>

int main() {
    printf("hello, world\n");
    return 0;
}

Run it directly:

$ madc hello.mad
hello, world

Or build a native executable:

$ madc -o hello hello.mad
$ ./hello
hello, world

C, with batteries included

madc also includes practical extensions and helper namespaces that make small programs faster and more pleasant to write.

#include <iostream>

int main() {
    std::string csv = "alice,bob,charlie";

    madc::array names;
    php::explode(names, ",", csv);
    php::sort(names);

    std::string out;
    php::implode(out, ", ", names);

    std::cout << python::title(out) << std::endl;
    return 0;
}
$ madc names.mad
Alice, Bob, Charlie

C gives you control. Scripting languages give you convenience.

madc is designed to give you both.


Why madc?

C without the ceremony

Use madc when you want to write a native program without setting up a project, Makefile, build system, or toolchain wrapper.

madc tool.mad

One file. One command. Native execution.

Native code, native binaries

madc emits real x86-64 machine code and can produce Linux ELF executables.

It is not interpreting your source code. It is not running a bytecode VM. It is compiling and running native code.

Fast repeat runs

madc caches compiled object files, so repeat runs can skip unnecessary recompilation.

That makes it practical for script-like workflows while still using compiled native code.

Batteries included

madc includes embedded headers and namespace helpers inspired by languages like:

  • PHP
  • Python
  • Perl
  • Ruby
  • JavaScript
  • Rust

Use familiar utility functions without pulling in an entire scripting runtime.

Embeddable by design

madc can also be used through libmadc, allowing you to embed a C-like native scripting layer inside your own C/C++ applications.

This makes madc useful not only as a command-line compiler, but also as a runtime component for larger native systems.


Features

  • Real native x86-64 code generation
  • Direct libc usage
  • Linux ELF executable output
  • JIT-style execution from source
  • Object-file caching
  • Preprocessor support
  • Header support
  • Structs, pointers, functions, and ordinary C-style programming
  • Modern C compatibility work, including ongoing C23 support
  • C++-style conveniences where useful
  • Namespace-based helper functions
  • Embedded standard headers
  • Embeddable libmadc API
  • Single-command script-like workflow

Who is madc for?

madc is for developers who like C, but want a faster workflow.

Use it when you want to:

  • write small native utilities without setting up a project
  • prototype systems code quickly
  • build C-like scripts that compile to native machine code
  • ship a single Linux executable
  • embed a native scripting layer inside a C/C++ application
  • use familiar helpers from PHP, Python, Perl, Ruby, JavaScript, and Rust
  • experiment with modern C extensions without leaving native code behind

What madc is not

madc is not trying to replace GCC, Clang, or every production C toolchain.

Use GCC or Clang when you need mature, battle-tested, fully standards-focused compilation across large production codebases and many platforms.

Use madc when you want C with immediacy:

madc program.mad

It is also not Python, Lua, JavaScript, or a scripting VM.

madc borrows the convenience of scripting workflows, but the result is native code.


Explore the wiki

Getting Started

Language Guide

Namespace Helpers

Advanced Topics

Reference


Current status

madc is under active development.

The goal is simple:

real C, native code, script-like workflow, modern convenience.

C, unbound.

Clone this wiki locally