News for hackers. Stuff that matters.
Re:Anthropic acquires Bun by smj-edison on Tuesday December 02, 2025 @08:15PM (#46129117)
I can't speak as much about the last two examples, but writing a giant parser file is pretty common in Zig from what I've seen. Here's Zig's own parser, for example[1]. I'm also not sure what you mean by memory unsafe, since all slices have bounds checks. It also looks like this uses an arena allocator, so lifetime tracking is pretty simple (dump everything onto the allocator, and copy over the result at the end). Granted, I could be misunderstanding the code, but that's the read I get of it.

[1] https://codeberg.org/ziglang/zig/src/commit/be9649f4ea5a32fd...

Re:Anthropic acquires Bun by AndyKelley on Tuesday December 02, 2025 @09:42PM (#46129676)
It used to be arena-allocated but now it's using a different technique which I outlined in this talk: https://vimeo.com/649009599
Re:Anthropic acquires Bun by dgroshev on Wednesday December 03, 2025 @02:37AM (#46131310)
As it happens, the commit I linked fixes a segfault, which shouldn't normally happen in memory-safe code.