4 ms·
No offense, and God forbid I sound like a "fanboy" but I'd highly recommend using Rust or Zig instead of c for the rest of your project. I appreciate C and asse
by sourcegrift 6mo ago
No offense, and God forbid I sound like a "fanboy" but I'd highly recommend using Rust or Zig instead of c for the rest of your project. I appreciate C and assembly and am pretty "conservative" in my choices of PL but both rust and zig, despite having their own disadvantages, and also a slightly unpleasant community based on where you come from, are actually plain better than C in every respect. The abstractions are 0 cost and often pretty "transparent" so you know exactly what's happening behind the scenes.
- Luka12-dev 6mo agoThanks for the suggestion! I've heard great things about both Rust and Zig for systems programming. I started with C because most osdev resources and tutorials use C, and I wanted to understand manual memory management at the lowest level first. Might explore rewriting parts in Rust or Zig in the future, the safety guarantees do sound appealing for kernel code!
- apitman 6mo agoI disagree. Rust and Zig bring millions of lines of code of dependencies and complexity in their toolchains. We can hope for a relatively simple Zig compiler someday, but probably not Rust. If you care about portability (now and in the future), C is a much better choice.
- Luka12-dev 6mo agoFair point on toolchain complexity and portability, C's minimalism there is genuinely hard to beat. But it's a tradeoff: you're trading toolchain simplicity for the burden of manually ensuring memory safety. Depends on whether your priority is long-term portability or correctness guarantees.