logoalt Hacker News

Arch485today at 1:23 PM0 repliesview on HN

It's not so much a workaround as it is an elegance in design. In Zig, when you @import a file, that file is converted to a struct with comptime fields for all of the public members. Similarly, a "namespace" in Zig is just a nested struct with more fields. Usually it's just another import of something else.

N.B.: Coffee hasn't reached my bloodstream yet; accuracy not guaranteed.