frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

The Scalar Select Anti-Pattern

https://matklad.github.io/2025/05/14/scalar-select-aniti-pattern.html
47•goranmoomin•9mo ago

Comments

castratikron•9mo ago
As long as processing one event does not affect any of the other events in the batch. E.g. events are file IO, and processing one event causes another event's descriptor to get closed before that event can be processed.
wahern•9mo ago
If the close routine on an event source, or the low-level (e.g. epoll) registration, deregistration, and dequeueing logic doesn't know how to keep polling and liveness state consistent between userspace and the kernel, they've got much bigger problems. This looks like Rust code so I would hope the event stream libraries are, e.g., keeping Rc'd file objects and properly managing reference integrity viz-a-viz kernel state before the application caller ever sees the first dequeued event in a cycle. This is a perennial issue with event loop libraries and buggy application code (in every language). One can't just deal with raw file descriptors, call the close syscall directly, etc, hoping to keep state consistent implicitly. There's an unavoidable tie-in needed between application's wrappers around low-level resources and the event loop in use.
taeric•9mo ago
I'm not entirely clear on what the proposal is at the end? Seems that the long term answer as to "which of these implications to pursue" is "all of them?" Simply taking in a batch of instructions doesn't immediately change much? You still have to be able to do each of the other things. And you will still expect some dependencies between batches that could possibly interact in the same ways.

In a sense, this is no different than how your processor is dealing with instructions coming in. You will have some instructions that can be run without waiting on previous ones. You will have some that can complete quickly. You will have some that are stalled on other parts of the system. (I'm sure I could keep wording an instruction to match each of the implications.)

To that end, part of your program has to deal with taking off "whats next" and finding how to prepare that to pass to the execution portion of your program. You can make that only take in batches, but you are almost certainly responsible for how you chunk them moreso than whatever process is sending the instructions to you? Even if you are handed clear batches, it is incumbent on you to batch them as they go off to the rest of the system.

lmz•9mo ago
I guess the proposal is "instead of fetching and acting on one event at a time, consider fetching all available events and look for opportunities to optimize which ones you process (e.g. by prioritization or by skipping certain events if superseded by newer ones)".
taeric•9mo ago
I mean, I got that. But you could as easily say "instead of fetching and acting on one event at a time, fetch and triage/route instructions into applicable queues."

In particular, there is no guarantee that moving to batches changes any of the problems you may have from acting on a single one at a time. To that end, you will have to look into all of the other strategies sooner or later.

Following from that, the problem is not "processMessage" or whatever. The problem is that you haven't broken "processMessage" up into the constituent "receive/triage/process/resolve" loop that you almost certainly will have to end up with.

malkia•9mo ago
in CPU's - pipelining!
jchw•9mo ago
I believe something similar is going on internally in Windows with event queues. It coalesces and prioritizes input events when multiple of them pile up before you're able to pop new events off of the queue. (For some events, e.g. pointer events, you can even go and query frames that were coalesced during input handling.) On the application/API end, it just looks like a "scalar select" loop, but actually it is doing batching behavior for input events!

(On the flip side, if you have a Wayland client that falls behind on processing its event queue, it can crash. On the whole this isn't really that bad but if you have something sending a shit load of events it can cause very bad behavior. This has made me wonder if it's possible, with UNIX domain sockets, to implement some kind of event coalescing on the server-side, to avoid flooding the client with high-precision pointer movement events while it's falling behind. Maybe start coalescing when FIONREAD gets to some high watermark? No idea...)

The "Crown of Nobles" Noble Gas Tube Display

https://theshamblog.com/the-crown-of-nobles-noble-gas-tube-display/
35•Ivoah•1h ago•1 comments

Warcraft III Peon Voice Notifications for Claude Code

https://github.com/tonyyont/peon-ping
567•doppp•8h ago•192 comments

Discord/Twitch/Snapchat age verification bypass

https://age-verifier.kibty.town/
817•JustSkyfall•14h ago•369 comments

AI agent opens a PR write a blogpost to shames the maintainer who closes it

https://github.com/matplotlib/matplotlib/pull/31132
318•wrxd•1h ago•256 comments

The missing digit of Stela C

https://johncarlosbaez.wordpress.com/2026/02/12/stela-c/
55•chmaynard•4h ago•12 comments

“Nothing” is the secret to structuring your work

https://www.vangemert.dev/blog/nothing
332•spmvg•4d ago•120 comments

Using an engineering notebook

https://ntietz.com/blog/using-an-engineering-notebook/
226•evakhoury•2d ago•88 comments

GLM-5: Targeting complex systems engineering and long-horizon agentic tasks

https://z.ai/blog/glm-5
414•CuriouslyC•23h ago•487 comments

Fluorite – A console-grade game engine fully integrated with Flutter

https://fluorite.game/
495•bsimpson•21h ago•278 comments

How to make a living as an artist

https://essays.fnnch.com/make-a-living
137•gwintrob•9h ago•71 comments

Ireland rolls out basic income scheme for artists

https://www.reuters.com/world/ireland-rolls-out-pioneering-basic-income-scheme-artists-2026-02-10/
370•abe94•20h ago•443 comments

Show HN: A free online British accent generator for instant voice conversion

https://audioconvert.ai/british-accent-generator
18•Katherine603•4h ago•36 comments

Text classification with Python 3.14's ZSTD module

https://maxhalford.github.io/blog/text-classification-zstd/
223•alexmolas•3d ago•47 comments

HeyWhatsThat

https://www.heywhatsthat.com/faq.html
70•1970-01-01•2d ago•14 comments

RISC-V Vector Primer

https://github.com/simplex-micro/riscv-vector-primer/blob/main/index.md
45•oxxoxoxooo•5d ago•15 comments

Hologram v0.7.0: Milestone release for Elixir-to-JavaScript porting initiative

https://hologram.page/blog/porting-initiative-delivers-hologram-v0-7-0
66•bartblast•13h ago•12 comments

Byte magazine artist Robert Tinney, who illustrated the birth of PCs, dies at 78

https://arstechnica.com/gadgets/2026/02/byte-magazine-artist-robert-tinney-who-illustrated-the-bi...
19•rbanffy•2h ago•1 comments

NetNewsWire Turns 23

https://netnewswire.blog/2026/02/11/netnewswire-turns.html
303•robin_reala•19h ago•81 comments

Kanchipuram Saris and Thinking Machines

https://altermag.com/articles/kanchipuram-saris-and-thinking-machines
176•trojanalert•5d ago•36 comments

WiFi could become an invisible mass surveillance system

https://scitechdaily.com/researchers-warn-wifi-could-become-an-invisible-mass-surveillance-system/
400•mgh2•5d ago•172 comments

Reports of Telnet's death have been greatly exaggerated

https://www.terracenetworks.com/blog/2026-02-11-telnet-routing
127•ericpauley•17h ago•50 comments

Clay Christensen's Milkshake Marketing (2011)

https://www.library.hbs.edu/working-knowledge/clay-christensens-milkshake-marketing
23•vismit2000•4d ago•9 comments

The other Markov's inequality

https://www.ethanepperly.com/index.php/2026/01/16/the-other-markovs-inequality/
44•tzury•4d ago•2 comments

Lance table format explained with simple animations

https://tontinton.com/posts/lance/
11•wild_pointer•3d ago•2 comments

Carl Sagan's Baloney Detection Kit: Tools for Thinking Critically (2025)

https://www.openculture.com/2025/09/the-carl-sagan-baloney-detection-kit.html
18•nobody9999•6h ago•12 comments

GLM-OCR – A multimodal OCR model for complex document understanding

https://github.com/zai-org/GLM-OCR
283•ms7892•4d ago•73 comments

Claude Code is being dumbed down?

https://symmetrybreak.ing/blog/claude-code-is-being-dumbed-down/
987•WXLCKNO•19h ago•633 comments

Show HN: Geo Racers – Race from London to Tokyo on a single bus pass

https://geo-racers.com/
13•pattle•3h ago•11 comments

Apple's latest attempt to launch the new Siri runs into snags

https://www.bloomberg.com/news/articles/2026-02-11/apple-s-ios-26-4-siri-update-runs-into-snags-i...
107•petethomas•17h ago•192 comments

Reading and writing can lower dementia risk by almost 40%, study finds

https://www.theguardian.com/society/2026/feb/11/reading-writing-lower-dementia-risk-study-finds
3•c-oreills•26m ago•2 comments