Skip to main content

Crate shape_vm

Crate shape_vm 

Source
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 registration
  • module_resolution - Module loading, virtual modules, file-based import handling
  • execution - 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 Program into a flat LinkedProgram.
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§

BytecodeExecutor
Bytecode executor for compiling and running Shape programs.
ErrorLocation
Source location for error reporting
LocatedVMError
VMError with optional source location for better error messages
StringId
Re-export StringId from shape-value — the canonical definition. A string pool identifier. Indexes into BytecodeProgram::strings.
VMContext
VM execution context passed to module functions

Enums§

Upvalue
Upvalue - a captured variable that can be shared between closures and their enclosing scope.
VMError
VM runtime errors