API Reference QuickBEAM v#0.10.9

Copy Markdown View Source

Modules

QuickJS-NG JavaScript engine embedded in the BEAM.

Disassembled QuickJS bytecode.

A lightweight JS execution context on a shared runtime thread.

A pool of JS runtime threads that host lightweight contexts.

JavaScript coverage tool for mix test --cover.

JavaScript and TypeScript toolchain powered by OXC.

Experimental JavaScript AST-to-QuickBEAM VM instruction compiler.

Experimental hand-written JavaScript parser for QuickBEAM.

AST node structs emitted by the JavaScript parser.

Array literal expression.

Array destructuring binding pattern.

Assignment operator expression.

Binding pattern element with a default initializer.

Binary operator expression.

Block statement containing a statement list.

Break statement with an optional label.

Function or method call expression.

Catch clause with an optional binding parameter.

Ternary conditional expression.

Continue statement with an optional label.

Do-while loop statement.

Empty statement represented by a standalone semicolon.

Namespace re-export declaration.

Default ES module export declaration.

Named ES module export declaration.

Named export specifier.

Statement wrapping an expression.

Class field definition.

Identifier reference or binding name.

Static ES module import declaration.

Named import specifier.

Literal value such as a number, string, boolean, or null.

Logical operator expression.

Property access expression.

Meta-property expression such as import.meta.

Class method definition.

Constructor call expression created with new.

Object literal expression.

Object destructuring binding pattern.

Private class field or method name.

JavaScript script or module program.

Object literal property.

Rest element in a binding pattern.

Comma sequence expression.

Spread element in array literals or call arguments.

Class static initialization block.

Tagged template literal expression.

Static segment of a template literal.

Template literal with static quasis and embedded expressions.

Try/catch/finally statement.

Unary operator expression.

Prefix or postfix update expression.

Variable declaration statement.

One declarator in a variable declaration.

Class declaration, expression, and element grammar for the experimental JavaScript parser.

Structured syntax error produced by the JavaScript parser.

Expression grammar for the experimental JavaScript parser.

Core Pratt expression grammar.

Function expression, arrow body, arguments, and parameter grammar.

Literal, object, array, property, and meta-expression grammar.

Template literal parsing helpers.

Hand-written JavaScript lexer used by the experimental QuickBEAM parser.

Regular-expression literal validation helpers for the JavaScript lexer.

Unicode, decimal, and identity escape validation.

Named capture group and backreference validation.

Unicode property escape and class range validation.

Import and export grammar for the experimental JavaScript parser.

Binding and destructuring pattern grammar for the experimental JavaScript parser.

Shared token and grammar predicates for the experimental JavaScript parser.

Shared parser-state and token cursor helpers.

Statement and declaration grammar for the experimental JavaScript parser.

Token emitted by the JavaScript lexer.

Facade for JavaScript parser validation passes.

Lexical, var, import, and catch binding validation.

Context-sensitive expression validation.

Control-flow, label, break, continue, and return validation.

Module declaration validation.

Class private-name validation.

Object initializer proto validation.

Strict-mode binding and expression validation.

Strict-mode validation for Annex B statement-position exceptions.

Async, generator, and duplicate parameter validation.

Assignment/update target and class constructor validation.

A pool of JS runtimes for concurrent request handling.

Macros and helpers for defining JS builtins.

Parses QuickJS bytecode binaries into VM program/function instruction IR.

JavaScript closure capture metadata.

JIT compiler entry point: lowers bytecode to BEAM modules, caches them, and invokes compiled functions.

Control-flow graph analysis: identifies basic-block boundaries and inlineable branch targets.

Stack-depth inference: computes operand-stack depth at every basic-block entry.

Abstract type inference: propagates JS value types through basic blocks to enable guard elision.

Introspection tools for compiler mode: capability checking, helper call analysis.

Erlang abstract-format form builder: assembles the module, entry, and block function forms for compilation.

Iterator protocol for compiled generator functions.

VM-instruction-to-Erlang lowering pipeline: analyses control flow and types, then emits abstract-form block functions.

Erlang abstract-format helpers: variable, literal, call, and case-clause constructors for the lowering pass.

Capture-cell management during lowering: ensures and closes shared cells for captured local variables.

Per-opcode lowering: translates each QuickJS bytecode instruction into Erlang abstract-form expressions.

Arithmetic, bitwise, comparison, and unary opcodes.

Call, apply, eval, return, and closure opcodes.

Class definition opcodes: define_class, define_method, add_brand, check_brand, init_ctor.

Control flow opcodes: if_true, if_false, goto, catch, nip_catch, throw, throw_error, gosub, ret.

Generator and async opcodes: initial_yield, yield, yield_star, async_yield_star, await, return_async.

Global variable and var-ref opcodes: getvar, put_var, define_var, get_var_ref, make*_ref, get/put_ref_value.

Iterator and for-in/of opcodes.

Local and argument slot opcodes: get_loc, put_loc, set_loc, get_arg, put_arg, set_arg, etc.

Object and array manipulation opcodes: get/put_field, get/put_array_el, define_field, set_name, set_proto, get/put_super, private fields, delete, in, instanceof.

Stack manipulation opcodes: push constants, dup, drop, swap, rot, perm, insert, nip, nop.

with-statement opcodes: with_get_var, with_put_var, with_delete_var, with_make_ref, with_get_ref, with_get_ref_undef.

Lowering accumulator: tracks the operand stack, slot bindings, and emitted body forms during a block compilation.

Small type and purity predicates used while lowering compiler IR.

Bytecode optimizer: constant folding, peephole rewrites, and dead-branch elimination before lowering.

Compiled-function invocation: sets up call frames, handles new, generators, and tail-call dispatch.

Runtime support for JIT-compiled code.

Helpers for boxing, closing, and synchronizing captured lexical variables.

Process-local execution frame trace used for JavaScript stack construction.

JavaScript function metadata and pre-resolved VM instructions used by the interpreter and BEAM compiler.

Global variable environment: resolves JS globals from the persistent heap and runtime bindings.

Mutable heap storage for JS runtime values.

Array storage operations for the JS object heap.

Process-local queues for microtasks and promise waiters.

Process-local caches for prototypes, transient call state, and runtime metadata.

Interpreter context store: reads and writes the active Context struct via process dictionary.

Mark-and-sweep garbage collector for the JS object heap.

Canonical internal property keys shared across heap, runtime, and object-model modules.

Documents all process dictionary keys used by the BEAM VM, and owns module/symbol registration.

Hidden-class shape tracking for plain JS objects.

Low-level process-dictionary storage for JS heap objects: objects, arrays, cells, atoms, and GC roots.

Decodes a raw QuickJS function bytecode body into VM instruction tuples.

Executes decoded QuickJS bytecode via multi-clause function dispatch.

Closure construction: captures parent locals and var-refs into a {:closure, captured, fun} tuple.

Closure variable access: read and write shared capture cells and captured locals.

Execution context carried through interpreter evaluation and builtin invocation.

Eval-time environment utilities: local name resolution, class binding seeding, and this context helpers.

Tuple-backed interpreter frame layout helpers.

Interpreter gas accounting and periodic heap garbage-collection trigger.

Generator and async function execution: suspends/resumes frames and wraps results in iterator or Promise objects.

Arithmetic, bitwise, comparison, and unary opcodes.

Function creation, call, and constructor opcodes.

Class definition, method definition, brand, and private field opcodes.

Control flow opcodes: if/goto/return, try/catch, gosub/ret, throw.

Generator yield, yield_star, await, initial_yield, and return_async opcodes.

Global variable access, ref values, eval, and with-statement opcodes.

For-in, for-of, iterator_*, spread, and array construction opcodes.

Args, locals, and closure variable reference opcodes.

Object creation, field access, array element access, and misc object stubs.

Stack manipulation and constant-push opcodes.

Builds interpreter contexts and stores VM atom tables before execution.

JS type coercion, arithmetic, comparison, and equality operations.

JS arithmetic operations: add, sub, mul, js_div, mod, pow, neg, and overflow helpers.

JS bitwise operations: band, bor, bxor, bnot, shl, sar, shr.

JS type coercion: to_number, to_int32, to_uint32, to_primitive, to_string_val, and numeric parsing.

JS relational comparisons: lt, lte, gt, gte, numeric_compare, abstract_compare.

JS equality operations: eq, neq, strict_eq, abstract_eq.

Unified JS function invocation: dispatches to compiled modules, interpreter fallback, builtins, and native callbacks.

Fast-context snapshot and restoration: serialises the interpreter context into/out of process dictionary for JIT calls.

Helpers for throwing JS errors from the BEAM VM.

LEB128 integer encoding/decoding for QuickJS bytecode parsing.

Atom-pool resolution: maps bytecode constant indices to JS atom strings and resolves display names.

Class runtime support: super resolution, constructor dispatch, and extends prototype wiring.

Object spread and property copying: append_spread, copy_data_properties, and array/iterator flattening.

Implements JavaScript [[Delete]] semantics for VM values.

Function object helpers for names, home objects, and super method dispatch metadata.

JS property resolution: own properties, prototype chain, getters.

Method definition helpers: installs getters, setters, and regular methods on objects and classes.

Private class fields and brand checks: get, put, and in operator support for #field syntax.

Property key normalization and classification for JS object model.

Property write operations: set, define, and delete for JS objects, arrays, proxies, getters, and setters.

Shared helpers for function/static object property semantics.

QuickJS opcode table: numeric codes, stack effects, and format metadata for all JS bytecode instructions.

QuickJS predefined atom table, generated at compile time from quickjs-atom.h

Compiled or decoded JavaScript program: atom table plus top-level VM value.

Promise lifecycle: create resolved/rejected promises, chain .then/.catch/.finally, and flush microtasks.

Shared helpers for the BEAM JS runtime: coercion, callbacks, object creation.

Array.prototype and Array static methods.

JS ArrayBuffer and SharedArrayBuffer built-in: constructor, transfer, resize, and slice operations.

Contract for runtime modules that contribute global JS bindings.

JavaScript Boolean constructor and prototype builtins.

Contract for modules that expose JS builtin constructor/prototype/static entries.

Shared helpers for collection builtins.

Minimal core console builtin used outside the richer Web console API.

Helpers for looking up and invoking globally registered JS constructors.

JS Date built-in: constructor, parsing, formatting, and all get/set prototype methods.

JS Error constructors and prototype: Error, TypeError, RangeError, and the other standard error types.

JS Function prototype: call, apply, bind, and property access for name/length/fileName.

Global numeric functions: parseInt, parseFloat, isNaN, isFinite, and related utilities.

JS global scope: constructors, global functions, and the binding map.

Global constructor built-ins: Object, Array, String, Boolean, and other wrapper constructors.

Implementations for global JavaScript functions such as eval, require, and queueMicrotask.

JSON.parse and JSON.stringify.

JS Map and WeakMap built-ins: constructor, get/set/has/delete, and iteration.

JS Math object: all standard methods (floor, ceil, sin, random, etc.) and numeric constants.

JS Number built-in: prototype methods (toFixed, toString, etc.) and static properties (MAX_SAFE_INTEGER, etc.).

Object static methods.

JS Promise built-in: prototype then/catch/finally and static resolve/reject/all/race.

JS Reflect built-in: apply, construct, has, ownKeys, defineProperty, and other reflection methods.

JS RegExp built-in: test, exec, toString, and NIF-backed regex matching against JS bytecode patterns.

JS Set and WeakSet built-ins: constructor, add/has/delete, forEach, and iteration.

String.prototype methods.

structuredClone() implementation for BEAM mode.

JS Symbol built-in: constructor, global symbol registry (Symbol.for/keyFor), and well-known symbol constants.

JS TypedArray built-ins: constructors and prototype methods for all numeric array types (Uint8Array through Float64Array).

AbortController and AbortSignal builtins for BEAM mode.

Beam object builtin for BEAM mode — provides Beam.self, Beam.onMessage, Beam.send, Beam.call, Beam.monitor, Beam.demonitor.

Helpers for exposing BEAM binaries as Web binary JS objects.

Blob and File constructor builtins for BEAM mode.

BroadcastChannel builtin for BEAM mode — in-process pub/sub via process dictionary.

Node.js Buffer class builtin for BEAM mode.

Integer and float binary codecs for Buffer read/write methods.

Encoding helpers for Node-compatible Buffer operations.

Callback invocation helpers for Web API event listeners and user-provided handlers.

compression global object and CompressionStream/DecompressionStream for BEAM mode.

Enhanced console object with Logger-based output for BEAM mode.

crypto object builtin for BEAM mode.

atob and btoa builtins for BEAM mode.

EventSource constructor for BEAM mode — SSE client.

EventTarget, Event, CustomEvent, and DOMException builtins for BEAM mode.

fetch, Request, and Response builtins for BEAM mode.

JSON conversion helpers for Fetch body methods.

FormData constructor builtin for BEAM mode.

Headers constructor builtin for BEAM mode.

Constructors for JavaScript iterator result objects and resolved promise wrappers.

MessageChannel and MessagePort builtins for BEAM mode.

navigator object with navigator.locks for BEAM mode.

performance object builtin for BEAM mode, including mark/measure/getEntries.

Small reference-backed state container used by Web API builtin objects.

ReadableStream, WritableStream, and TransformStream builtins for BEAM mode.

Byte extraction helpers for stream chunks.

crypto.subtle builtin for BEAM mode — delegates to QuickBEAM.SubtleCrypto.

TextEncoder and TextDecoder builtins for BEAM mode.

setTimeout, clearTimeout, setInterval, clearInterval builtins for BEAM mode.

URL and URLSearchParams builtins for BEAM mode.

Worker constructor for BEAM mode.

Aggregates all Web API builtins for BEAM mode.

Resolves VM instruction positions to source line and column metadata.

JS stack-trace capture and formatting: attaches stack to Error objects and supports Error.prepareStackTrace.

Type definitions and guards for JS values in the BEAM VM.

JavaScript local variable definition metadata.

WebAssembly runtime for the BEAM.

A decoded WebAssembly function.

A decoded WebAssembly module.