Writergate: Zig I/O Interface Overhaul

(alexrios.me)

33 points | by signa11 1 hour ago

5 comments

  • bayesnet 35 minutes ago
    As someone who doesn’t write Zig, I wish the code examples gave type annotations for the writers so I could see the difference between the old generic API and the new `std.Io` interface.
  • sarreph 1 hour ago
    As someone who doesn't write Zig (but is hoping to soon!), I'm struck when reading this that the new interface seems much more verbose than the old interface... i.e. 6 LoC vs the previous implementation's 3 LoC.

    I was under the impression that verbosity was something that Zig tries to reduce, but perhaps this is not emblematic of other updates to the language?

  • Jowsey 1 hour ago
    So many Claude-isms in one post. Please stop.
  • Nail2680 1 hour ago
    Needing to manually call flush seems like a major issue, is there a friendlier wrapper in the std lib to print and flush and use some static storage for the buffer? Since that seems like it would become step one of any zig project
    • KolmogorovComp 40 minutes ago
      I agree, the less batterie-complete STD become, the more everyone get its own half-baked utility one.
    • eptcyka 40 minutes ago
      It mirrors the C interface.
      • metaltyphoon 24 minutes ago
        Well, printf flushes when \n is encountered. Does zig have something similar?
  • delusional 50 minutes ago
    This reads either AI generated, or written by someone who has gotten too used to AI writing. The structure is off and filled with "Here's what happened next" and "Why that matters" and "X happens, not Y" without context for why I'd care, or why I'd expect Y.