4 ms·
In my opinion Zig is elegant except for one thing: cannot attach data to error. https://github.com/ziglang/zig/issues/2647 https://github.com/ziglang/zig/issue
by delifue 1y ago
In my opinion Zig is elegant except for one thing: cannot attach data to error.
https://github.com/ziglang/zig/issues/2647 https://github.com/ziglang/zig/issues/2647
You have to workaround by things like passing into a pointer to error object.
- mark38848 1y agoYes also the function syntax is weird and ugly because functions aren't expressions.
- nextaccountic 1y agoWhat do you mean? pun fn f() { } ? How is this weird
- throwawaymaths 1y agoperfectly valid to do const f = fn (...) ... {...}
- nektro 1y agothis is because attaching a payload requires asking the question of who and how the memory of such a payload is managed, and Zig the language never prescribes you into a particular answer to that question.