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#[cfg(feature = "jit")]
36compile_error!(
37    "The `shape-vm/jit` feature is deprecated. JIT functionality moved to the `shape-jit` crate."
38);
39pub mod memory;
40pub mod metrics;
41pub mod module_graph;
42pub mod module_resolution;
43pub mod remote;
44pub mod resource_limits;
45pub mod stdlib;
46pub mod tier;
47pub mod type_tracking;
48
49pub use bytecode::{BytecodeProgram, Instruction, OpCode, StringId};
50pub use compiler::BytecodeCompiler;
51pub use configuration::BytecodeExecutor;
52pub use debugger::{DebugCommand, VMDebugger};
53#[cfg(feature = "quic")]
54pub use executor::clear_quic_transport_config;
55#[cfg(feature = "quic")]
56pub use executor::configure_quic_transport;
57pub use executor::{
58    CallFrame, DebugVMState, ExecutionResult as VMExecutionResult, VMConfig, VirtualMachine,
59    reset_transport_provider, set_transport_provider,
60};
61pub use feature_matrix::{FeatureCategory, FeatureTest};
62pub use memory::{GCConfig, GCResult, GarbageCollector, ObjectId};
63pub use type_tracking::{FrameDescriptor, SlotKind, StorageHint, TypeTracker, VariableTypeInfo};
64
65// Re-export ValueWord and related types from shape-value
66pub use shape_value::{ErrorLocation, LocatedVMError, Upvalue, VMContext, VMError};
67
68#[cfg(test)]
69pub(crate) mod test_utils;
70
71#[cfg(test)]
72#[path = "lib_tests.rs"]
73mod tests;