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 borrow_checker;
19pub mod bundle_compiler;
20pub mod bytecode;
21pub mod bytecode_cache;
22pub mod compiler;
23mod configuration;
24pub mod constants;
25pub mod debugger;
26pub mod deopt;
27mod execution;
28pub mod executor;
29pub mod feature_matrix;
30pub mod feature_tests;
31pub mod feedback;
32pub mod hot_reload;
33pub mod linker;
34pub mod megamorphic_cache;
35pub mod mir;
36#[cfg(feature = "jit")]
37compile_error!(
38    "The `shape-vm/jit` feature is deprecated. JIT functionality moved to the `shape-jit` crate."
39);
40pub mod memory;
41pub mod metrics;
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)]
69#[path = "lib_tests.rs"]
70mod tests;