Expand description
vimlrs — a faithful Rust port of the Vimscript (VimL) interpreter, compiled
to fusevm bytecode and run on its VM + Cranelift JIT.
VimL is the 4th language frontend on fusevm, after zshrs (zsh), strykelang (stryke), and awkrs (awk). Like zshrs, it has no local VM and no local JIT: source is lexed and parsed into an AST, lowered to fusevm bytecode, and executed by fusevm.
§Two-zone layout (the zshrs porting discipline)
ported— strict 1:1 ports of the Neovim eval C source undervendor/. Exact C names,// c:NNNcitations, no invented helpers/structs. Seedocs/PORT.md.- Crate-root carve-outs — net-new synthesis with no C counterpart
(Neovim’s eval is a string-walking interpreter with no AST/bytecode):
viml_lexer,viml_ast,viml_parser,compile_viml,fusevm_bridge. These mirror zshrs’scompile_zsh.rs/fusevm_bridge.rscarve-outs and are clearly headed “EXTENSION — NO vendor/ counterpart”.
Re-exports§
pub use fusevm_bridge::eval_expr;pub use fusevm_bridge::eval_source;pub use ported::eval::typval_defs_h::typval_T;
Modules§
- aot
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EXTENSION — NO
vendor/COUNTERPART. Ahead-of-time build: bake one or more.vimscripts into a copy of the runningvimlrsbinary as a zstd-compressed trailer, producing a self-contained executable. At startupvimlrsdetects the trailer and runs every embedded script in input order as one program. Same design as zshrs’saot.rs(which has no C counterpart either — Vim’s.vimscripts have no compile-into-binary form). - banner
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EXTENSION — NO
vendor/COUNTERPART. VIMLRS ASCII wordmark + live-stats box banner. Single source of truth shared by: - builtin_
docs - GENERATED doc corpus for the LSP hover provider and the
gen-docsbinary. Regenerate by re-running the authoring pipeline; do not hand-edit casually. - cli
vimlcommand-line driver (thevimlrscrate’s binary).- compile_
viml - ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EXTENSION — NO
vendor/COUNTERPART. Lowers the synthesis AST to afusevm::Chunk. Neovim has no bytecode compiler; this is the net-new piece that makes VimL run on fusevm (the role zshrs’scompile_zsh.rsplays for zsh). Each expression compiles to a sequence leaving one value on the stack; faithful VimL semantics are never inlined here — every operator routes to aVIML_*builtin whose handler calls the canonical ports. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - dap
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EXTENSION — NO
vendor/COUNTERPART. Debug Adapter Protocol server (stdio) —vimlrs --dap. Mirrors zshrs’sdap.rsarchitecture: the script runs IN-PROCESS on an executor thread; the compiler emits aSET_LINENOmarker before each statement whose handler callscheck_line, which consults the shared breakpoint state and condvar-waits to pause. While paused, the executor thread also servicesvariables/evaluaterequests (so they read the executor’s ownglobvardict), then resumes when the client sendscontinue/next. - fusevm_
bridge - ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EXTENSION — NO
vendor/COUNTERPART. The vimlrs analogue of zshrs’ssrc/fusevm_bridge.rs: pure fusevm plumbing, no operator logic. It only - fusevm_
disasm - ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EXTENSION — NO
vendor/COUNTERPART. fusevm bytecode listing to stdout whenvimlrsis invoked with--disasm(ported from zshrs’sfusevm_disasm.rs). ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - lsp
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EXTENSION — NO
vendor/COUNTERPART. Language Server Protocol (stdio) for editors —vimlrs --lsp. Self-contained, reusing the synthesis lexer/parser: diagnostics come from per-linecrate::viml_parser::parse_stmt; completion / hover draw on the Phase-3 builtin set, the ex-command words, and the predefinedv:constants. No output reaches the terminal — JSON-RPC on stdio only. Structure ported from awkrs’slsp.rs. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - ported
- Strict 1:1 ports of the Neovim eval C source vendored under
vendor/. - repl
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EXTENSION — NO
vendor/COUNTERPART. Interactive REPL forvimlrs— a utop-style line editor backed byreedline. Adapted from strykelang’srepl.rs(same reedline 0.47 API), trimmed for vimlrs’s thread-local interpreter model. - script_
cache - ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EXTENSION — NO
vendor/COUNTERPART. rkyv-backed bytecode cache for.vimscripts, the same architecture as awkrs/strykelang/zshrs’sscript_cache. - viml_
ast - ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EXTENSION — NO
vendor/COUNTERPART. Neovim’seval.cparses and evaluates in one pass over the source string; there is no AST. This tree is net-new, its shape dictated by theeval1…eval7precedence ladder so the compiler can lower it to fusevm bytecode. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - viml_
lexer - ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EXTENSION — NO
vendor/COUNTERPART. (PORT.md synthesis-layer carve-out, the vimlrs analogue of zshrs’s crate-rootfusevm_bridge.rs/compile_zsh.rs.) - viml_
parser - ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EXTENSION — NO
vendor/COUNTERPART. Recursive-descent parser building the synthesis AST. The expression grammar transcribes the precedence ladder ineval.c(eval1…eval7) but builds a tree instead of evaluating inline: - viml_
regex - ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EXTENSION — implements Vim’s regex DIALECT, not a line-by-line port of
regexp_bt.c/regexp_nfa.c(which compile a pattern to a bytecode program and match it with a backtracking / NFA VM). This is the vimlrs analogue of the bytecode-compiler carve-out: a backtracking matcher over a parsed AST that reproduces Vim’s documented pattern behavior (:help pattern) in the default magic mode. It backs=~/!~,matchstr(),match(),substitute(), patternsplit(), and:catch /pat/.