Expand description
Runtime execution and REPL support
This module provides the interactive REPL, runtime execution environment, and actor system with supervision trees for the Ruchy language.
§Core Components
§REPL (Read-Eval-Print Loop)
Interactive development environment with:
- Line editing and history
- Tab completion
- Magic commands
- Session recording and replay
§Actor System
Concurrent programming model featuring:
- Message passing between actors
- Supervision trees for fault tolerance
- Actor observability and debugging
- Deadlock detection
§Runtime Execution
- Expression evaluation engine
- Pattern matching implementation
- Binary operations with proper semantics
- Memory-safe arena allocation
§Examples
use ruchy::runtime::{Repl, ReplConfig};
// Start an interactive REPL session
let config = ReplConfig::default();
let mut repl = Repl::new_with_config(config).unwrap();
repl.run().unwrap();use ruchy::runtime::{ActorSystem, Message, MessageValue};
// Create an actor system
let mut system = ActorSystem::new();
// Spawn an echo actor
let echo_ref = system.spawn_echo_actor("echo".to_string()).unwrap();
// Send a message
let msg = Message::new(MessageValue::String("Hello".to_string()));
// Note: In real usage, you would handle the Result properly§Features
- Interactive Development: Full-featured REPL with completion
- Concurrent Programming: Actor model with supervision
- Debugging Tools: Observatory for system introspection
- Memory Safety: Arena allocation without unsafe code
- Educational Tools: Assessment and grading systems
Re-exports§
pub use repl::Repl;pub use repl::ReplConfig;pub use interpreter::DataFrameColumn;pub use interpreter::Interpreter;pub use interpreter::InterpreterError;pub use interpreter::InterpreterResult;pub use interpreter::Value;pub use actor::ActorBehavior;pub use actor::ActorContext;pub use actor::ActorId;pub use actor::ActorRef;pub use actor::ActorSystem;pub use actor::EchoActor;pub use actor::Message;pub use actor::MessageValue;pub use actor::SupervisorActor;pub use actor::SupervisorDirective;pub use actor_concurrent::ActorState as ConcurrentActorState;pub use actor_concurrent::ConcurrentActor;pub use actor_concurrent::ConcurrentActorSystem;pub use actor_concurrent::Envelope;pub use actor_concurrent::SupervisionStrategy;pub use actor_concurrent::SystemMessage;pub use actor_concurrent::CONCURRENT_ACTOR_SYSTEM;pub use observatory::ActorObservatory;pub use observatory::ActorSnapshot;pub use observatory::ActorState;pub use observatory::DeadlockCycle;pub use observatory::MessageFilter;pub use observatory::MessageStatus;pub use observatory::MessageTrace;pub use observatory::ObservatoryConfig;pub use observatory::SystemMetrics;pub use assessment::Assignment;pub use assessment::AssignmentSetup;pub use assessment::ExpectedBehavior;pub use assessment::GradeReport;pub use assessment::GradingEngine;pub use assessment::GradingRubric;pub use assessment::PlagiarismDetector;pub use assessment::SecureSandbox;pub use assessment::Task;pub use assessment::TaskGrade;pub use assessment::TestCase;pub use magic::MagicCommand;pub use magic::MagicRegistry;pub use magic::MagicResult;pub use magic::ProfileData;pub use magic::UnicodeExpander;pub use inspect::CompositeForm;pub use inspect::DisplayForm;pub use inspect::Inspect;pub use inspect::InspectStyle;pub use inspect::Inspector;pub use inspect::OpaqueHandle;pub use safe_arena::SafeArena as Arena;pub use safe_arena::TransactionalArena;pub use transaction::SavePoint;pub use transaction::TransactionEvent;pub use transaction::TransactionId;pub use transaction::TransactionLog;pub use transaction::TransactionMetadata;pub use transaction::TransactionalState;pub use transaction::Version;pub use transaction::VersionedValue;pub use transaction::MVCC;pub use observatory_ui::DashboardConfig;pub use observatory_ui::DisplayMode;pub use observatory_ui::ObservatoryDashboard;pub use dataflow_debugger::Breakpoint;pub use dataflow_debugger::BreakpointAction;pub use dataflow_debugger::BreakpointCondition;pub use dataflow_debugger::DataflowConfig;pub use dataflow_debugger::DataflowDebugger;pub use dataflow_debugger::ExecutionEvent;pub use dataflow_debugger::ExportFormat;pub use dataflow_debugger::MaterializedFrame;pub use dataflow_debugger::PipelineStage;pub use dataflow_debugger::StageDiff;pub use dataflow_debugger::StageMetrics;pub use dataflow_debugger::StageStatus;pub use dataflow_debugger::StageType;pub use dataflow_ui::DataflowUI;pub use dataflow_ui::UIConfig;pub use replay_converter::ConversionConfig;pub use replay_converter::GeneratedTest;pub use replay_converter::ReplayConverter;pub use replay_converter::TestCategory;
Modules§
- actor
- Actor system runtime with supervision trees
- actor_
concurrent - Concurrent actor runtime with true message passing and supervision
- actor_
runtime - Actor runtime implementation for message passing and state management
- assessment
- Educational Assessment System for REPL Replay Testing
- async_
runtime - Async runtime support for Ruchy
- builtin_
init - Builtin Functions Initialization Module
- builtins
- Built-in functions module
- bytecode
- Bytecode Virtual Machine
- cache
- Bytecode and compilation caching for improved REPL performance
- compilation
- Direct-threaded Interpreter Compilation Module
- completion
- Tab completion module for REPL Handles intelligent code completion with low complexity
- dataflow_
debugger - Dataflow debugger for
DataFramepipeline debugging (RUCHY-0818) - dataflow_
ui - Terminal UI for dataflow debugger (RUCHY-0818)
- deterministic
- Deterministic execution support for REPL replay testing
- eval_
array - Array method evaluation module
- eval_
builtin - Builtin function evaluation module
- eval_
control_ flow_ new - Control flow evaluation module
- eval_
data_ structures - Data structure evaluation module
- eval_
dataframe DataFramemethod evaluation module- eval_
dataframe_ ops DataFrameoperations evaluation module- eval_
display - Display trait implementations for runtime values and errors
- eval_
expr - Expression evaluation dispatch module
- eval_
func - Function and lambda evaluation module
- eval_
function - Function evaluation module
- eval_
html_ methods - HTML method evaluation module
- eval_
literal - Literal expression evaluation module
- eval_
loops - Loop evaluation module
- eval_
method - Method call evaluation module
- eval_
method_ dispatch - Method dispatch evaluation module
- eval_
operations - Binary and unary operation evaluation module
- eval_
pattern - Pattern matching evaluation module
- eval_
pattern_ match - Pattern matching evaluation module
- eval_
string - String method evaluation module
- eval_
string_ interpolation - String interpolation evaluation module
- eval_
string_ methods - String method evaluation module
- eval_
try_ catch - Try/Catch/Finally evaluation module
- gc
- Garbage collection module
- gc_impl
- Conservative Garbage Collector Implementation
- grammar_
coverage - Grammar coverage matrix for REPL testing
- inspect
- Object inspection protocol for REPL display
- interpreter
- High-Performance Interpreter with Safe Value Representation
- lazy
- Lazy evaluation support for pipelines and operations
- magic
- REPL Magic Commands System
- module_
loader - object_
helpers - Helper functions for working with Object and
ObjectMutvalues All functions maintain ≤10 complexity budget following Toyota Way - observatory
- Actor observatory for live system introspection (RUCHY-0817)
- observatory_
ui - Terminal UI dashboard for actor observatory (RUCHY-0817)
- pattern_
matching - Shared pattern matching utilities Extracted to reduce duplication across interpreter and REPL
- repl
- EXTREME Quality REPL - Main Module
- repl_
recording - Refactored recording functionality with reduced complexity
- replay
- REPL Replay Testing System
- replay_
converter - Replay-to-Test Conversion Pipeline
- safe_
arena - Safe arena allocator without unsafe code
- transaction
- Transactional state management for REPL evaluation
- validation
- Centralized validation module to eliminate entropy
- value_
utils - Value utility methods module