feat: comprehensive development progress

- Pattern matching implementation extended in match_expr.rs
- CLI configuration structured with categorized groups (task recommendation completed)
- Python LLVM builder split into function_lower.py (task recommendation completed)
- parse_box_declaration massive function refactored (task recommendation completed)
- Phase 16 Macro Revolution comprehensive planning and documentation
- Archive legacy phase documentation for clean structure
- HTTP message box improvements and performance optimizations
- MIR builder enhancements and control flow improvements

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Selfhosting Dev
2025-09-19 15:11:57 +09:00
parent 3c7a5de900
commit 811e3eb3f8
18 changed files with 739 additions and 250 deletions

View File

@ -6,7 +6,8 @@ impl NyashRunner {
/// Execute AOT compilation mode (split)
#[cfg(feature = "cranelift-jit")]
pub(crate) fn execute_aot_mode(&self, filename: &str) {
let output = self.config.output_file.as_deref().unwrap_or("app");
let groups = self.config.as_groups();
let output = groups.output_file.as_deref().unwrap_or("app");
// Prefer using provided helper scripts to ensure link flags and runtime integration
let status = if cfg!(target_os = "windows") {
// Use PowerShell helper; falls back to bash if available inside the script

View File

@ -6,9 +6,10 @@ use nyash_rust::{
impl NyashRunner {
/// Execute benchmark mode (split)
pub(crate) fn execute_benchmark_mode(&self) {
let groups = self.config.as_groups();
println!(
"🏁 Running benchmark mode with {} iterations",
self.config.iterations
groups.iterations
);
// Tests: some run on all backends, some are JIT+f64 only
// Third element indicates JIT+f64 only (skip VM/Interpreter)
@ -72,16 +73,16 @@ impl NyashRunner {
"(JIT+f64 only) Skipping VM/Interpreter; requires --features cranelift-jit"
);
// Warmup JIT
let warmup = (self.config.iterations / 10).max(1);
let warmup = (groups.iterations / 10).max(1);
self.bench_jit(code, warmup);
// Measured
let jit_time = self.bench_jit(code, self.config.iterations);
let jit_time = self.bench_jit(code, groups.iterations);
println!("\n📊 Performance Summary [{}]:", name);
println!(
" JIT f64 ops: {} iters in {:?} ({:.2} ops/sec)",
self.config.iterations,
groups.iterations,
jit_time,
self.config.iterations as f64 / jit_time.as_secs_f64()
groups.iterations as f64 / jit_time.as_secs_f64()
);
} else {
// Quick correctness check across modes (golden): Interpreter vs VM vs VM+JIT
@ -91,15 +92,15 @@ impl NyashRunner {
println!("✅ Outputs match across Interpreter/VM/JIT");
}
// Warmup (not measured)
let warmup = (self.config.iterations / 10).max(1);
let warmup = (groups.iterations / 10).max(1);
self.bench_interpreter(code, warmup);
self.bench_vm(code, warmup);
self.bench_jit(code, warmup);
// Measured runs
let interpreter_time = self.bench_interpreter(code, self.config.iterations);
let vm_time = self.bench_vm(code, self.config.iterations);
let jit_time = self.bench_jit(code, self.config.iterations);
let interpreter_time = self.bench_interpreter(code, groups.iterations);
let vm_time = self.bench_vm(code, groups.iterations);
let jit_time = self.bench_jit(code, groups.iterations);
// Summary
let vm_vs_interp = interpreter_time.as_secs_f64() / vm_time.as_secs_f64();

View File

@ -110,7 +110,8 @@ impl NyashRunner {
_ => {
if cli_verbose() {
println!("🦀 Nyash Rust Implementation - Executing file: {} 🦀", filename);
if let Some(fuel) = self.config.debug_fuel {
let groups = self.config.as_groups();
if let Some(fuel) = groups.debug.debug_fuel {
println!("🔥 Debug fuel limit: {} iterations", fuel);
} else {
println!("🔥 Debug fuel limit: unlimited");
@ -498,8 +499,9 @@ impl NyashRunner {
}
// Parse the code with debug fuel limit
eprintln!("🔍 DEBUG: Starting parse with fuel: {:?}...", self.config.debug_fuel);
let ast = match NyashParser::parse_from_string_with_fuel(code_ref, self.config.debug_fuel) {
let groups = self.config.as_groups();
eprintln!("🔍 DEBUG: Starting parse with fuel: {:?}...", groups.debug.debug_fuel);
let ast = match NyashParser::parse_from_string_with_fuel(code_ref, groups.debug.debug_fuel) {
Ok(ast) => { eprintln!("🔍 DEBUG: Parse completed, AST created"); ast },
Err(e) => { eprintln!("❌ Parse error: {}", e); process::exit(1); }
};

View File

@ -35,7 +35,8 @@ impl NyashRunner {
};
// Determine output file
let output = self.config.output_file.as_deref().unwrap_or_else(|| {
let groups = self.config.as_groups();
let output = groups.output_file.as_deref().unwrap_or_else(|| {
if filename.ends_with(".nyash") { filename.strip_suffix(".nyash").unwrap_or(filename) } else { filename }
});
let output_file = format!("{}.wat", output);
@ -46,4 +47,3 @@ impl NyashRunner {
}
}
}