This repository was archived by the owner on Aug 12, 2026. It is now read-only.
Repository navigation
Commit 0d0c736
committed
Host imports, scalar slice: a component can call Clojure through cljwit.host
(host/instantiate art {:imports {"local:imp/host@0.1.0#twice" (fn [v] (* 2 v))}})
((i "run") 20) ;=> 41
An upcall stub per import, built from the reflected import type the same way
export marshallers are, and bound to a Clojure reify. Missing imports stay
wasmtime's to report -- its message names the interface and the function, which
0017's first draft denied and one command disproved. What the host checks is
the other direction: a key nobody needs is a typo, and silently ignoring it is
the nil-on-typo failure 0014 rejected.
An exception in an import surfaces to the caller with its own message and marks
the instance dead. That is not politeness -- measured, such an error poisons the
whole store, so without the flag every later call reports "cannot enter
component instance" with the cause gone. Fault injection: removing the marking
turns the suite red, so the assertion is not decorative.
Scalars only, deliberately. Anything wasmtime would have to free -- a string, a
list, a boxed option -- needs lower-fn to allocate with malloc rather than from
an Arena (0017 C), and handing wasmtime an Arena pointer to free() is heap
corruption rather than a wrong answer. Refused at instantiate with the kind
named, the same shape the export direction uses.
97 assertions.
Claude-Session: https://claude.ai/code/session_01XF5Hfq4Ca2N2XYEzWQQuHt1 parent 8038572 commit 0d0c736
3 files changed
Lines changed: 261 additions & 83 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | 1 | | |
6 | 2 | | |
7 | 3 | | |
| |||
0 commit comments