With a bit of help from [Lumo](https://lumo.proton.me/) - the new update, 2.0, is solid. Comparing different AIs is another topic entirely. I appreciate running the Proton suite. Privacy matters these days, and Lumo fits the bill.
Lumo helped me split the files into manageable chunks. Then I went through each line of code myself to really understand what's going on.
I'm not here to vibe-code my game. I want to use AI as a senior programming mentor, to help when I falter or teach something new while I learn C.
Some things are clear as day thanks to my Rust background; others are less obvious. Take this cleanup logic:
```
if (engine->renderer) {
SDL_DestroyRenderer(engine->renderer);
engine->renderer = NULL;
}
```
`engine->renderer` is syntactic sugar for `(*engine).renderer`. In Rust terms, that's closer to `engine.renderer`. But here's the kicker: `if (engine->renderer)` relies on C's implicit boolean conversion. Any non-zero pointer is true. Rust forces `is_some()` or explicit `!= null`. C assumes you know what you're doing.
**The Lesson:**
The ownership model in C is simpler than Rust, but the responsibility is entirely yours. No compiler holding your hand. `calloc` zero-initializing the struct felt similar to `Box::<Engine>::default()` in Rust, but without any guarantee that the zero state is actually valid.
You own the memory, you own the lifetimes, you own the bugs.
Issue 0x0 done. Several more to go.
Next up: **[[0x2004_Issue 0x1 - Timer]]** — Delta time calculation and frame independence.
---
_[
[email protected]](mailto:
[email protected]) | [[0x2003_Issue 0x0 - Extraction]] → Previous: [[0x2002_Rust-VS-C]] → Next: [[0x2004_Issue 0x1 - Timer]]_