This goes to show how Zig's language design makes everything look nicer and simpler - the `errdefer` patterns in tests are super nice! I've debugged my Zig tests with simple print debugging (or try to narrow it down to a standalone case I can use a debugger), but I'll certainly use some of these tricks in the future.
These are excellent tips. I especially like the debugger integration in build.zig. I used to grep the cache directory to find the exe. The integration avoids all the extra steps.
It's very nice and worth the $75 IMO. The new font builder they have gives you a lot of options to tweak/customize the typeface, which is also very nice.
It's amazing how coherent Zig's fundamental building blocks are as a programming language, everything fits together like a puzzle.
This post reminds me of one of Andrew's early talks about the type system and the comptime... With the core building blocks, we can achieve elegant solutions without adding unnecessary syntax complexity.
A little bit unrelated, but how do people deal with the abstinence of payloads in zig errors? For example, when parsing a JSON string, the error `UnexpectedToken` is not very helpful. Are libraries typically designed to accept an optional input to store potential errors?
Cool stuff, but the mixed casings I see here (and have in other Zig code) puts me on edge (not literally but yeah). You’ve got `addSystemCommand` then a variable named `debug_step` which has a call `dependOn`. That said, looks like most of the stdlib stuff is camel case so the snake case variables are just the authors preference.
12 comments
[ 3.2 ms ] story [ 34.9 ms ] thread``` void func() { scope(failure) writeln("Something went wrong!"); } ```
[1] https://tour.dlang.org/tour/en/gems/scope-guards
It's very nice and worth the $75 IMO. The new font builder they have gives you a lot of options to tweak/customize the typeface, which is also very nice.
This post reminds me of one of Andrew's early talks about the type system and the comptime... With the core building blocks, we can achieve elegant solutions without adding unnecessary syntax complexity.