Skip to main content

Crate candela_vm

Crate candela_vm 

Source
Expand description

candela-vm is the self-contained runtime core for candela.

This crate is everything needed to load and run candela bytecode, and nothing else: the register VM (vm::execute), the bytecode instruction set (instr), the NaN-boxed value representation (data) and shared runtime types (rt), the garbage collector, the host/script value marshalling (embed), the runtime error/diagnostic machinery (errors), and the .cdlb artifact format (artifact).

It depends on nothing from the compiler (candela) crate. Both the candela-vm binary and the full candela compiler binary link this one VM, so the executor is never duplicated.

Re-exports§

pub use errors::Diagnostic;
pub use errors::ErrorCtx;
pub use errors::RuntimeError;
pub use errors::collect_diagnostic;
pub use embed::FromHostValue;
pub use embed::HostBindError;
pub use embed::HostError;
pub use embed::HostRegistry;
pub use embed::HostType;
pub use embed::IntoHostFn;
pub use embed::IntoHostResult;
pub use embed::IntoHostValue;
pub use embed::Value;
pub use embed::marshal_args;
pub use embed::marshal_value;
pub use embed::unmarshal_value;
pub use artifact::CallError;
pub use artifact::LoadError;
pub use artifact::RuntimeProgram;
pub use artifact::load_program;
pub use rt::dylib_dirs;
pub use rt::set_dylib_dirs;
pub use rt::argv_skip;
pub use rt::set_argv_skip;

Modules§

artifact
Bytecode artifact format (.cdlb) and the VM-only load/run API.
captured_output
Where program output and error reports go.
data
embed
Host/script value marshalling for candela’s embedding API.
errors
instr
json
json parse and stringify over the runtime Data graph.
native
Running the machine code a .cdlb carries.
rt
Runtime data types shared by the VM and the compiler.
vm

Structs§

GcStats
What the collector has done over a set of pools, and how large they are.
PoolStats
How large one pool is.