Skip to content
This repository was archived by the owner on Aug 12, 2026. It is now read-only.

Commit b9c426d

Browse files
committed
S1 closes with two named residues, and S2 opens on 0020's keys
The stop condition asked for a component this project did not author, calling and being called, with every WIT type a shipped release can express. The types hold in both directions and the un-authored zoo.wit is called through reflection alone. What did not close is recorded in the roadmap rather than rounded up: the calling side is exercised only by repo-authored guests (a real third-party component would take a Rust toolchain the flake deliberately does not carry), and a resource nested in a container in an import's signature stays a named refusal. The README's five minutes now ends where a user's second question starts: generate a namespace, and unwrap is the result sugar. Claude-Session: https://claude.ai/code/session_01XF5Hfq4Ca2N2XYEzWQQuHt
1 parent e3a96b1 commit b9c426d

3 files changed

Lines changed: 45 additions & 26 deletions

File tree

‎README.md‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,21 @@ resolution order).
6666

6767
WIT values arrive as the Clojure data you would guess: `record` → map,
6868
`variant` → `[:tag payload]`, `enum` → keyword, `flags` → set, `option` →
69-
value-or-nil, `result` → `[:ok v]`/`[:err e]`, resources → `AutoCloseable`
70-
handles. The full mapping — and why it is not negotiable — is
69+
value-or-nil, `result` → `[:ok v]`/`[:err e]` (with `host/unwrap` as the
70+
opt-in throw-on-err sugar), resources → `AutoCloseable` handles. The full
71+
mapping — and why it is not negotiable — is
7172
[`doc/design/0012`](doc/design/0012-wit-clojure-type-mapping.md).
7273

74+
Prefer names an editor can complete and clj-kondo can arity-check? Generate
75+
an ordinary namespace and check it in
76+
([`doc/design/0020`](doc/design/0020-generated-namespaces.md)):
77+
78+
```clojure
79+
(require '[cljwit.host.gen :as gen])
80+
(gen/write-ns! "component.wasm" {:ns 'acme.component})
81+
;; => "src/acme/component.clj" — then: (acme.component/greet i "world")
82+
```
83+
7384
## Why now
7485

7586
Three things landed that were not true a year ago:

‎doc/roadmap.md‎

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,21 @@ gate red outside `nix develop`. When it is built it should be a generated
8383
exports are ordinary functions — is what S1 delivers instead (`0014`).
8484

8585
**Stop condition.** A component this project did not author, calling and being
86-
called, with every WIT type a shipped release can express. Two of the three
87-
hold: `dev/resources/zoo.wit` is the un-authored component, and `0012`'s rows
88-
are marshalled in both directions except `map`, `list<T,N>`, `stream`/`future`
89-
and `error-context`, none of which are in a shipped release. Host imports are
90-
the third (`0017`).
86+
called, with every WIT type a shipped release can express.
87+
88+
**Closed 2026-07-30, with two named residues.** Every `0012` row a shipped
89+
release can express marshals in both directions (`0016`–`0018`), the
90+
un-authored `zoo.wit` is called through reflection alone, and host imports,
91+
WASI and resources work in both ownerships. What did not close, recorded
92+
rather than rounded up:
93+
94+
- **The calling side is exercised only by guests this repo wrote.** A real
95+
third-party component that calls its host would take a Rust toolchain this
96+
flake deliberately does not carry. The first such component to misbehave
97+
against `cljwit.host` reopens this.
98+
- **A resource nested in a container in an import's signature** is refused at
99+
instantiate (`:nested-resource`) rather than marshalled. The first real
100+
component that needs the shape reopens it.
91101

92102
### S2 — Developer experience skeleton (weeks)
93103

‎doc/status.md‎

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,29 @@
33
_Short by design, and printed at every session start — so findings live in
44
`doc/design/`, plans in `doc/roadmap.md`, and only the present tense here._
55

6-
**Updated:** 2026-07-30 · **Phase:** S1 delivered, closing (pre-alpha, no compiler)
6+
**Updated:** 2026-07-30 · **Phase:** S1 closed, entering S2 (pre-alpha, no compiler)
77

88
## Next
99

10-
1. **Close S1 against its stop condition.** What remains of "a component this
11-
project did not author, calling and being called, with every WIT type a
12-
shipped release can express": the un-authored component (`zoo.wit`) is
13-
*called*; the *calling* side is exercised only by guests this repo wrote.
14-
One named capability gap: **a resource nested in a container in an
15-
import's signature is refused at instantiate** (`:nested-resource`) rather
16-
than marshalled — `import-stub` routes only whole parameters/results
17-
through the rep table. Accepted until a real component needs the shape;
18-
the first one that does reopens it.
19-
2. **The ergonomics layer (`0015` revisited).** Its blockers are gone —
20-
marshalling and host imports both exist — so the generated-`.clj` shape
21-
("not a macro, and the instance not ambient") is buildable now. Decide
22-
whether S1 ships with it or it opens S2.
23-
3. **S2 — developer experience skeleton** (`doc/roadmap.md`): `cljwit.edn`,
24-
an nREPL entry point, the shadow-cljs shape.
10+
1. **S1 is closed with two named residues** (`doc/roadmap.md` records them):
11+
the calling side is exercised only by repo-authored guests — a real
12+
third-party component reopens it — and a resource nested in a container
13+
in an import's signature is refused at instantiate (`:nested-resource`)
14+
rather than marshalled.
15+
2. **S2 — developer experience skeleton** (`doc/roadmap.md`): `cljwit.edn`,
16+
an nREPL entry point, the shadow-cljs shape. `0020` opened it: the
17+
generator's option keys (`:ns`, `:interface`, `:rename`, `:dir`) are
18+
`cljwit.edn`'s keys, and the regenerate-and-diff drift check the
19+
generated files cannot do for themselves belongs there.
2520

2621
Done since the last update: `0016` `own<T>` handles, `0017` host imports
2722
(A–F), `0018` host-defined resources, `0012`'s `ex-data` contract shrunk to
28-
what reflection can supply, `0019` libwasmtime resolution for library users.
29-
What is left of `0012` is `map`, `list<T,N>`, `stream`/`future` and
30-
`error-context`, none of which a shipped release can express.
23+
what reflection can supply, `0019` libwasmtime resolution for library users,
24+
`0020` generated namespaces (`cljwit.host.gen` — one tagged var per export,
25+
instance first, `host/unwrap` as the opt-in result sugar), `host/describe`,
26+
and the reflection delete contracts the headers require. What is left of
27+
`0012` is `map`, `list<T,N>`, `stream`/`future` and `error-context`, none of
28+
which a shipped release can express.
3129

3230
## Where we are
3331

0 commit comments

Comments
 (0)