Skip to main content

shape_vm/
lib.rs

1// ShapeError carries location info for good diagnostics, making it larger than clippy's threshold.
2#![allow(clippy::result_large_err)]
3
4//! Shape Virtual Machine
5//!
6//! A stack-based bytecode VM for executing Shape programs efficiently.
7//!
8//! Shape is a general-purpose scientific computing language for high-speed
9//! time-series analysis. This VM provides fast execution of Shape programs
10//! across any domain (finance, IoT, sensors, healthcare, manufacturing, etc.).
11//!
12//! # Module Structure
13//! - `configuration` - BytecodeExecutor struct, constructors, extension registration
14//! - `module_resolution` - Module loading, virtual modules, file-based import handling
15//! - `execution` - Compilation pipeline, VM execution loop, snapshot resume
16
17pub mod blob_cache_v2;
18pub mod bundle_compiler;
19pub mod bytecode;
20pub mod bytecode_cache;
21pub mod compiler;
22mod configuration;
23pub mod constants;
24pub mod debugger;
25pub mod deopt;
26mod execution;
27pub mod executor;
28pub mod feature_matrix;
29pub mod feature_tests;
30pub mod feedback;
31pub mod hot_reload;
32pub mod linker;
33pub mod megamorphic_cache;
34pub mod mir;
35// JIT tiered compilation support — enabled via `jit` feature on shape-vm.
36pub mod memory;
37pub mod metrics;
38pub mod module_graph;
39pub mod module_resolution;
40pub mod remote;
41pub mod resource_limits;
42pub mod stdlib;
43pub mod tier;
44pub mod type_tracking;
45
46pub use bytecode::{BytecodeProgram, Instruction, OpCode, StringId};
47pub use compiler::BytecodeCompiler;
48pub use configuration::BytecodeExecutor;
49pub use debugger::{DebugCommand, VMDebugger};
50#[cfg(feature = "quic")]
51pub use executor::clear_quic_transport_config;
52#[cfg(feature = "quic")]
53pub use executor::configure_quic_transport;
54pub use executor::{
55    CallFrame, DebugVMState, ExecutionResult as VMExecutionResult, VMConfig, VirtualMachine,
56    reset_transport_provider, set_transport_provider,
57};
58pub use feature_matrix::{FeatureCategory, FeatureTest};
59pub use memory::{GCConfig, GCResult, GarbageCollector, ObjectId};
60pub use type_tracking::{FrameDescriptor, NativeKind, StorageHint, TypeTracker, VariableTypeInfo};
61
62// Re-export error/context types from shape-value
63// (Upvalue/VMContext deleted per ADR-006 §2.7.8 — closure capture is now
64// kind-extended raw bits via ClosureCell, not a wrapper enum.)
65pub use shape_value::{ErrorLocation, LocatedVMError, VMError};
66
67#[cfg(test)]
68pub(crate) mod test_utils;
69
70#[cfg(test)]
71#[path = "lib_tests.rs"]
72mod tests;