News for hackers. Stuff that matters.

latch

Re:Four Months of Zig on Tuesday October 27, 2026 @08:41PM (#50267937)
The library developer doesn't know what allocator will be passed, and the library user doesn't necessarily know how it will be used. They share an interface, so it will [probably] work, but it might not behave (mem/perf wise) as either expects. ArenaAllocators in particular don't play great with ArrayLists or nested ArenaAllocators.

I don't think it's a huge problem, but it's more subtle than an explicit allocator is a better because it provides more flexibility.

Re:Iceland votes on whether to restart talks on joining EU on Saturday August 29, 2026 @09:31AM (#49489780)
And Canada, the UK, Australia, New Zealand, ...
Re:Iceland votes on whether to restart talks on joining EU on Saturday August 29, 2026 @09:30AM (#49489772)
401 people voted directly for her.
Re:U.S. State Department Pauses Immigrant Visa Applications on Thursday August 27, 2026 @12:59AM (#49459949)
Who's angry about how people are spending their already-taxed income? Is that really a thing? Is it sincere or just racism masked as "think of the economy"? (Honest question, Not American. Don't live there, news to me).
Re:Leave your screen unlocked, meet developers paypal.com on Sunday August 16, 2026 @09:09AM (#49319726)
left alt + left shift + print screen toggles high contrast mode in Window 9x. That was always fun to do on an unlocked screen.
"common sense" is common sense because it is the "sound and prudent judgment based on a simple perception of the situation or facts" (1).

Maybe what you meant to say is that the position isn't, in fact, "common sense", that it is neither sound or prudent?

(1) https://www.merriam-webster.com/dictionary/common%20sense

You can read the guidelines at https://news.ycombinator.com/newsguidelines.html

Might find this one relevant:

"If a story is spam or off-topic, flag it. Don't feed egregious comments by replying; flag them instead. If you flag, please don't also comment that you did."

Re:Is The Economist Always Wrong? on Tuesday July 07, 2026 @10:47PM (#48826901)
Felt it ~600KM away in a high floor, building was swaying. Others didn't feel it and at first I thought I was just [unusually] light-headed or something, but then we realized a door was swinging back and forth slightly, and a hanging plant was swaying.
I also dislike his self-promotion, but his work _is_ well know and, as far as I know, well looked upon. I think he has more expertise and knowledge in this area than most (including what you'd find in the news).
Re:Aspartame is not that bad? on Friday April 24, 2026 @11:41AM (#47891782)
Are you moving the goal post? I generally trust health agencies, more so when they all agree.
Re:Aspartame is not that bad? on Friday April 24, 2026 @10:07AM (#47890516)
Not sure how you get to that conclusion from the article when it ends with the conclusion from 5 health agencies that it's safe (and then more references from the scientific community that it's safe).
Re:The 1987 Game "The Last Ninja" was 40 kilobytes on Monday April 06, 2026 @01:05AM (#47657192)
I'm not sure this is particularly telling. You can write a tiny program that generates a 4K image, and the image could be 1000x larger.

Or, if I write a short description "A couple walks hand-in-hand through a park at sunset. The wind rustles the orange leaves.", I don't think it would be surprising to anyone that an image or video of this would be relatively huge.

Re:Zig – Type Resolution Redesign and Language Changes on Wednesday March 11, 2026 @01:29AM (#47332001)
20 seconds each time. Last time I tried to enable incremental build, it wasn't working for us. It was a while ago, but I think it had to do with something in our v8 bridge.
Re:Zig – Type Resolution Redesign and Language Changes on Tuesday March 10, 2026 @11:26PM (#47331446)
Just a slower build. From ~20 seconds to ~65 seconds the first time after I nuke it.
Re:Zig – Type Resolution Redesign and Language Changes on Tuesday March 10, 2026 @10:54PM (#47331273)
Zig 0.15 is pretty stable. The biggest issue I face daily are silent compiler errors (SIGBUS) for trivial things, e.g. a typo in an import path. I've yet to find exactly why this [only sometimes] causes such a crash, but they're a real pain to figure out over a large changeset. `zig ast-check` sometimes catches the error, else Claude's pretty good at spotting where I accidentally re-used a variable name (again, 90% of the time I do that, it's an easy error, but the other 10%, I get a message-less compiler crash). It sounds like the changes in the OP might be specifically addressing these types of issues.

Also, my .zig-cache is currently at 173GB, which causes some issues on the small Linux ARM VPS I test with.

As for upgrades. I upgraded lightpanda to 0.14 then 0.15 and it was fine. I think for lightpanda, the 0.16 changes might not be too bad, with the only potential issue coming from our use of libcurl and our small websocket server (for CDP connections). Those layers are relatively isolated / abstracted, so I'm hopeful.

As a library developer, I've given up following / tracking 0.16. For one, the change don't resonate with me, and for another, it's changing far too fast. I don't think anyone expects 0.16 support in a library right now. I've gotten PRs for my "dev" branches from a few brave souls and everyone seems happy with that arrangement.

Re:Hetzner Prices increase 30-40% on Monday February 23, 2026 @05:35AM (#47120480)
Maybe because they still have to pay for part replacements?
Re:Error payloads in Zig on Monday February 16, 2026 @01:20AM (#47031507)
And what pattern would you recommend if you needed to allocate?
Re:Error payloads in Zig on Sunday February 15, 2026 @11:00PM (#47030745)
It wasn't clear from the examples, and the gist doesn't have a `deinit` method, so what happens if an error needs to own data?

> Here, sqlite.ErrorPayload.init saves 500 bytes of error message from sqlite

Who owns those 500 bytes and where are they being freed?

Re:Software Factories and the Agentic Moment on Saturday February 07, 2026 @08:33PM (#46930427)
Claude code has those "thoughts" you say it never will. In plan mode, it isn't uncommon that it'll ask you: do you want to do this the quick and simple way, or would you prefer to "extract this code into a reusable component". It also will back out and say "Actually, this is getting messy, 'boss' what do you think?"

I could just be lucky that I work in a field with a thorough specification and numerous reference implementations.

Re:Efficient String Compression for Modern Database Systems on Monday February 02, 2026 @05:10AM (#46854306)
Makes me think of an iolist in erlang/elixir.
Aren't you missing something? Gemini tells me that non-NA market makes up 33% of Ford's sales, and 51% of GMs.

So a better way to put it is "protects US automakers in the US." And that assumes NA manufacturers would be unaffected by declining sales abroad.

Isn't the problem exactly the opposite? A corporation has personhood which shields its executives?
Re:Is Zig's New Writer Unsafe? on Saturday September 20, 2025 @12:44PM (#45314924)
I ... don't disagree with you. Thanks. It helps my understanding.

I know this is moving the goalpost, but it's still a shame that it [obviously] has to be a runtime error. Practically speaking, I still think it leaves lot of friction and edge cases. But what you say makes sense: it doesn't have to be unsafe.

Makes me curious why they asserted instead of erroring in the first place (and I don't think that's exclusive to the zstd implementation right now).

Re:Is Zig's New Writer Unsafe? on Saturday September 20, 2025 @11:41AM (#45314303)
Then in the top-most snippet, what size should `buffer` be?
Re:Is Zig's New Writer Unsafe? on Saturday September 20, 2025 @11:38AM (#45314275)
Author here. I see it both ways.

Blog posts are collaboration (1). I did get the sense that Andrew doesn't see it that way. (And for this post in particular, and writegate in general, I have been discussing it on the discord channel. I know that isn't an official channel).

My reasons for not engaging more directly doesn't have anything to do with my confidence / knowledge. They are personal. The linked issues, which I was aware of, are only tangentially related. And even if they specifically addressed my concerns, I don't see how writing about it is anything but useful.

But I also got the sense that more direct collaboration is welcome and could be appreciated.

(1) - I'm the author of The Little MongoDB Book, The Little Redis Book, The Little Go Book, etc... I've always felt that the appeal of my writing is that I'm an average programmer. I run into the same problems, and struggle to understand the same things that many programmers do. When I write, I'm able to write from that perspective.

No matter how inclusive a community you have, there'll always be some opinions and perspectives which get drowned out. It can be intimidating to say "I don't understand", or "it's too complicated" or, god forbid, "I think this is a bad design"; especially when the experts are saying the opposite. I'm old enough that I see looking the fool as both a learning and mentoring experience. If saying "io.Reader is too complicated" saves someone else the embarrassment of saying it, or the shame of feeling it, or gives them a reference to express their own thoughts, I'm a happy blogger.

Re:I'm too dumb for Zig's new IO interface on Saturday August 23, 2025 @04:33AM (#44994361)
Author here.

I finally got it working. I had to flush both the encrypted writer and then the stream writer. There was also some issues with reading. Streaming works, but it'll always return 0 on the first read because Writer.Fixed doesn't implement sendFile, and thus after the first call, it internally switches from streaming mode to reading mode (1) and then things magically work.

Currently trying to get compression re-enabled in my websocket library.

(1) https://github.com/ziglang/zig/blob/47a2f2ddae9cc47ff6df7a71...

A friend recently shared a newspaper article about his company. I hadn't seen him in a little while, and I told him how great he looked. Turns out, an AI-assisted image was used. It surprised me - I had hoped/expected more from that paper.

The only thing that can be surprising about real estate agents doing it would be if anyone was surprised.

Re:Zig's New Async I/O on Sunday July 13, 2025 @01:47AM (#44547819)
I think having a thread pool on top of some evented IO isn't _that_ uncommon.

You might have a thread pool doing some very specific thing. You can do your own threadpool which wont use the Io interface. But if one of the tasks in the threadpool wanted to read a file, I guess you'd have to pass in the blocking Io implementation.

Older »