Expand description
escriba-vm — escriba’s embedded tatara-lisp runtime.
Hosts a tatara_lisp_eval::Interpreter parameterized over
EscribaHost. Lisp code runs the full language (arithmetic,
lists, if/let/lambda/begin via install_primitives) and
interacts with the editor through native functions:
- reads (
cursor-line,current-line,editor-mode, …) answer from aEditorSnapshotcaptured before eval, so the host owns no borrows and satisfiesInterpreter<H>’sH: 'staticbound; - writes (
message,insert,set-option,run-command) push typedHostEffects onto an accumulating log.
The effect boundary is the sandbox seam (the “terreiro”): Lisp can never corrupt editor state directly — it can only request typed, validated mutations that the runtime applies after eval. It is also the seam through which polyglot WASM/WASI plugins are hosted: a plugin authored in any language is driven by the same tatara-lisp host and emits the same typed effects, so the editor’s apply path is identical regardless of plugin language.
This is the imperative tier of escriba’s two-tier programmability
model — the declarative tier is escriba-lisp’s def-forms.
Structs§
- Editor
Snapshot - Read-side snapshot of editor state, captured before eval so Lisp can
query without borrowing live state. Integer fields are
i64to marshal directly to the LispIntvalue. - Escriba
Host - The Lisp host: a read snapshot + an accumulating effect log. Owned
(no borrows) so it satisfies
Interpreter<H>’sH: 'static; passed by&mutper eval call. - Escriba
Vm - escriba’s embedded tatara-lisp runtime. Build once, eval many times; the registered native fns (the editor capability surface) persist across calls.
Enums§
- Host
Effect - A typed, validated editor mutation requested by Lisp code. The
runtime drains these after eval and applies them — Lisp never
touches
EditorStatedirectly. New capabilities are one variant here + one native fn in [register_editor_fns] + one apply arm in the runtime; nothing else. - VmError