Expand description
candela is the full toolchain: lexer, parser, type-checker, compiler,
REPL, the Engine/Program embedding API, and the candela build
subcommand.
The runtime core (the VM executor, bytecode/data types, GC, value
marshalling, and the .cdlb load/run API) lives in the self-contained
candela-vm crate. This crate depends on it (strictly candela -> candela-vm) and aliases its modules under crate:: so the compiler keeps
its crate::data / crate::instr / crate::rt / crate::errors /
crate::vm paths.
Re-exports§
pub use cfg::Cfg;pub use compiler::imports::ImportResolver;pub use compiler::compiler_data::TypeNames;
Modules§
- cfg
- Compile-time configuration: the names
@cfg(...)tests. - compiler
- macros
- Macros: source regions an embedder expands.
- parser
Structs§
- Build
Options - How a program is built into an artifact.
- Diagnostic
- A structured compile/runtime error, produced instead of printing + exiting
whenever a diagnostic sink is installed (see
collect_diagnostic). - Engine
- The persistent embedding entry point. Holds the table of registered host
functions and compiles scripts into reusable
Programs. - GcStats
- What the collector has done over a set of pools, and how large they are.
- Host
Error - Why a registered host function failed.
- Host
Registry - The table of Rust closures a script’s
hostblocks bind to. - Pool
Stats - How large one pool is.
- Program
- A compiled candela program with resident interpreter state.
- Runtime
Program - A loaded, ready-to-run program image with owned runtime state.
Enums§
- Call
Error - Why a
RuntimeProgram::calldid not produce a value. - Host
Bind Error - Why a script’s
hostblocks could not be bound to aHostRegistry. - Host
Type - The type kinds that can cross the host boundary.
- Load
Error - Why a
.cdlbartifact could not be loaded. - Native
Code - Which machine code a release build puts in the artifact.
- Value
- A dynamically-typed value passed across the host/script boundary.
Traits§
- From
Host Value - Extracts a Rust argument from a
Valuefor a registered host closure. - Into
Host Fn - Adapts a Rust closure into a registered host function.
- Into
Host Result - What a registered host closure returns: a value, or an error to raise in the script that called it.
- Into
Host Value - Converts a host closure’s return value into a
Value.
Functions§
- build_
artifact - Compiles a
.cdlsource string to a.cdlbartifact the wayoptionsasks.build_bytecodeis this with the defaultscandela builduses. - build_
bytecode - Compiles a
.cdlsource string to a.cdlbbytecode artifact. - check_
only compile_checkedas a check only, which opens no library.- collect_
diagnostic - Runs
fwith a diagnostic sink installed. - collect_
warnings - Runs
fand returns what it produced together with every warning raised while it ran, in the order they were raised. Nothing is printed. - compile_
checked - Compiles
sourcethe waycandela builddoes: the whole program, and then an entry point for every fully annotated function in it. - dylib_
dirs - The directories
set_dylib_dirsput in effect on this thread. - load_
program - Loads a
.cdlbbytecode artifact into a runnableRuntimeProgram. - main
- The
candelacommand. The command line itself is read in [cli]. - set_
dylib_ dirs - Sets the directories a
dylibimport’s library is looked for in on this thread, and returns the ones that were in effect, so a caller can put them back.