• 0 Posts
  • 6 Comments
Joined 1 year ago
cake
Cake day: November 13th, 2023

help-circle
  • As someone who just picked through the Zig docs (take this with a mountain of salt), Zig has a few things going for it:

    • spec is simple and closer to C in scope
    • modern language design, toolchain, and overall ergonomics
    • Go-like struct & interface system
    • 1st-class C interoperability

    Go foists co-routines on you and the runtime, and Rust has the borrow checker. Both of these things deeply impact language design, standard libraries, and the overall developer experience. So Zig might actually be a “more modern C” in many ways which makes it a contender. That said, it’s not a 1:1 comparsion since it lacks everything else that C++ does: you’d have to re-envision your software designs as something other than OOP if that’s what you’re used to.





  • There are probably a lot of scientific applications (e.g. statistics, audio, 3D graphics) where exponential notation is the norm and there’s an understanding about precision and significant digits/bits. It’s a space where fixed-point would absolutely destroy performance, because you’d need as many bits as required to store your largest terms. Yes, NaN and negative zero are utter disasters in the corners of the IEEE spec, but so is trying to do math with 256bit integers.

    For a practical explanation about how stark a difference this is, the PlayStation (one) uses an integer z-buffer (“fixed point”). This is responsible for the vertex popping/warping that the platform is known for. Floating-point z-buffers became the norm almost immediately after the console’s launch, and we’ve used them ever since.