PHI type coercion and core-first routing fixes:
- Auto type conversion for PHI nodes (i64↔i8*↔i1↔f64)
- Fixed ArrayBox.get misrouting to Map path
- Core-first strategy for Array/Map creation
- Added comprehensive debug logging ([PHI], [ARR], [MAP])
Results:
✅ Array smoke test: 'Result: 3'
✅ Map smoke test: 'Map: v=42, size=1'
After 34+ minutes of battling Rust lifetime errors,
ChatGPT5 achieved a major breakthrough\!
Key insight: The bug wasn't in PHI/SSA logic but in
Box type routing - ArrayBox.get was incorrectly caught
by Map fallback due to missing annotations.
We're SO CLOSE to Nyash self-hosting paradise\! 🌟
Once this stabilizes, everything can be written in
simple, beautiful Nyash code instead of Rust complexity.
ChatGPT5 struggling for 34+ minutes with Rust lifetime/build errors...
This perfectly illustrates why we need Phase 22 (Nyash LLVM compiler)\!
Key insights:
- 'Rust is safe and beautiful' - Gemini (who never fought lifetime errors)
- Reality: 500-line error messages, 34min debug sessions, lifetime hell
- C would just work: void* compile(void* mir) { done; }
- Python would work: 100 lines with llvmlite
- ANY language with C ABI would work\!
The frustration is real:
- We're SO CLOSE to Nyash self-hosting paradise
- Once bootstrapped, EVERYTHING can be written in Nyash
- No more Rust complexity, no more 5-7min builds
- Just simple, beautiful Box-based code
Current status:
- PHI/SSA hardening in progress (ChatGPT5)
- 'phi incoming value missing' in Main.esc_json/1
- Sealed SSA approach being implemented
The dream is near: Everything is Box, even the compiler\! 🌟
- Add function name prefix to basic block labels to avoid cross-function conflicts
- blocks.rs: create_basic_blocks now takes fn_label parameter
- Format: 'Main_join_2_bb23' instead of just 'bb23'
- Add conservative fallback for missing terminators (jump to next or entry)
- This fixes 'Basic Block does not have terminator' verification error
Analysis insights:
- MIR output was correct (all blocks had terminators)
- Problem was LLVM-side block name collision between functions
- Classic case of 'Rust complexity' - simple C++ style fix works best
- Sometimes the simplest solution is the right one\!