📚 Phase 11 documentation: Everything is Box × MIR15 revolution

Key updates:
- Document MIR 26→15 instruction reduction plan (transitioning status)
- Add Core-15 target instruction set in INSTRUCTION_SET.md
- Save AI conference analyses validating Box Theory and 15-instruction design
- Create MIR annotation system proposal for optimization hints
- Update SKIP_PHASE_10_DECISION.md with LLVM direct migration rationale

Technical insights:
- RefNew/RefGet/RefSet can be eliminated through Box unification
- GC/sync/async all achievable with 15 core instructions
- BoxCall lowering can automatically insert GC barriers
- 2-3x performance improvement expected with LLVM
- Build time reduction 50%, binary size reduction 40%

Status: Design complete, implementation pending
This commit is contained in:
Moe Charm
2025-08-31 03:03:04 +09:00
parent 1812cda7d5
commit b003bdf25b
50 changed files with 2621 additions and 136 deletions

View File

@ -119,7 +119,9 @@ impl MirBuilder {
let exit_block = self.block_gen.next();
// Set up exception handler for the try block (before we enter it)
if let Some(catch_clause) = catch_clauses.first() {
if std::env::var("NYASH_BUILDER_DISABLE_TRYCATCH").ok().as_deref() == Some("1") {
// Fallback: build try body only
} else if let Some(catch_clause) = catch_clauses.first() {
let exception_value = self.value_gen.next();
// Register catch handler for exceptions that may occur in try block
@ -152,6 +154,7 @@ impl MirBuilder {
self.start_new_block(catch_block)?;
// Handle catch clause
if std::env::var("NYASH_BUILDER_DISABLE_TRYCATCH").ok().as_deref() != Some("1") {
if let Some(catch_clause) = catch_clauses.first() {
// Build catch body
let catch_ast = ASTNode::Program {
@ -159,7 +162,7 @@ impl MirBuilder {
span: crate::ast::Span::unknown(),
};
self.build_expression(catch_ast)?;
}
}}
// Catch completion - jump to finally or exit (if not already terminated)
if !self.is_current_block_terminated() {