Build a formally verified Lean web app runtime with an agent

Lasm compiles Lean 4 to WebAssembly. Task: Lasm compiles Lean 4 to WebAssembly. You write your app in Lean, prove what matters about it, and run it on Node.js, Bun, Deno, Cloudflare Workers, Vercel, Netlify, Deno Deploy, Supabase, AWS Lambda, Azure Functions, Google Cloud Functions, Fastly Compute, WASI runtimes and the browser. The flagship example, Conduit, is the RealWorld app written entirely in Lean, with 52 proved propositions (307 theorems). It passes RealWorld's official API and browser test suites on every platform in the table below. If Lasm is useful to you, I'd appreciate your sponsorship (more below). Where it runs, and the evidence Every platform below is tested in CI, using the platform's own runtime, container image or local emulator. CI never deploys to a real cloud account, so "tested" means the platform's local tooling, not production (full details). Node builds have Lean's full runtime (threads, files, processes, sockets). The other targets run Lean single-threaded, without sockets or processes (and without files, except on WASI); the rest of Lean works. Quick facts Start here Every example has a README with a one-command run; examples/README.md lists them all. Flagship example: Conduit, with 52 proved propositions (307 theorems) examples/conduit is Conduit, the RealWorld app (a Medium clone), written entirely in Lean: the REST API, the server-rendered browser app and the proofs. 52 proved propositions (307 theorems) about the code that actually runs, checked with no sorry and only Lean's standard axioms (npm run proofs; PROOFS.md lists each one in plain English). They cover authorization (only authors change their articles and comments), follows and favorites, slugs that never collide, pagination that never skips or repeats, validation shared by client and server (the app never sends what the server would reject), JSON round trips and Markdown link safety. The endpoints are written against a Store of functions, and the proofs run that same code on a model of the tables. What is trusted, not proved: that each SQL statement does what its model says, the JSON text layer, concurrency between requests, and Lean, Lasm and the JavaScript runtime. Conformance to the whole RealWorld spec is tested, not proved. API: the official RealWorld API suite passes unmodified (13 of 13 files, 154 requests) on every platform in the table above, each served by that platform's own local tooling. Each platform has one small hand-written store binding: SQLite where it has one (node:sqlite, D1, bun:sqlite), else its key-value store (Deno KV, Netlify Blobs, Fastly KV) or Postgres (Supabase, wasi-http) (the platform table). Frontend: Lasm.UI on RealWorld's official templates, with server-side rendering, hydration and Markdown parsed in Lean. The official Playwright end-to-end suite passes with no retries on Node with Chromium, Firefox and WebKit, and on every other platform with Chromium. All of this runs in CI (conduit.yml and conduit-platforms.yml, runs 41237971322 and 41237971361, with @lasm/cli 0.3.5). 60-second start A single file needs no project. Save this complete program as Main.lean: The first build on a new machine fetches Lean and the build tools once (about 250–275 MB; 19 s for that first build on the Linux CI runner). Later dev builds of a one-line change take about 1–2 s. Recipes Each recipe is complete: create, develop, build, deploy. Lasm never installs or starts a platform's own CLI (wrangler, vercel, fastly, …); you run those. npm run dev is lasm dev: it rebuilds about 2 s after each save and restarts the server, and keeps the last good build running when there is a type error. Node server (Hono; also express, fastify, std-http, fetch). AWS Lambda / Vercel / Netlify / Azure / Google Cloud Functions. Cloudflare Workers (and Vercel Edge, Netlify Edge, Deno Deploy, Supabase). Fastly Compute, WASI, Spin. Browser app. Full stack (server + browser + verified API). Editor. Run npx lasm editor once per project; lasm init, lasm dev and lasm build also do it. The Lean editor (VS Code's Lean 4 extension) then resolves import Lasm.* (details). The whole stack in Lean, verified The fullstack template is one Lean project with a server (Lasm.Fetch), a browser app (Lasm.UI) and the API between them (Lasm.RPC). The rule a request must satisfy is written and proved once, in Shared.lean, which both sides import (templates/fullstack): Where proofs live and how they are checked.; tools: Claude. Human role: The original post does not say how a person stayed involved.; limitations: Prerequisites include installing Lean 4 and Lasm CLI. Node.js builds support full runtime features (threads, sockets), while other targets (e.g., Cloudflare Workers) run single-threaded without sockets or processes. CI tests use local emulators, not real cloud accounts, so production behavior may differ. The source is a GitHub repository README, which is reliable for technical claims but lacks business impact data. Human approval is necessary for deploying to real cloud environments..

Tools

Claude

Published on Agent Work Atlas:

Overview

Lasm compiles Lean 4 to WebAssembly.

Workflow

Lasm compiles Lean 4 to WebAssembly. You write your app in Lean, prove what matters about it, and run it on Node.js, Bun, Deno, Cloudflare Workers, Vercel, Netlify, Deno Deploy, Supabase, AWS Lambda, Azure Functions, Google Cloud Functions, Fastly Compute, WASI runtimes and the browser. The flagship example, Conduit, is the RealWorld app written entirely in Lean, with 52 proved propositions (307 theorems). It passes RealWorld's official API and browser test suites on every platform in the table below. If Lasm is useful to you, I'd appreciate your sponsorship (more below). Where it runs, and the evidence Every platform below is tested in CI, using the platform's own runtime, container image or local emulator. CI never deploys to a real cloud account, so "tested" means the platform's local tooling, not production (full details). Node builds have Lean's full runtime (threads, files, processes, sockets). The other targets run Lean single-threaded, without sockets or processes (and without files, except on WASI); the rest of Lean works. Quick facts Start here Every example has a README with a one-command run; examples/README.md lists them all. Flagship example: Conduit, with 52 proved propositions (307 theorems) examples/conduit is Conduit, the RealWorld app (a Medium clone), written entirely in Lean: the REST API, the server-rendered browser app and the proofs. 52 proved propositions (307 theorems) about the code that actually runs, checked with no sorry and only Lean's standard axioms (npm run proofs; PROOFS.md lists each one in plain English). They cover authorization (only authors change their articles and comments), follows and favorites, slugs that never collide, pagination that never skips or repeats, validation shared by client and server (the app never sends what the server would reject), JSON round trips and Markdown link safety. The endpoints are written against a Store of functions, and the proofs run that same code on a model of the tables. What is trusted, not proved: that each SQL statement does what its model says, the JSON text layer, concurrency between requests, and Lean, Lasm and the JavaScript runtime. Conformance to the whole RealWorld spec is tested, not proved. API: the official RealWorld API suite passes unmodified (13 of 13 files, 154 requests) on every platform in the table above, each served by that platform's own local tooling. Each platform has one small hand-written store binding: SQLite where it has one (node:sqlite, D1, bun:sqlite), else its key-value store (Deno KV, Netlify Blobs, Fastly KV) or Postgres (Supabase, wasi-http) (the platform table). Frontend: Lasm.UI on RealWorld's official templates, with server-side rendering, hydration and Markdown parsed in Lean. The official Playwright end-to-end suite passes with no retries on Node with Chromium, Firefox and WebKit, and on every other platform with Chromium. All of this runs in CI (conduit.yml and conduit-platforms.yml, runs 41237971322 and 41237971361, with @lasm/cli 0.3.5). 60-second start A single file needs no project. Save this complete program as Main.lean: The first build on a new machine fetches Lean and the build tools once (about 250–275 MB; 19 s for that first build on the Linux CI runner). Later dev builds of a one-line change take about 1–2 s. Recipes Each recipe is complete: create, develop, build, deploy. Lasm never installs or starts a platform's own CLI (wrangler, vercel, fastly, …); you run those. npm run dev is lasm dev: it rebuilds about 2 s after each save and restarts the server, and keeps the last good build running when there is a type error. Node server (Hono; also express, fastify, std-http, fetch). AWS Lambda / Vercel / Netlify / Azure / Google Cloud Functions. Cloudflare Workers (and Vercel Edge, Netlify Edge, Deno Deploy, Supabase). Fastly Compute, WASI, Spin. Browser app. Full stack (server + browser + verified API). Editor. Run npx lasm editor once per project; lasm init, lasm dev and lasm build also do it. The Lean editor (VS Code's Lean 4 extension) then resolves import Lasm.* (details). The whole stack in Lean, verified The fullstack template is one Lean project with a server (Lasm.Fetch), a browser app (Lasm.UI) and the API between them (Lasm.RPC). The rule a request must satisfy is written and proved once, in Shared.lean, which both sides import (templates/fullstack): Where proofs live and how they are checked.

Reported result

The source reports that the flagship example, Conduit, passes the official RealWorld API suite (154 requests) and browser tests on all supported platforms using local CI tooling. It includes 52 proved propositions (307 theorems) with no 'sorry' placeholders. However, actual production performance, real-world user adoption, or specific business outcomes are not reported. A measurable acceptance check would be to verify that a new Lean module compiles to WASM and passes the RealWorld API test suite locally.

Human role

The original post does not say how a person stayed involved.

Limitations

Prerequisites include installing Lean 4 and Lasm CLI. Node.js builds support full runtime features (threads, sockets), while other targets (e.g., Cloudflare Workers) run single-threaded without sockets or processes. CI tests use local emulators, not real cloud accounts, so production behavior may differ. The source is a GitHub repository README, which is reliable for technical claims but lacks business impact data. Human approval is necessary for deploying to real cloud environments.

Try it

I want to build a formally verified web application using Lean 4 and Lasm. Please guide me through setting up a new project. First, help me write a simple Lean module that defines a data structure and proves a basic property (e.g., that a function is idempotent). Then, show me how to compile this module to WebAssembly using Lasm. Finally, provide the commands to run the RealWorld API test suite locally to verify the build. I will review the proofs and test results before proceeding to any deployment. If any steps are unclear or if I need to install specific tools, please ask me for clarification. Do not deploy to any cloud service without my explicit confirmation.

Original source

Source reports are not independently verified. Publication date is the catalog publication date, not the original article date.

More cases · Software & development