Expand description
node-js — JavaScript as a fusevm frontend.
Pipeline: lexer → parser builds a JS AST → compiler lowers it to a
fusevm::Chunk (plus a table of function/arrow sub-chunks and try-block
chunks) → fusevm executes it, calling back into the host (through
registered builtins and the strict numeric hook) for every JS-specific
operation. There is no bespoke VM or JIT here — execution and codegen live in
fusevm.
Modules§
- ast
- JavaScript abstract syntax tree.
- builtins
- Builtin op handlers (compiler-emitted
CallBuiltinids) plus the JS standard library (console,Math,JSON,Object, array/string methods) reachable from the host. Handlers pop their arguments off the VM operand stack and return the result value, which the VM pushes back. - cli
- Command-line interface for the
nodebinary. - compiler
- Lower the JavaScript AST to
fusevm::Chunk. - host
- The JavaScript object heap and runtime, reached from fusevm through
registered builtins (
register_builtin) and the strict numeric hook. - lexer
- JavaScript tokenizer.
- lsp
- Builtin / keyword / method corpus for offline documentation.
- parser
- JavaScript parser: token stream → AST.
Enums§
- Value
- Core value type — what lives on the stack and in variables.
Functions§
- compile
- Compile a source string to a runnable program.
- eval_
file - Read and run a
.jsfile. - eval_
str - Parse/compile and run a JS source string on a fresh host.
- load_
merged - Rebase a freshly compiled program’s func/try ids above those already loaded on the host, install its functions/tries, and return the (rebased) main chunk to run.
- run_
compiled - Run an already-compiled program on the current host.