import std=std;
const my_module = @import("my_module.zig"); This allows you to access pub (public) declarations from my_module.zig through the my_module identifier.
Zig:
const std = @import("std"); pub fn main() !void { // std is like a namespace here std.debug.print("Hello, World!\n", .{}); }
import std.stdio; void main() { // no namespace here, "writeln" and everything else in "std.stdio" is imported writeln("Hello, World!"); }
import io = std.stdio; void main() { io.writeln("Hello, World!"); }
std.stdio.writeln("Hello, world!");