Closed PreviewCompiler source opens July 1, 2026. Playground and binary available today.Join Discord →
MetaScript
Quick Start

Three steps, roughly 5 minutes

Install the compiler, write one file, compile it. You'll leave with a working server and a sense of how the three backends feel from the CLI.

1. Install MetaScript

macOS / Linux:

curl -fsSL https://metascriptlang.org/install.sh | sh

Windows (PowerShell, no admin required):

irm https://metascriptlang.org/install.ps1 | iex

2. Write your first MetaScript

Save as server.ms:

import { HttpRequest, ServerResponse } from "std/http";
import { createServer, sendText, sendJson, serveConcurrent } from "std/http/server";
import { cpuCount } from "std/os";

function main(): void {
    const server = createServer((req: HttpRequest, res: ServerResponse): void => {
        if (req.path === "/ping") { sendText(res, "pong"); return; }
        sendJson(res, JSON.stringify({ path: req.path }));
    });

    const lr = server.listen("127.0.0.1", 9092);
    if (!lr.ok) { console.log("Listen failed: " + lr.error.message); return; }

    const cores = cpuCount();
    console.log("Concurrent server on :9092 (" + cores + " event loops)");
    console.log("Test with: curl http://127.0.0.1:9092/ping");
    console.log("Benchmark: wrk -t4 -c100 http://127.0.0.1:9092/ping");
    console.log("Press Ctrl+C to stop.");
    serveConcurrent(server, cores);
}

3. Run it

msc run server.ms # C is the default target

Hit it from another terminal:

curl http://127.0.0.1:9092/ping    # pong
curl http://127.0.0.1:9092/hello   # {"path":"/hello"}

Power behind the simplicity

Notice what wasn't in the code: no thread pool, no worker management, no mutex. serveConcurrent is backed by Spawn — real OS threads running in parallel across every CPU core. The hardware is fully used; the source reads like JavaScript. That's the point — JavaScript's ease, now at the systems level.

What's Next?