writeonce/crates
2026-07-12 03:40:30 +02:00
..
app scaffold sibling crates, multi-app ecommerce, REST + concurrency docs 2026-05-04 13:39:58 +02:00
db scaffold sibling crates, multi-app ecommerce, REST + concurrency docs 2026-05-04 13:39:58 +02:00
engine scaffold sibling crates, multi-app ecommerce, REST + concurrency docs 2026-05-04 13:39:58 +02:00
gen scaffold sibling crates, multi-app ecommerce, REST + concurrency docs 2026-05-04 13:39:58 +02:00
http scaffold sibling crates, multi-app ecommerce, REST + concurrency docs 2026-05-04 13:39:58 +02:00
logic scaffold sibling crates, multi-app ecommerce, REST + concurrency docs 2026-05-04 13:39:58 +02:00
policy scaffold sibling crates, multi-app ecommerce, REST + concurrency docs 2026-05-04 13:39:58 +02:00
ql scaffold sibling crates, multi-app ecommerce, REST + concurrency docs 2026-05-04 13:39:58 +02:00
rt laanguage prototype 2026-07-12 03:40:30 +02:00
service scaffold sibling crates, multi-app ecommerce, REST + concurrency docs 2026-05-04 13:39:58 +02:00
sub scaffold sibling crates, multi-app ecommerce, REST + concurrency docs 2026-05-04 13:39:58 +02:00
txn scaffold sibling crates, multi-app ecommerce, REST + concurrency docs 2026-05-04 13:39:58 +02:00
ui scaffold sibling crates, multi-app ecommerce, REST + concurrency docs 2026-05-04 13:39:58 +02:00
value scaffold sibling crates, multi-app ecommerce, REST + concurrency docs 2026-05-04 13:39:58 +02:00
wal scaffold sibling crates, multi-app ecommerce, REST + concurrency docs 2026-05-04 13:39:58 +02:00
README.md Pivot to the .wo language runtime: design docs, phase plans 2026-04-21 02:48:45 +02:00

crates/ — the .wo runtime

Fifteen crates make up the new runtime. Only rt/ carries real code today (Stage 2); the other fourteen are empty placeholders scaffolded to match the 7-phase design so each phase's extraction work becomes a mechanical code move into an existing home.

The crate-name prefix wo- was dropped when the active project namespaced itself under wo (the binary, the file extension, the language). Internal imports read cleanly: use ql::Parser, use db::Tx, use http::router. The v1 codebase keeps its wo-* prefix in reference/crates/ to distinguish the generations.

Map

Phase Crate Purpose Status
2 ql .wo grammar — lexer, parser, AST placeholder
2 value tagged Value + dotted-path helpers placeholder
2 engine in-memory executor (rel / doc / graph) + schema catalog placeholder
2 txn transaction coordinator — MVCC, RETURNING alias table placeholder
2 db top-level facade — open(), Tx, Query, Subscribe placeholder
3 wal write-ahead log — io_uring + fsync + recovery placeholder
4 sub live subscriptions — delta frames on commit placeholder
4 http wire protocol — REST / GraphQL-over-WS / native codec placeholder
5 gen codegen — .wo type → Go / TS / Rust / Python clients placeholder
6 policy RBAC + row-level rules compiled into planner rewrites placeholder
6 logic on <event> triggers + fn ... in txn interpreter placeholder
6 service service rest/graphql/native endpoint dispatch placeholder
6 ui ##ui screens → SSR HTML + client runtime placeholder
6 app ##app route manifest + startup hooks placeholder
— rt active — Stage-2 monolith + the wo binary shipped

Why rt/ is monolithic right now

rt/ currently holds every module the runtime needs — lexer, parser, AST, in-memory engine, axum REST server — because shipping working Stage 2 was more important than hitting the final crate layout on day one. Each module inside rt/src/ is written with a target home in mind:

rt module Moves to Phase
token.rs + lexer.rs + ast.rs + parser.rs ql/ 2
engine.rs (Value + Row helpers) value/ 2
engine.rs (Engine + Catalog) engine/ 2
compile.rs engine/ 2
server.rs http/ + service/ 4 / 6
bin/wo.rs stays in rt/ (the binary) —

Extractions happen phase-by-phase — first one lands when a second caller appears (likely when Stage 3 needs the parser for raw-.wo HTTP requests).

Build & test

cargo build                                   # compiles all 15 crates
cargo test --lib                              # 14 unit tests (all in rt today)
cargo run --bin wo -- run docs/examples/blog  # serve the blog sample

What's outside this directory