I'm too dumb for Zig's new IO interface
a day ago
- #IO
- #Zig
- #TLS
- Zig 0.15 introduces a new IO interface with std.Io.Reader and std.Io.Writer types.
- The old IO interface had performance issues and relied on a mix of types and anytype.
- The tls.Client.init function requires *std.Io.Reader, *std.Io.Writer, and options.
- net.Stream provides reader() and writer() methods, but conversion to *std.Io.Reader/*std.Io.Writer is inconsistent.
- Buffering is a first-class citizen in the new IO interface, requiring specific buffer sizes.
- tls.Client.init requires mandatory options like ca_bundle, host, read_buffer, and write_buffer.
- Reading from tls.Client.reader is non-intuitive, lacking a simple read method.
- The provided example code for TLS client setup is complex and error-prone.