Module runtime

Module runtime 

Source
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 DataFrame pipeline 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
DataFrame method evaluation module
eval_dataframe_ops
DataFrame operations 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 ObjectMut values 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