zig/example/hello_world/hello.zig

10 lines
330 B
Zig
Raw Normal View History

const std = @import("std");
2015-11-24 01:43:45 -08:00
2017-04-03 21:17:24 -07:00
pub fn main() -> %void {
// If this program is run without stdout attached, exit with an error.
var stdout_file = %return std.io.getStdOut();
// If this program encounters pipe failure when printing to stdout, exit
// with an error.
%return stdout_file.write("Hello, world!\n");
2015-08-05 15:46:40 -07:00
}