Zig is amazing, yet there is one thing that I hate in that language.
Importing Zig code as file like import(‘./foo.zig’) isn't good idea. Rust’s approach is way cleaner, and it also forces developers to namespace their code properly.
On Zig, we have foo.zig that re-exports files under foo/ folder. Why don't we have mod.zig in each folder instead like Rust does? Sometimes it is very hard to track files and folders since this practice allows poor namespacing.
On many GitHub projects, I see code like import(‘../../allocator/mimalloc.zig’). Instead, I always stick with import('root’).allocator.mimalloc. Path-based code importing makes refactoring and restructuring code very hard, and this style is too prevalent in Zig projects right now.
I'm currently working on porting xv6 to Zig. I'm trying to properly namespace all the code I've written with minimal path-based import statement, which facilitates both reading and writing code.