tclrs 0.4.9

Tcl as a fusevm frontend: a parser and compiler to fusevm::Chunk, with no bespoke VM or JIT
//! tclrs — Tcl as a fusevm frontend.
//!
//! Pipeline: `parser` turns a script into `parser::Script` → the compiler
//! (phase 2) lowers each command to a `fusevm::Chunk` → fusevm executes it and
//! calls back into the host for Tcl-specific operations. Execution and codegen
//! live in fusevm; there is no bespoke VM or JIT here.
//!
//! Tcl's value model needs no object heap on top of fusevm's: strings, integers
//! and floats map onto `Value` directly, and a value keeps its numeric
//! representation until something demands its string form. That deferral is the
//! point — the reference interpreter re-derives string representations inside
//! hot loops.
//!
//! Execution reaches for fusevm's higher tiers, not just its interpreter: every
//! VM this crate builds has the three-tier Cranelift JIT armed
//! ([`runtime::install_hooks`]), [`aot`] compiles a script to a native object
//! and links it into a standalone binary, and [`tiers`] reports which of those
//! tiers a given script's bytecode actually reaches.

pub mod aot;
pub mod aot_runtime;
pub mod assoc;
pub mod cache;
pub mod clock_locale;
pub mod clock_msgs;
/// `after`, `update` and `vwait` — the event loop a Tk script lives inside.
pub mod cmd_after;
/// `encoding` — transcoding, and the tables it is done with.
pub mod cmd_binary;
pub mod cmd_channel;
pub mod cmd_clock;
pub mod cmd_encoding;
pub mod cmd_file;
/// `info` — what the interpreter knows about itself.
pub mod cmd_info;
pub mod cmd_list;
pub mod cmd_namespace;
pub mod cmd_package;
/// `scan` — `format` read backwards.
pub mod cmd_scan;
/// `uplevel`, `upvar`, `variable` and `apply` — reaching another scope.
pub mod cmd_scope;
pub mod cmd_source;
pub mod cmd_string;
/// `subst` — the substitution rules applied to a value.
pub mod cmd_subst;
pub mod compiler;
pub mod control;
pub mod coro;
pub mod cursor;
pub mod dap;
pub mod dump;
/// The `.enc` tables, generated. See `scripts/gen_encoding_tables.py`.
pub mod encoding_tables;
pub mod expr;
pub mod expr_math;
pub mod list;
pub mod lsp;
pub mod names;
pub mod parser;
pub mod procs;
pub mod regexp;
pub mod runtime;
pub mod rust_ffi;
pub mod tiers;
// Behind the `tk` feature. The module documents itself in `src/tk/mod.rs`;
// an outer doc comment here would be merged with those inner docs and make
// rustdoc resolve every `[`sibling`]` link in them against the crate root
// instead of against `tk`, which is 28 unresolved-link warnings.
#[cfg(feature = "tk")]
pub mod tk;

pub use parser::{parse, Command, ParseError, Part, Script, Word};
pub use runtime::{eval, eval_captured, Interp, Outcome, TclError};