3 ms·
For those curious about Zig, I compiled (Zig version 0.10.1) the following source code: const std = @import("std"); pub fn main() !u8 { const stdout
by boberoni 3y ago
For those curious about Zig, I compiled (Zig version 0.10.1) the following source code:
const std = @import("std");
pub fn main() !u8 {
const stdout = std.io.getStdOut().writer();
try stdout.print("hi!\n", .{});
return 0;
}
...using the following compiler flags:
zig build-exe main.zig -target x86_64-linux -O Debug
#=> 965k
zig build-exe main.zig -target x86_64-linux -O ReleaseSafe
#=> 788k
zig build-exe main.zig -target x86_64-linux -O ReleaseFast
#=> 695k
zig build-exe main.zig -target x86_64-linux -O ReleaseSmall
#=> 9k
Zig with "-O ReleaseSmall" optimizations creates a 9k binary, putting it at 5th place on OP's chart.