Expand description
elisprs — Emacs Lisp as a fusevm frontend.
Pipeline: reader builds elisp forms as ElispHost heap objects → compiler
lowers each to a fusevm::Chunk → fusevm executes it, calling back into the
host (via fusevm’s extension handler) for elisp-specific operations. There
is no bespoke VM or JIT here — execution and codegen live in fusevm.
Re-exports§
pub use embed::run_program;pub use host::reset_host;pub use host::run_chunk;pub use host::with_host;
Modules§
- aot
elisp --aot: lower a.elfile to a fusevmChunk(and, with fusevm’saotfeature, on to a native object viafusevm::aot::compile_object).- aot_
runtime - AOT runtime hook.
- backquote
- backquote.el: the expander behind the
`macro. - banner
- Elisp ASCII logo + live-stats box banner. Single source of truth shared by:
- bidi
- The paragraph direction of bidi.c (
bidi_paragraph_init), behind xdisp.c’scurrent-bidi-paragraph-direction, over thebidi-classdata ofcrate::bidi_data. - bidi_
data - The
bidi-classof every character (Emacs 31.1get-char-code-propertyover 0..=#x3FFFFF), as runs(FIRST, LAST, CLASS), generated from the oracle by scripts/gen/bidi-data.el. CLASS indexesCLASSES. - builtins
- Primitive subrs, written in Rust. Per the research inventory these are the ~irreducible core; the large derived surface (caar.., seq-, cl-, alist helpers) will be defined in an elisp prelude on top of these.
- bundled
- Emacs Lisp libraries bundled verbatim from the GNU Emacs 31.1 tree.
- cache
- rkyv-backed bytecode cache for elisp scripts (mirrors zshrs/awkrs/strykelang
script_cache, brought to full toolchain parity). - compiler
- The elisp → fusevm lowering. elisp does not run on a bespoke interpreter; it
compiles to
fusevm::Chunkand executes on fusevm. Heap objects ride asValue::Objhandles; the ElispHost (via fusevm’s extension handler) supplies the semantics and the (dynamic) binding environment. - dap
elisp --dap— a line-level Debug Adapter Protocol server (stdio) for Emacs Lisp. Control model ported from zshrs’s DAP (zshrs/src/extensions/dap.rs):DebugAction/PauseSnapshot/BreakpointState, breakpoint + step-mode pause/resume, and the full request set (initialize, launch, setBreakpoints, setFunctionBreakpoints, configurationDone, threads, stackTrace, scopes, variables, continue, next, stepIn, stepOut, pause, evaluate, source, disconnect, setExceptionBreakpoints).- embed
- Embedding entry point: run an Emacs Lisp program from a host and capture its output.
- fileio
- The file-name primitives of Emacs’s
src/fileio.c, Unix branch:file-name-directory,file-name-nondirectory,file-name-as-directory,directory-file-name,directory-name-p,file-name-concat,file-name-absolute-p,expand-file-nameandsubstitute-in-file-name. - freevars
- Which lexical variables a closure body actually references.
- host
- The ElispHost: the elisp object heap, the symbol obarray, dynamic binding, and the primitive subrs — reached from fusevm’s extension handler. elisprs has no VM; fusevm executes the lowered bytecode and calls back here.
- intercepts
- AOP command-intercept / advice machinery — an elisprs extension ported
faithfully from zshrs
src/extensions/intercepts.rs. - json
- The native JSON primitives —
json-parse-string,json-parse-buffer,json-serialize,json-insert,json-available-p— written against the contract of Emacs 31.1’ssrc/json.c(its own parser and serializer, not json.el and not libjansson). - lread_
fn readfrom a function stream: lread.c’sread0driven throughsource_function_get/source_function_unget.- lsp
elisp --lsp— a Language Server (stdio) for Emacs Lisp.- modhooks
- Lisp that runs around a buffer-modifying or field-aware primitive.
- prelude
- The elisp prelude: the large
[DERIVED]surface (per the research inventory) written in elisp on top of the Rust primitives. This is how the port gets breadth without hand-coding a thousand subrs — exactly how Emacs bootstrapssubr.el. - prelude_
31 - Emacs 31.1 library segments loaded after the core prelude.
- reader
- Elisp reader. Builds forms directly as ElispHost heap objects (cons cells,
symbols) so the compiler can walk them and quoted literals can be emitted as
Value::Objconstants. - regexp
- Emacs-Lisp regexp →
regexcrate translation. - rust_
ffi - elisp wiring for inline Rust FFI (
rust { ... }blocks). - strftime
nstrftime: the time formatter behindformat-time-string, ported from gnulib’slib/strftime.cas GNU Emacs 31.1 builds it.- textprop
- Text-property intervals, following
intervals.c/textprop.c. - tiers
- Which fusevm execution tier a program’s bytecode actually reaches.
- timefns
- Lisp timestamps, ported from timefns.c (GNU Emacs 31.1).
- window
- The window and frame objects of a batch Emacs (window.c, frame.c).
Enums§
- Entry
Point - Which Emacs invocation
elisp FILEis standing in for. - Value
- Core value type — what lives on the stack and in variables.
Constants§
- INTERP_
STACK_ BYTES - Native stack an elisp evaluation needs.
Functions§
- compile_
str - Read + lower
srcinto a single fusevm chunk, exactly as an evaluated run would (prelude loaded, top-levelprognspliced, macros expanded) but WITHOUT running it. Backselisp --dump-bytecode/--disasm. - eval_
file - Run a
.elfile asemacs -l FILEwould. Seeeval_file_as. - eval_
file_ as - Run a
.elfile, using the rkyv bytecode cache at~/.elisprs/scripts.rkyv. On a fresh hit, the per-form chunks + a clean heap image are loaded and run directly — skipping read / macro-expand / lower AND the prelude rebuild. - eval_
script - Run a
.elfile asemacs --script FILEwould: the forms are evaluated in the*load*buffer, whose syntax table is the standard one. - eval_
str - Read, lower, and run a source string on fusevm; return the last value.
- format_
error - Render an internal error string as Emacs’s
error-message-stringwould: a condition likevoid-variable: foobecomes “Symbol’s value as variable is void: foo”. Falls back to the raw string if formatting fails. - Render a value (prin1 style when
readable). - read_
forms - Read every top-level form of
srcinto the reader’s s-expression form — the elisp AST. Backselisp --dump-ast; does not macro-expand, lower, or run. - with_
interpreter_ stack - Run
fon a thread withINTERP_STACK_BYTESof stack.