Skip to main content

Crate elisprs

Crate elisprs 

Source
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 .el file to a fusevm Chunk (and, with fusevm’s aot feature, on to a native object via fusevm::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’s current-bidi-paragraph-direction, over the bidi-class data of crate::bidi_data.
bidi_data
The bidi-class of every character (Emacs 31.1 get-char-code-property over 0..=#x3FFFFF), as runs (FIRST, LAST, CLASS), generated from the oracle by scripts/gen/bidi-data.el. CLASS indexes CLASSES.
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::Chunk and executes on fusevm. Heap objects ride as Value::Obj handles; 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-name and substitute-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’s src/json.c (its own parser and serializer, not json.el and not libjansson).
lread_fn
read from a function stream: lread.c’s read0 driven through source_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 bootstraps subr.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::Obj constants.
regexp
Emacs-Lisp regexp → regex crate translation.
rust_ffi
elisp wiring for inline Rust FFI (rust { ... } blocks).
strftime
nstrftime: the time formatter behind format-time-string, ported from gnulib’s lib/strftime.c as 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§

EntryPoint
Which Emacs invocation elisp FILE is 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 src into a single fusevm chunk, exactly as an evaluated run would (prelude loaded, top-level progn spliced, macros expanded) but WITHOUT running it. Backs elisp --dump-bytecode / --disasm.
eval_file
Run a .el file as emacs -l FILE would. See eval_file_as.
eval_file_as
Run a .el file, 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 .el file as emacs --script FILE would: 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-string would: a condition like void-variable: foo becomes “Symbol’s value as variable is void: foo”. Falls back to the raw string if formatting fails.
print
Render a value (prin1 style when readable).
read_forms
Read every top-level form of src into the reader’s s-expression form — the elisp AST. Backs elisp --dump-ast; does not macro-expand, lower, or run.
with_interpreter_stack
Run f on a thread with INTERP_STACK_BYTES of stack.