News for hackers. Stuff that matters.
Re:Zig Quirks by throwawaymaths on Monday March 27, 2023 @11:11AM (#35327718)
I work in a language where all fields are public and it is indispensable in debugging things. You DO NOT want your datatypes hiding things under the hood.

At best, if zig does want to make fields private, they should still be visible, but the compiler should disallow writing to them.

Re:Zig Quirks by hellcow on Monday March 27, 2023 @11:35AM (#35328046)
I believe you, but I haven't encountered anything like this in my work in a higher-level language, and this is my first push into manual memory management since I studied C in college many years ago.

Can you offer some examples of times when it has been indispensable, so that I can understand when this is useful?

Re:Zig Quirks by throwawaymaths on Monday March 27, 2023 @11:45AM (#35328168)
don't remember any off the top of my head. I use elixir, I do often dive into the data structures with IO.inspect(..., structs: false) which exposes all of the "hidden" fields. Enough so that I know how to do this without having to look it up.

I suppose you could also use the debugger, but I value my time.