Runtime Enhancements Discovered

This page documents runtime enhancements discovered through dogfooding and the Bug Discovery Protocol.

v3.93.0: Enum Tuple Variant Pattern Matching

Discovered During: BOOTSTRAP-002 (Character Stream Processing)

Issue: Pattern matching on enum tuple variants failed in v3.92.0

Error: Runtime error: No match arm matched the value

Minimal Reproduction:

enum Position {
    Pos(i32, i32, i32)
}

fn get_line(pos: Position) -> i32 {
    match pos {
        Position::Pos(line, _, _) => line  // Failed in v3.92.0
    }
}

Resolution: Fixed in Ruchy v3.93.0

Impact: Enabled type-safe position tracking for lexer implementation

Validation:

$ ruchy --version
ruchy 3.93.0

$ ruchy run bug_reproduction_enum_tuple.ruchy
Line: 1  # βœ… Works!

Bug Report: GITHUB_ISSUE_enum_tuple_pattern_matching.md


v3.94.0: String Iterator .nth() Method

Discovered During: BOOTSTRAP-002 (Character Stream Processing)

Issue: String character iterator .nth() method not implemented in v3.93.0

Error: Runtime error: Unknown array method: nth

Minimal Reproduction:

fn main() {
    let input = "hello";
    let c = input.chars().nth(0);  // Failed in v3.93.0
    match c {
        Some(ch) => println("Char: {}", ch.to_string()),
        None => println("No char")
    }
}

Resolution: Fixed in Ruchy v3.94.0

Impact: Enabled O(1) character-by-index access for lexer

Validation:

$ ruchy --version
ruchy 3.94.0

$ ruchy run bug_reproduction_string_nth.ruchy
Char: "h"  # βœ… Works!

Bug Report: GITHUB_ISSUE_string_nth_method.md


Bug Discovery Protocol

All discoveries followed the mandatory Bug Discovery Protocol from CLAUDE.md:

  1. 🚨 STOP THE LINE - Immediately halt all work
  2. πŸ“‹ FILE GITHUB ISSUE - Create detailed reproduction
  3. πŸ”¬ MINIMAL REPRO - Provide standalone test case
  4. ⏸️ WAIT FOR FIX - No workarounds, wait for proper fix
  5. βœ… VERIFY FIX - Test and confirm before resuming

This protocol ensures:

  • Bugs are documented with extreme detail
  • Runtime improvements benefit all users
  • No workarounds that hide issues
  • Clean codebase without hacks

Impact on Project

These runtime enhancements were critical for:

  • Position Tracking: Type-safe line/column/offset tracking
  • Character Access: Efficient lexer implementation
  • Code Quality: Clean enum-based design patterns
  • Educational Value: Demonstrates real-world dogfooding