q-runtime
v0.2.0
Published
Runtime library for TypeScript code generated by the Q compiler (qc). Requires Bun.
Maintainers
Readme
q-runtime
Runtime library for TypeScript code generated by the Q compiler qc (Q language spec §17.4): persistent collections (List/Vec, HAMT Map/Set), Result/Option, the algebraic-effect handler machinery, the QAgent actor base class, epistemic types, plans, obligations, and the std.* module stubs (std.io, std.net.http, std.db.sqlite, ...).
Install
bun add q-runtimeUsage
Compile a Q program with package imports and run it with Bun:
qc compile program.q --runtime package -o program.ts
bun program.tsThe generated code then imports this package instead of a repository path:
import { qListOf, Ok, Err /* ... */ } from "q-runtime";
import * as http from "q-runtime/std/net.http";Notes
- Bun is required. The package ships plain TypeScript sources (no JS build);
std/db.sqliteusesbun:sqliteand the HTTP server usesBun.serve. Node is not supported. - Type-checking consumers need
moduleResolution: "bundler"(or"node16"+ withallowImportingTsExtensions) so the exports map resolves to the.tssources.
