Grasm v1.0.0 Get started

More

Examples

Not snippets. 44 whole programs, 15,536 lines, each one checked on three engines for identical output, exit code and diagnostics.

Systems

HTTP server

377 lines. Sockets, routing, request parsing.

SQL engine

583 lines. Parser, planner, execution.

Micro VM

A bytecode machine.

Garbage collector

Written in a language with no garbage collector.

DNS resolver

Wire format, UDP.

Turing machine

Because the tests needed one.

Tools and formats

JSON parser

375 lines, and a package.

Markdown to HTML

A package too.

SHA-256

Bit operations, byte handling.

grep

Files, patterns, streams.

Self-hosting lexer

Grasm, lexing Grasm.

Expression REPL

Parse, evaluate, loop.

Concurrent

Multithreaded scraper

Parallel fetches, joined.

Async chat

Many connections, one process.

Sorting benchmark

Where the performance numbers come from.

In a browser

10 programs compiled to wasm and run in a tab with no server: a fullstack counter, user registration, a voting app, a blog dashboard, a markdown editor, an upload gallery, a chat router, a collaborative todo list, a SPA router and realtime analytics. Both the count and the list come from the tree — a program runs in a tab when there is a page beside it — because this sentence said twelve while naming three that have none.

All of them live under ProjectGold/ in the repository, with the expected output recorded beside each.