1. Install MetaScript
macOS / Linux:
curl -fsSL https://metascriptlang.org/install.sh | shWindows (PowerShell, no admin required):
irm https://metascriptlang.org/install.ps1 | iex2. 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 targetHit 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?
- Editor Setup — Syntax highlighting, autocomplete, LSP for VS Code / Neovim / Zed
- Multiple Runtimes — Compile to C, JS, or WebAssembly