Skip to content

CLI Reference

Derek Snider edited this page May 19, 2026 · 2 revisions

CLI Reference

Basic usage

madc <file.mad> [args...]

JIT-compiles and runs the program. Any arguments after the filename are passed as argc/argv to main().

Flags

Flag Description
-v / --verbose Enable debug trace output (tokenizer, parser, compiler)
-o <output> Generate a native ELF executable instead of JIT-running

Examples

# Run a program
madc hello.mad

# Run with arguments
madc script.mad arg1 arg2

# Debug trace
madc -v hello.mad

# Compile to native executable
madc -o hello hello.mad
./hello

Shebang

Make .mad files directly executable:

#!/usr/bin/env madc
#include <stdio.h>

int main() {
    printf("I'm a script!\n");
    return 0;
}
chmod +x script.mad
./script.mad

OBJ caching

madc caches compiled object files. The first run JIT-compiles your program; subsequent runs load from cache for faster startup. Caching is automatic — no flags needed.

What's next?

Clone this wiki locally