logoalt Hacker News

lolinderyesterday at 2:45 PM1 replyview on HN

The example shows three extra lines of code, two of which are `defer`s. I'm not an expert in Zig and can't tell you whether the example they give is contrived, but the claim they're making is way more than "a wrapper type".

> And that is considering humans write the code manually. Why does it matter if agents write the code? This makes no sense.

Because the particular form of non-ergonomic code that is demonstrated here amounts to a quadrupling of tokens. That's a substantial hit to the context window for safety that isn't even statically enforced.


Replies

simjndyesterday at 10:27 PM

A wrapper class if you want, a wrapper type with methods / dedicated functions. Still, seems pretty ergonomic to me. Yeah we went from one line to three, but the three lines guarantee safety whereas the one doesn't so?

Also I'm not sure the token count is very relevant for an Anthropic employee who just spent 165k worth of token rewriting the whole thing in Rust. Sprinkling a few defers here and there and swapping types surely would have been immensely cheaper in tokens.