💢 The truth about Rust + LLVM development hell
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\! 🌟
This commit is contained in:
@ -159,9 +159,23 @@ fn store_invoke_return<'ctx>(
|
||||
) -> Result<(), String> {
|
||||
if let Some(mt) = func.metadata.value_types.get(&dst) {
|
||||
match mt {
|
||||
crate::mir::MirType::Integer | crate::mir::MirType::Bool => {
|
||||
crate::mir::MirType::Integer => {
|
||||
vmap.insert(dst, rv);
|
||||
}
|
||||
crate::mir::MirType::Bool => {
|
||||
// Normalize i64 bool (0/1) to i1
|
||||
if let BVE::IntValue(iv) = rv {
|
||||
let i64t = codegen.context.i64_type();
|
||||
let zero = i64t.const_zero();
|
||||
let b1 = codegen
|
||||
.builder
|
||||
.build_int_compare(inkwell::IntPredicate::NE, iv, zero, "bool_i64_to_i1")
|
||||
.map_err(|e| e.to_string())?;
|
||||
vmap.insert(dst, b1.into());
|
||||
} else {
|
||||
vmap.insert(dst, rv);
|
||||
}
|
||||
}
|
||||
crate::mir::MirType::String => {
|
||||
// keep as i64 handle
|
||||
vmap.insert(dst, rv);
|
||||
@ -191,4 +205,3 @@ fn store_invoke_return<'ctx>(
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user