<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hacker News: srcreigh</title><link>https://news.ycombinator.com/user?id=srcreigh</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Tue, 14 Apr 2026 20:48:08 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=srcreigh" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by srcreigh in "What Gödel Discovered (2020)"]]></title><description><![CDATA[
<p>The “l” is just as hard to pronounce correctly. English has a very nasal “l” compared to german.<p>Try saying English “hell” but dragging out the “l” (“helllllllll”); very nasal. Compare audio here: <a href="https://en.wiktionary.org/wiki/hell#German" rel="nofollow">https://en.wiktionary.org/wiki/hell#German</a></p>
]]></description><pubDate>Thu, 02 Apr 2026 15:06:30 +0000</pubDate><link>https://news.ycombinator.com/item?id=47615471</link><dc:creator>srcreigh</dc:creator><comments>https://news.ycombinator.com/item?id=47615471</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47615471</guid></item><item><title><![CDATA[New comment by srcreigh in "Finding all regex matches has always been O(n²)"]]></title><description><![CDATA[
<p>ChatGPT also loves Aho-Corasick and seems to overuse it as an optimization fall back idea. ChatGPT has suggested the algorithm to me but the code ended up slowing down a lot.</p>
]]></description><pubDate>Mon, 23 Mar 2026 20:09:44 +0000</pubDate><link>https://news.ycombinator.com/item?id=47494452</link><dc:creator>srcreigh</dc:creator><comments>https://news.ycombinator.com/item?id=47494452</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47494452</guid></item><item><title><![CDATA[New comment by srcreigh in "Show HN: I ported Tree-sitter to Go"]]></title><description><![CDATA[
<p>It's 2 or more spaces, not four</p>
]]></description><pubDate>Wed, 25 Feb 2026 20:02:54 +0000</pubDate><link>https://news.ycombinator.com/item?id=47157041</link><dc:creator>srcreigh</dc:creator><comments>https://news.ycombinator.com/item?id=47157041</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47157041</guid></item><item><title><![CDATA[New comment by srcreigh in "Ladybird adopts Rust, with help from AI"]]></title><description><![CDATA[
<p>I find the sweet spot is to take LLM generated code, then profile manually and heavily supervise or hand implement specific improvements.</p>
]]></description><pubDate>Tue, 24 Feb 2026 02:56:07 +0000</pubDate><link>https://news.ycombinator.com/item?id=47132294</link><dc:creator>srcreigh</dc:creator><comments>https://news.ycombinator.com/item?id=47132294</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47132294</guid></item><item><title><![CDATA[New comment by srcreigh in "Ladybird adopts Rust, with help from AI"]]></title><description><![CDATA[
<p>Hey, sorry, I just have to defuse assumptions people make when they see Rust, LLMs, and "as fast as can be" in short proximity. Your project is obviously cool, and I don't think the fact that it's likely still multiples more resource intensive than an absolutely minimal version takes away from that.</p>
]]></description><pubDate>Tue, 24 Feb 2026 02:46:32 +0000</pubDate><link>https://news.ycombinator.com/item?id=47132229</link><dc:creator>srcreigh</dc:creator><comments>https://news.ycombinator.com/item?id=47132229</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47132229</guid></item><item><title><![CDATA[New comment by srcreigh in "Ladybird adopts Rust, with help from AI"]]></title><description><![CDATA[
<p>That's a given, and agents still come out 2-10x slower in my experience.</p>
]]></description><pubDate>Tue, 24 Feb 2026 02:36:13 +0000</pubDate><link>https://news.ycombinator.com/item?id=47132149</link><dc:creator>srcreigh</dc:creator><comments>https://news.ycombinator.com/item?id=47132149</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47132149</guid></item><item><title><![CDATA[New comment by srcreigh in "Ladybird adopts Rust, with help from AI"]]></title><description><![CDATA[
<p>First, it is important for these discussions that people include details like I did. We're all better off to not generalize.<p>RE: Claude Code, no I haven't used it, but I did do the Anthropic interview problem, beating all of Anthropic's reported Claude scores even with custom harnesses etc.<p>It's not a dunk that agents can't produce "as fast as can be" code; their code is usually still reasonably fast; it's just often 2-10x slower than can be.</p>
]]></description><pubDate>Mon, 23 Feb 2026 21:13:06 +0000</pubDate><link>https://news.ycombinator.com/item?id=47128929</link><dc:creator>srcreigh</dc:creator><comments>https://news.ycombinator.com/item?id=47128929</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47128929</guid></item><item><title><![CDATA[New comment by srcreigh in "Ladybird adopts Rust, with help from AI"]]></title><description><![CDATA[
<p>Re "is fast as can be": in my experience generating C/Zig code via Codex, agent generated code is usually several multiples slower than hand optimized code.</p>
]]></description><pubDate>Mon, 23 Feb 2026 19:25:05 +0000</pubDate><link>https://news.ycombinator.com/item?id=47127424</link><dc:creator>srcreigh</dc:creator><comments>https://news.ycombinator.com/item?id=47127424</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47127424</guid></item><item><title><![CDATA[New comment by srcreigh in "Error payloads in Zig"]]></title><description><![CDATA[
<p>Thanks Andy.<p>Would you endorse the pattern I described in my article if the calling code could have other uses for the diagnostic info than just logging?<p>In my project I decided that the CLI main should be the place with a reporting mechanism. All the internal code is agnostic to how errors are handled. Many errors could be retried, even if they are currently not, and in some cases you also need extra diagnostic data in order to retry. For example if 1/4 plugins fails to load, I would need to know which one failed to ask the user interactively where to find it or whether to skip it before retrying. There's a few different errors like this, and layers between the handling code and the error source code, which is how I ended up with the union(enum) diagnostic keyed by error code pattern.<p>It seems that "error codes aren't a reporting mechanism", practically speaking, means that internal application code should just log its own error and return a generic error code that bubbles up unhandled out of main. You decided that this wasn't ok for allocation failures and encourage retrying those, which I find to be inspiring, but apparently most types of application errors are fine to essentially log and ignore. So that is confusing.<p>I love Zig, and look up to you a lot, so thanks for all your efforts over the years!</p>
]]></description><pubDate>Tue, 17 Feb 2026 13:19:18 +0000</pubDate><link>https://news.ycombinator.com/item?id=47047194</link><dc:creator>srcreigh</dc:creator><comments>https://news.ycombinator.com/item?id=47047194</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47047194</guid></item><item><title><![CDATA[New comment by srcreigh in "Error payloads in Zig"]]></title><description><![CDATA[
<p>I agree. You understand why I wrote this post. It's what I wanted to read 3 weeks ago. We're told "Use Diagnostics like the json stdlib module!" but then you realize the json module is way too simplistic for a complicated application.<p>But also, I'm sure this method has flaws and can be greatly improved, so hopefully we can come to the right solution.</p>
]]></description><pubDate>Mon, 16 Feb 2026 16:47:15 +0000</pubDate><link>https://news.ycombinator.com/item?id=47037213</link><dc:creator>srcreigh</dc:creator><comments>https://news.ycombinator.com/item?id=47037213</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47037213</guid></item><item><title><![CDATA[New comment by srcreigh in "Error payloads in Zig"]]></title><description><![CDATA[
<p>It's worth every effort to avoid situations where a function creates extra clean up responsibilities to the caller only on error conditions.<p>If I really needed a large error payload, too big to fit on the stack, I'd probably want to do something like this:<p><pre><code>  const errbuf = try alloc.alloc(u8, 1024*1024*1024);
  module.setErrorBuf(&errbuf)
  defer {
    module.setErrorBuf(null);
    alloc.free(errbuf);
  }

  var func_diag = diagnostics.OfFunction(module.func){};
  module.func(foo, bar, &func_diag) catch |err| switch (err) {
    error.BigPayload => {
      const payload = func_diag.get(error.BigPayload);

      // The payload can reference the 1MiB of data safely here,
      // and it's cleaned up automatically.
    }
  }</code></pre></p>
]]></description><pubDate>Mon, 16 Feb 2026 16:40:40 +0000</pubDate><link>https://news.ycombinator.com/item?id=47037135</link><dc:creator>srcreigh</dc:creator><comments>https://news.ycombinator.com/item?id=47037135</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47037135</guid></item><item><title><![CDATA[New comment by srcreigh in "Error payloads in Zig"]]></title><description><![CDATA[
<p>Oh thanks a bunch. That’s confusing. Removed that.</p>
]]></description><pubDate>Mon, 16 Feb 2026 05:35:46 +0000</pubDate><link>https://news.ycombinator.com/item?id=47031244</link><dc:creator>srcreigh</dc:creator><comments>https://news.ycombinator.com/item?id=47031244</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47031244</guid></item><item><title><![CDATA[New comment by srcreigh in "Error payloads in Zig"]]></title><description><![CDATA[
<p>This is just a "complex real world app code" extension of the stdlib Diagnostics pattern.<p><pre><code>  % rg Diagnostics zig/lib/std | wc -l
  165
</code></pre>
The zig stdlib kind of has it easy because, for example, the json module can have one schema for error diagnostics. An app that stitches together a bunch of libraries and has a few internal modules is going to want some different Diagnostics schemas for different errors, and sharing those schemas and bubbling them up, so that's just what this is.</p>
]]></description><pubDate>Mon, 16 Feb 2026 04:54:35 +0000</pubDate><link>https://news.ycombinator.com/item?id=47031040</link><dc:creator>srcreigh</dc:creator><comments>https://news.ycombinator.com/item?id=47031040</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47031040</guid></item><item><title><![CDATA[New comment by srcreigh in "Error payloads in Zig"]]></title><description><![CDATA[
<p>What more do you want than what's covered in the post?<p>To me, this post is proof zig doesn't need "proper support". You can already have extremely ergonomic error payloads with existing language features.<p>Earlier version of this post had some language feature ideas, but then I realized Zig already had all the capabilities, so I just removed that section.<p>For example, I used to think it'd be nice for functions to be a namespace, so I didn't have `myFunc` and `MyFuncDiagnostics`. But then I realized that the Diagnostics type doesn't need its own name; you can just put the type in the function signature, and use a function like `diagnostics.OfFunction(fn)` to extract the type from the function definition, so you can just write this:<p><pre><code>  var diag: diagnostics.OfFunction(myFunc) = .{};
  const res = myFunc(foo, bar, &diag) catch |err| ...;
</code></pre>
As another example, I used to write out the `error{OutOfMemory, ...}` type explicitly in addition to the tagged union payload, but then realized you can generate an error set from the union tags at comptime.<p>Do you want automatic inference of the error payload type? So zig creates a special tagged union error payloads type for you automatically? It seems complicated and maybe not a good idea. Do you really want your function to return an invisible 20 elements union on error? Do you want to call a someone else's function which returns an invisible 20 elements union on error? You know, maybe it's not a good idea.</p>
]]></description><pubDate>Mon, 16 Feb 2026 04:29:31 +0000</pubDate><link>https://news.ycombinator.com/item?id=47030903</link><dc:creator>srcreigh</dc:creator><comments>https://news.ycombinator.com/item?id=47030903</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47030903</guid></item><item><title><![CDATA[New comment by srcreigh in "Error payloads in Zig"]]></title><description><![CDATA[
<p>It's just stored as a [256]u8 in the struct.<p><pre><code>  // sqlite.zig
  pub const ErrorPayload = struct {
      message: [256]u8,
  
      pub fn init(db: *c.sqlite3) @This() {
          var self = std.mem.zeroes(@This());
          var fw = std.Io.Writer.fixed(self.message[0..]);
          _ = fw.writeAll(std.mem.span(c.sqlite3_errmsg(db))) catch |err| switch (err) {
              error.WriteFailed => return self, // full
          };
          return self;
      }
  };</code></pre></p>
]]></description><pubDate>Mon, 16 Feb 2026 04:05:32 +0000</pubDate><link>https://news.ycombinator.com/item?id=47030771</link><dc:creator>srcreigh</dc:creator><comments>https://news.ycombinator.com/item?id=47030771</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47030771</guid></item><item><title><![CDATA[Error payloads in Zig]]></title><description><![CDATA[
<p>Article URL: <a href="https://srcreigh.ca/posts/error-payloads-in-zig/">https://srcreigh.ca/posts/error-payloads-in-zig/</a></p>
<p>Comments URL: <a href="https://news.ycombinator.com/item?id=47028705">https://news.ycombinator.com/item?id=47028705</a></p>
<p>Points: 93</p>
<p># Comments: 37</p>
]]></description><pubDate>Sun, 15 Feb 2026 23:08:43 +0000</pubDate><link>https://srcreigh.ca/posts/error-payloads-in-zig/</link><dc:creator>srcreigh</dc:creator><comments>https://news.ycombinator.com/item?id=47028705</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47028705</guid></item><item><title><![CDATA[New comment by srcreigh in "Platforms bend over backward to help DHS censor ICE critics, advocates say"]]></title><description><![CDATA[
<p>The US regime allows its citizens to criticize politicians. That doesn't mean you are free to criticize those in power.</p>
]]></description><pubDate>Sat, 14 Feb 2026 19:33:24 +0000</pubDate><link>https://news.ycombinator.com/item?id=47017546</link><dc:creator>srcreigh</dc:creator><comments>https://news.ycombinator.com/item?id=47017546</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47017546</guid></item><item><title><![CDATA[New comment by srcreigh in "Platforms bend over backward to help DHS censor ICE critics, advocates say"]]></title><description><![CDATA[
<p>Care to elaborate?</p>
]]></description><pubDate>Sat, 14 Feb 2026 18:14:04 +0000</pubDate><link>https://news.ycombinator.com/item?id=47016831</link><dc:creator>srcreigh</dc:creator><comments>https://news.ycombinator.com/item?id=47016831</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47016831</guid></item><item><title><![CDATA[New comment by srcreigh in "Zig – io_uring and Grand Central Dispatch std.Io implementations landed"]]></title><description><![CDATA[
<p>There's a relevant open issue[1] here about stack memory optimization. It would be nice to be able to use a [500]u8 in a block and another [500]u8 in another block, and have that only contribute 500 bytes to the stack frame, but Zig can't currently do this.<p>(The green threads coro stack stuff makes this more important.)<p>[1]: <a href="https://github.com/ziglang/zig/issues/23475#issuecomment-2795855793" rel="nofollow">https://github.com/ziglang/zig/issues/23475#issuecomment-279...</a></p>
]]></description><pubDate>Sat, 14 Feb 2026 17:56:12 +0000</pubDate><link>https://news.ycombinator.com/item?id=47016655</link><dc:creator>srcreigh</dc:creator><comments>https://news.ycombinator.com/item?id=47016655</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47016655</guid></item><item><title><![CDATA[New comment by srcreigh in "Zig – io_uring and Grand Central Dispatch std.Io implementations landed"]]></title><description><![CDATA[
<p>Please stop posting 0-information-content complaints.</p>
]]></description><pubDate>Sat, 14 Feb 2026 17:16:18 +0000</pubDate><link>https://news.ycombinator.com/item?id=47016239</link><dc:creator>srcreigh</dc:creator><comments>https://news.ycombinator.com/item?id=47016239</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47016239</guid></item></channel></rss>