I’m loving ZIG! will be starting a Twitch series where I’ll be building an RISC-V (RV32I) emulator from scratch Zig, live on…https://t.co/kDx6qACG0F
documenting the entire process, figuring and breaking things, debugging, learning along the way..etc
No AI btw
@samuellhuber Not quite it. ignore the constant names. Read the else blocks. The first else with braces doesn’t compile but the second else with no braces compiles. I’m really curious as to why.
If you can't get the same performance out of C, C++, Rust, and Zig then you are doing it wrong. They can be matched essentially one-to-one and all even have inline as escape hatches. None of these languages produces faster binaries than the others can.
@jorandirkgreef@axboe@heidiann360 Static allocation makes taste explicit through your code, it forces your whole team into good design.
It helps you understand the physics of your system, eliminates fragmentation, gives you physical memory safety. You can't use-after-free if you never free!
@hublan2@nuoji I guess the lack of data structures ergonomics like dynamic arrays, strings etc made C seems like it’s not, even tho C was generally used as an application language.
this framing feels off to me, every language forces you to model your program using the tools it gives you. In C you still have to mirror your logic with structs, unions, pointers, arrays, manual allocs, etc. You’re not magically thinking pure CPU and cache while ignoring the language’s constraints.
Rust just makes the modeling more explicit and type system heavy (enums, traits, borrow checker, ownership). It’s a real difference in cognitive load, sure but making it seem like C/Zig lets you skip modeling entirely is false.
@TheEduardoRFS then can we also say that every powerful language feature is defined by its worst use case?, we shouldn’t mix up a feature enables X vs a feature exists for X
@TheEduardoRFS ok fair, we could also argue that most language features are abused and besides, abuse isn’t really a property of early return but the code.. I guess