Expand description
Shape Virtual Machine
A stack-based bytecode VM for executing Shape programs efficiently.
Shape is a general-purpose scientific computing language for high-speed time-series analysis. This VM provides fast execution of Shape programs across any domain (finance, IoT, sensors, healthcare, manufacturing, etc.).
§Module Structure
configuration- BytecodeExecutor struct, constructors, extension registrationmodule_resolution- Module loading, virtual modules, file-based import handlingexecution- Compilation pipeline, VM execution loop, snapshot resume
Re-exports§
pub use bytecode::BytecodeProgram;pub use bytecode::Instruction;pub use bytecode::OpCode;pub use compiler::BytecodeCompiler;pub use debugger::DebugCommand;pub use debugger::VMDebugger;pub use executor::CallFrame;pub use executor::DebugVMState;pub use executor::ExecutionResult as VMExecutionResult;pub use executor::VMConfig;pub use executor::VirtualMachine;pub use executor::reset_transport_provider;pub use executor::set_transport_provider;pub use feature_matrix::FeatureCategory;pub use feature_matrix::FeatureTest;pub use memory::GCConfig;pub use memory::GCResult;pub use memory::GarbageCollector;pub use memory::ObjectId;pub use type_tracking::FrameDescriptor;pub use type_tracking::SlotKind;pub use type_tracking::StorageHint;pub use type_tracking::TypeTracker;pub use type_tracking::VariableTypeInfo;
Modules§
- blob_
cache_ v2 - Blob-level cache for content-addressed function blobs. Caches individual FunctionBlobs by content hash on disk (~/.shape/cache/blobs/).
- borrow_
checker - Compile-time borrow checker for reference lifetime tracking.
- bundle_
compiler - Bundle compiler for producing distributable .shapec packages
- bytecode
- Bytecode instruction set for Shape VM
- bytecode_
cache - Bytecode cache for compiled Shape modules
- compiler
- Bytecode compiler - translates AST to bytecode
- constants
- VM constants and configuration values
- debugger
- VM Debugger for Shape Virtual Machine
- deopt
- Deoptimization tracking for JIT-compiled functions.
- executor
- Virtual machine executor for Shape bytecode
- feature_
matrix - Backward compatibility re-export for feature_matrix module
- feature_
tests - Automatic feature coverage tracking for Interpreter/VM/JIT parity
- feedback
- Feedback vectors for inline cache (IC) type profiling.
- hot_
reload - Hot-reload support for content-addressed function blobs.
- linker
- Linking pass: converts a content-addressed
Programinto a flatLinkedProgram. - megamorphic_
cache - Direct-mapped lossy cache for megamorphic property lookups.
- memory
- Memory management for Shape VM
- metrics
- Bounded observability infrastructure for the Shape VM.
- mir
- Mid-level Intermediate Representation (MIR) for borrow checking.
- module_
resolution - Module loading, virtual module resolution, and file-based import handling.
- remote
- Per-function remote execution support
- resource_
limits - Runtime resource limits and sandboxing for the Shape VM.
- stdlib
- Standard library compilation for Shape VM
- tier
- Tiered compilation support for Shape VM.
- type_
tracking - Type Tracking for Bytecode Compiler
Structs§
- Bytecode
Executor - Bytecode executor for compiling and running Shape programs.
- Error
Location - Source location for error reporting
- LocatedVM
Error - VMError with optional source location for better error messages
- String
Id - Re-export
StringIdfromshape-value— the canonical definition. A string pool identifier. Indexes intoBytecodeProgram::strings. - VMContext
- VM execution context passed to module functions