I don't see why printing to stdout in zig is so convoluted. I get that the language is in prerelease, but the fact that there's not as easy way to do it, and they've changed how you do it TWICE makes it really hard to figure out because none of the docs are up to date.
Can you guess which one of these is the current method?
1)
const std = @import("std"); pub fn main() !void { const stdout = std.io.getStdOut().writer(); try stdout.print("Hello, {s}!\n", .{"world"}); }
2)
const std = @import("std"); pub fn main(init: std.process.Init) !void { try std.Io.File.stdout().writeStreamingAll(init.io, "Hello, World!\n"); }
3)
const std = @import("std"); pub fn main() !void { try std.fs.File.stdout().writeAll("Hello, World!\n"); }
@xyfdi Yeah, but that's additional friction that just slows down development. In every other language, it's a one-liner. Even C++ in all it's verbosity allows you to pipe something into cout in a quarter of the characters