Velqu discovers routes at build time — no dry-run, no side effects — and emits app.qpack: a deterministic binary containing QuickJS bytecode, a serialized numeric router, schema IR, and integrity hashes. Production startup does zero compilation, zero transpilation, zero route discovery. The Rust host routes by method and path before JavaScript ever runs.
01 — Overview
Velqu is a TypeScript web framework whose production execution is a Rust host with a pinned QuickJS engine. Bun is dev, package, and test tooling only — it never runs your app in production.
The compiler statically analyzes your TypeScript — the application is never dry-run, no service factories fire, no side effects occur during discovery. Handler references resolve once after load and stay cached.
Production startup performs no route, schema, OpenAPI, or plugin compilation and no TypeScript transpilation. The runtime maps the QPack binary and serves: 4.21 ms pack load and 1.29 ms bundle load for a 25-route app (p50, route-count-1789054694139).
Queues, bodies, jobs, heap, stack, and deadlines are all bounded. Native handles are opaque, generation-checked, and expire at settlement. Expected failures are typed values with declared statuses (RFC 9457 problems); unexpected errors are redacted before leaving the host.
A single schema definition drives TypeScript types, runtime validation, the typed Treaty test client, OpenAPI, and the contract lock. Request data crossing into JS is lazy — unread fields are never materialized.
02 — How it works
The compiler never executes your app; the runtime never compiles anything. Everything crossing that boundary lives in one verifiable binary.
Typed routes, schemas, policies — plain TypeScript.
defineApp / defineModules.object schemasStatic analysis + bundling. No dry-run.
Binary artifact (QPack v2) loaded by the Rust host.
Hyper ingress → Rust routes by method/path before JavaScript handler execution → worker-local, generation-checked request slab → lazy headers/query/cookies/body (unread fields never materialized) → numeric RoutePlan dispatch → typed settlement.
Same-process QuickJS runs trusted application code only — it is not a hostile-code sandbox. Outbound fetch, SSRF policy, and capability gating are native and explicit (ADR-0033/0035).
03 — Code
Real code from the repository's proof service — these files exist and their responses were executed end-to-end. Two full external-consumer journeys (webhook relay, Postgres CRUD) install from npm and serve on the runtime; their recorded transcripts live in scripts/beta-external.
// examples/proof/src/modules/hello/routes.ts import { route } from "@velqu/core"; import { s } from "@velqu/schema"; export const hello = route({ id: "hello.get", method: "GET", path: "/hello/:name", params: s.object({ name: s.string({ minLength: 1, maxLength: 60 }), }), response: { 200: s.object({ message: s.string() }) }, handle: ({ params }) => ({ message: `Hello ${params.name}` }), });
// examples/proof/src/modules/users/routes.ts — validated body, declared // failures as typed problems, policy-gated reads export const create = route({ id: "users.create", method: "POST", path: "/users", body: s.object({ name: s.string({ minLength: 1, maxLength: 60 }), email: s.string({ format: "email" }), }), response: { 201: s.object({ id: s.string(), name: s.string(), email: s.string() }) }, handle: async ({ body }) => { const svc = resolve(); // lazy factory, first use const u = svc.create(body.name, body.email); return status(201).value(u); }, }); export const get = route({ id: "users.get", method: "GET", path: "/users/:id", policy: sessionPolicy, // native-checked policy params: s.object({ id: s.string({ pattern: "^usr_[0-9]+$" }) }), response: { 200: s.object({ /* … */ }) }, handle: async ({ params }) => { const u = resolve().get(params.id); if (!u) return status(404).problem("not-found", { detail: "user not found" }); return u; // typed 200 | 404 union }, });
// Treaty — the typed client generated from the same contract import { treaty } from "@velqu/treaty"; import type { Api } from "./dist/contract"; import contract from "./dist/contract.json"; const api = treaty<Api>({ baseUrl: "http://127.0.0.1:3000", contract }); const health = await api.health.live.get(); // navigation follows route ids; params come before the method, // and query/headers/body are checked against the route's schema const created = await api.users.create({}).post({ name: "Ada", email: "ada@example.org", }); // the response union distinguishes declared failures from success
# scaffold from the published CLI (npm registry) bun add -g @velqu/cli@beta velqu create hello-velqu && cd hello-velqu bun install # @velqu/* from npm — no checkout needed bun run check && bun run build # → dist/app.qpack (+ route plan, # OpenAPI, contract lock, build report) velqu inspect --project . --json # inspect without executing handlers # production: the Rust runtime only ever loads the compiled pack # (built once from source: cargo build --release -p velqu-runtime) ./target/release/velqu-runtime --pack dist/app.qpack --port 8080
04 — Benchmarks
No universal speed claims — Velqu does not claim universal superiority over any runtime; performance is workload-, fixture-, and hardware-dependent. What you see here is the archived September 10 gate runs for this host and these fixtures, with losses shown next to wins.
Release builds (--release only) · loopback HTTP/1.1 · frozen proof fixtures · randomized candidate order · Linux x86_64 glibc · 13th-gen Intel Core i5-13420H · Bun 1.4.0 toolchain · Elysia dependency pin: 2.0.0-beta.4. The baseline README records older tooling versions; the displayed cold-run environment records Bun 1.4.0. Full matched executable/version fingerprints are not present in the warm summary, so these are archived fixture observations, not a latest-version ranking. Route-count runtime SHA-256: c52385af2d56. raw-rust is a transport lower bound, not a feature-equivalent framework. All runs are local-process, single-host, trusted-code-only, and non-SLA — no cloud or scale-to-zero inference. Raw samples are retained in the repository.
Every class boots a fresh Velqu process; 60 samples per class, zero failures. C0 (violet) is answered by the Rust host before JavaScript runs; every other class executes a JavaScript handler.
| class | what it measures | p50 ms | p95 ms | p99 ms | RSS p50 MiB |
|---|---|---|---|---|---|
C0 | health.live — static response served by the Rust host before JavaScript | 6.61 | 9.33 | 10.87 | 8.2 |
C1 | js.text — JS handler returning text | 6.86 | 11.51 | 14.67 | 8.2 |
C2 | js.json — JS handler returning JSON | 6.68 | 9.94 | 11.19 | 8.2 |
C3 | hello.get — JS handler with a validated path parameter | 6.66 | 11.86 | 12.74 | 8.2 |
C3b | users.create — JS handler with a validated request body (POST) | 6.44 | 13.60 | 14.74 | 8.2 |
C4 | users.get — JS handler behind a session policy | 7.52 | 11.69 | 14.78 | 8.8 |
C5 | async.timer — async JS handler resolved by a timer | 18.12 | 21.20 | 21.88 | 8.2 |
run cold-1789054622405 · 60 samples/class · 0 failures across all classes · raw benchmarks/raw/cold-start/cold-1789054622405.jsonl · summary JSON
Honest reading: on JavaScript-handler classes (C1) raw Bun and raw Rust are faster than Velqu — the table shows measured results, not a causal attribution of the difference. At C0 concurrency 10, Velqu leads this fixture; at concurrency 50, raw Rust leads. These are medians of individual runs, not pooled request percentiles. Memory is where Velqu separates clearly: ~8.4 MiB vs 32.8 MiB (raw-bun) and 59.0 MiB (elysia2) at C1 c=10.
| candidate | c=1 · rps · p50µs | c=10 · rps · p50µs | c=50 · rps · p50µs | RSS MiB @c=10 | |||
|---|---|---|---|---|---|---|---|
| C0 — static health (served by the Rust host) | |||||||
| velqu | 15,195 | 48.3 | 60,959 | 130 | 82,106 | 491 | 8.1 |
| raw-rust | 14,948 | 47.5 | 48,183 | 158 | 83,739 | 491 | 4.0 |
| raw-bun | 9,829 | 67.6 | 43,963 | 179 | 58,354 | 801 | 36.1 |
| elysia2 | 10,440 | 63.8 | 45,589 | 175 | 50,454 | 909 | 57.3 |
| C1 — JS text handler | |||||||
| velqu | 6,996 | 104 | 38,556 | 181 | 52,614 | 792 | 8.4 |
| raw-rust | 11,503 | 56.0 | 56,394 | 137 | 70,274 | 595 | 4.0 |
| raw-bun | 13,405 | 45.6 | 47,444 | 158 | 46,939 | 946 | 32.8 |
| elysia2 | 9,734 | 61.8 | 42,008 | 184 | 60,613 | 667 | 59.0 |
run warm-1789054920075 · seed 2763789528 · 5 randomized repetitions × 10s per cell · 0 errors across all candidates · raw benchmarks/raw/warm/warm-1789054920075.jsonl · summary JSON
In this run, Velqu cold-start cost grows with route count: p50 113.8 ms at 1,000 routes and 1282 ms at 10,000. The chart is categorical on the x-axis and logarithmic on the y-axis. It measures startup only; it does not establish where other frameworks spend their time or their per-request cost.
| candidate | 25 | 100 | 1,000 | 5,000 | 10,000 | RSS MiB @10k |
|---|---|---|---|---|---|---|
| velqu (bytecode) | 7.87 | 15.35 | 114 | 584 | 1282 | 306.1 |
| velqu (source) | 9.06 | 16.51 | 122 | 591 | 1307 | 306.5 |
| raw-bun | 9.98 | 9.04 | 8.60 | 9.08 | 9.47 | 19.5 |
| elysia2 | 152 | 175 | 192 | 284 | 402 | 95.9 |
run route-count-1789054694139 · 40 fresh processes per cell, randomized order · p50 cold start, ms · raw benchmarks/raw/route-count/route-count-1789054919962.jsonl · summary JSON
05 — Status
Progress is determined by evidence, not calendar pressure. The production-readiness track (ADR-0019) stands at 94 of 120 tracked tasks PASS.
Exact numeric IR, compiled terminal router, integrity-bound execution graph, self-verifying evidence indexes.
Worker-local request slab, schema-specialized JSON pipelines, reproducible binary artifacts, capability ABI (URL, timers, TextEncoder, AbortController, crypto random), bounded outbound fetch with SSRF policy.
Bounded worker dispatcher, runtime profiles (serverless / service:N), quarantine and readiness aggregation; dev loop, CLI surface, Treaty modes, proof service.
Seven @velqu/* packages under the beta dist-tag (latest intentionally unset), verified post-publish from the registry.
72-hour soak r4 PASS (2026-09-23) with merge-enforced perf gates; fuzz and sanitizer campaigns; reproducible builds; native Prometheus /metrics exporter; release signing and disaster-recovery drills in progress. RC selection and publisher-key provisioning await owner decisions.
06 — Packages
Seven packages are live at 0.1.0-beta.1 under the beta dist-tag. Reference capabilities and internal tooling stay in the repository until their GA gates close.
| name | role | availability |
|---|---|---|
| @velqu/core | app, module, route, policy primitives | npm · 0.1.0-beta.1 |
| @velqu/schema | schema builders (s.*) and IR | npm · 0.1.0-beta.1 |
| @velqu/contract | compiled contract metadata + lock | npm · 0.1.0-beta.1 |
| @velqu/treaty | typed end-to-end test client | npm · 0.1.0-beta.1 |
| @velqu/compiler | build-time route discovery and packing | npm · 0.1.0-beta.1 |
| @velqu/cli | velqu create / build / inspect / dev | npm · 0.1.0-beta.1 |
| @velqu/browser-runtime | WASM browser kernel (ADR-0037) | npm · 0.1.0-beta.1 |
| velqu-runtime | production Rust host binary | repo release builds · Linux x86_64 |
| capability-postgres / capability-auth-jwt | reference capabilities (M5) | repo |
| testing / publishing | runtime-local Treaty harness, packaging invariants | repo |