9 pointsby ManuLinares2 hours ago3 comments
  • peeseman hour ago
    "not an expert in zig" but you can't even look at the documentation to find the `@tagName` builtin to do exactly the problem posed?: https://ziglang.org/documentation/0.16.0/#tagName

    i can literally google "zig enum to string" and the first result is a reddit post where the given solution is `@tagName`. i'm ready to write this post off as a low-effort ad for C3

    • jb199119 minutes ago
      Agree, the post was extremely low effort.
    • ManuLinares9 minutes ago
      [dead]
  • RyanVail8 minutes ago
    Zig doesn't have attributes, but you could just create a thin wrapper struct over an inner type and use setter functions that throw errors on invalid values. Personally I prefer this over attributes because it forces you to handle possible error states from the callers of the setters, instead of relying on you remembering to call `validate` on your types.
  • WalterBrightan hour ago
    There's a large black zig-zag blocking reading the text.