Math-Driven Coding with Automatic Documentation

MADOLA integrates mathematical notation, computation, documentation, and code generation within a single file. Itโ€™s not another wheel โ€” itโ€™s the hub connecting them all.

Source Code
@h2{
Funciton to calculate ฯ€ Using the Leibniz Series
}

@gen_cpp
fn calcPi(n) {
    sum := 0.0;
    for i in 0...n{
        sum := sum + ((-1)^i) / ((2*i)+1);
    }
    return sum * 4;
}
                
HTML Output

Funciton to calculate ฯ€ Using the Leibniz Series

$$\begin{array}{l} \textbf{function } calcPi(n) \\ \left| \begin{array}{l} \quad sum =0 \\ \quad \textbf{for } i \textbf{ in } 0...n \\ \quad \left| \begin{array}{l} \quad sum =sum + \frac{{(-1)}^{i}}{\left(2 \cdot i + 1\right)} \\ \end{array} \right. \\ \quad \text{return } sum \cdot 4 \end{array} \right. \end{array}$$
Generated C++ code and can be compiled to WASM module
#include <cmath>

double calcPi(double n)
{
    double sum = 0;
    for (int i = 0; i <= n; i++) {
        sum = (sum + (pow(-1, i) / ((2 * i) + 1)));
    }
    return (sum * 4);
}
                
Import WASM module and gain 20X speed
from example import calcPi as calc;

x1 := calc(1000);
print(x1);
                
๐Ÿงฎ

Mathematical Syntax

Write equations exactly as you would on paper. MADOLA understands standard mathematical notation natively.

๐Ÿ“

Literate Programming

Built-in documentation generation. Create HTML with LaTeX-style formatting and equations directly from your code.

โšก

High Performance

WASM execution can be 5โ€“25ร— faster than standard AST evaluation. Compile directly to C++ or WebAssembly.

๐ŸŒ

Cross-Platform

Works on Windows, Linux, and macOS. Run locally or deploy to the web with native WASM support.

Why MADOLA?

Feature MADOLA LaTeX / Typst Python / Julia Mathcad
Mathematical Syntax โœ… Native โœ… Excellent โš ๏ธ Library-based โœ… Visual
Executable Code โœ… Yes โŒ Static โœ… Yes โœ… Yes
Web Export (WASM) โœ… Native โš ๏ธ Toolchain โš ๏ธ Heavy โŒ No
Open Source โœ… Apache 2.0 โœ… Yes โœ… Yes โŒ Proprietary