Am I the only one not totally in love with Zig’s module system? A lot of the language is really great, but there are two things that just kinda piss me off: the module system, and files as structs. Let me explain…
So, I was just recently trying out libvaxis to make a TUI gemini protocol browser, and it was mostly going fine. I got borders in child windows and a text input that works quite well for the address bar. And then I started looking at the TextView so that I could display the content text in a scrollable view.
So, I’m looking at the TextView file, oh… sorry, I mean struct… or… struct-file (makes gagging motion) and I see that I think I need a BufferWriter in the… struct, right, that’s what it is. Definitely not a namespace or module/package. This BufferWriter seems to require me to pass in a pointer to a DisplayWidth.DisplayWidthData
somehow. I see that DisplayWidth is “imported” like so: const DisplayWidth = @import("DisplayWidth");
So I Ctrl+Click in my fancy text editor on this import string, and somehow magically I end up within the zg library code! Like, WHAT?!?!?
There are so many things wrong with this, but just the fact that the import doesn’t tell me the real module/project/library/what-the-hell-ever is, well that just seriously pisses me off.
Things like this make me want to go back to Odin or Golang…