frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Infinite Pixels

https://meyerweb.com/eric/thoughts/2025/08/07/infinite-pixels/
62•OuterVale•50m ago•1 comments

Baltimore Assessments Accidentally Subsidize Blight–and How We Can Fix It

https://progressandpoverty.substack.com/p/how-baltimore-assessments-accidentally
24•surprisetalk•1h ago•1 comments

Arm Desktop: x86 Emulation

https://marcin.juszkiewicz.com.pl/2025/07/22/arm-desktop-emulation/
14•PaulHoule•1h ago•0 comments

New AI Coding Teammate: Gemini CLI GitHub Actions

https://blog.google/technology/developers/introducing-gemini-cli-github-actions/
100•michael-sumner•4h ago•48 comments

Outdated Software, Nationwide Chaos: United Grounds Flights After Meltdown

https://allchronology.com/2025/08/07/outdated-software-nationwide-chaos-united-airlines-grounds-flights-after-system-meltdown/
5•rectang•7m ago•1 comments

How AI Conquered the US Economy: A Visual FAQ

https://www.derekthompson.org/p/how-ai-conquered-the-us-economy-a
51•rbanffy•3h ago•35 comments

We replaced passwords with something worse

https://blog.danielh.cc/blog/passwords
533•max__dev•11h ago•420 comments

Show HN: Stasher – Burn-after-read secrets from the CLI, no server, no trust

https://github.com/stasher-dev/stasher-cli
31•stasher-dev•2h ago•22 comments

Leonardo Chiariglione: “I closed MPEG on 2 June 2020”

https://leonardo.chiariglione.org/
154•eggspurt•3h ago•112 comments

GoGoGrandparent (YC S16) Is Hiring Back End and Full-Stack Engineers

1•davidchl•2h ago

An LLM does not need to understand MCP

https://hackteam.io/blog/your-llm-does-not-care-about-mcp/
35•gethackteam•1h ago•29 comments

Claude Code IDE integration for Emacs

https://github.com/manzaltu/claude-code-ide.el
699•kgwgk•1d ago•235 comments

Cracking the Vault: How we found zero-day flaws in HashiCorp Vault

https://cyata.ai/blog/cracking-the-vault-how-we-found-zero-day-flaws-in-authentication-identity-and-authorization-in-hashicorp-vault/
154•nihsy•7h ago•58 comments

The Whispering Earring (Scott Alexander)

https://croissanthology.com/earring
38•ZeljkoS•3h ago•5 comments

PastVu: Historical Photographs on Current Maps

https://pastvu.com/?_nojs=1
17•lapetitejort•2d ago•1 comments

Show HN: Aura – Like robots.txt, but for AI actions

https://github.com/osmandkitay/aura
16•OsmanDKitay•1d ago•14 comments

AI Ethics is being narrowed on purpose, like privacy was

https://nimishg.substack.com/p/ai-ethics-is-being-narrowed-on-purpose
93•i_dont_know_•2h ago•58 comments

Running GPT-OSS-120B at 500 tokens per second on Nvidia GPUs

https://www.baseten.co/blog/sota-performance-for-gpt-oss-120b-on-nvidia-gpus/
204•philipkiely•11h ago•129 comments

Synthetic Biology for Space Exploration

https://www.nature.com/articles/s41526-025-00488-7
6•PaulHoule•2d ago•0 comments

Splatshop: Efficiently Editing Large Gaussian Splat Models

https://momentsingraphics.de/HPG2025.html
17•ibobev•3d ago•0 comments

Project Hyperion: Interstellar ship design competition

https://www.projecthyperion.org
316•codeulike•17h ago•242 comments

Debounce

https://developer.mozilla.org/en-US/docs/Glossary/Debounce
93•aanthonymax•2d ago•47 comments

Children's movie leads art historian to long-lost Hungarian masterpiece (2014)

https://www.theguardian.com/world/2014/nov/27/stuart-little-art-historian-long-lost-hungarian-masterpiece
30•how-about-this•3d ago•4 comments

Fastmail breaks UI in production

https://twitter.com/licyeus/status/1953438985381974493
22•blux•53m ago•15 comments

Did Craigslist decimate newspapers? Legend meets reality

https://www.poynter.org/business-work/2025/did-craigslist-kill-newspapers-poynter-50/
36•zdw•3d ago•33 comments

Show HN: Kitten TTS – 25MB CPU-Only, Open-Source TTS Model

https://github.com/KittenML/KittenTTS
882•divamgupta•1d ago•340 comments

Rules by which a great empire may be reduced to a small one (1773)

https://founders.archives.gov/documents/Franklin/01-20-02-0213
210•freediver•14h ago•133 comments

Maybe we should do an updated Super Cars

https://spillhistorie.no/2025/07/31/maybe-we-should-do-an-updated-version/
6•Kolorabi•1h ago•1 comments

A candidate giant planet imaged in the habitable zone of α Cen A

https://arxiv.org/abs/2508.03814
102•pinewurst•12h ago•34 comments

Litestar is worth a look

https://www.b-list.org/weblog/2025/aug/06/litestar/
310•todsacerdoti•18h ago•79 comments
Open in hackernews

Debounce

https://developer.mozilla.org/en-US/docs/Glossary/Debounce
93•aanthonymax•2d ago

Comments

kazinator•6h ago
Debouncing refers to cleaning up the signal from an opening and closing switch contact so that the cleaned signal matches the intended semantics of the switch action (e.g. one simple press of a button, not fifty pulses).

The analogy here is poor; reducing thrashing in those obnoxious search completion interfaces isn't like debouncing.

Sure, if we ignore everything about it that is not like debouncing, and we still have something left after that, then whatever is left is like debouncing.

One important difference is that if you have unlimited amounts of low latency and processing power, you can do a full search for each keystroke, filter it down to half a dozen results and display the completions. In other words, the more power you have, the less important it is to do any "debouncing".

Switch debouncing is not like this. The faster is your processor at sampling the switch, the more bounces it sees and consequently the more crap it has to clean up. Debouncing certainly does not go away with a faster microcontroller.

maxbond•5h ago
It's the term used in frontend dev. It is actually a little worse than you're imagining, because we're not sampling, we're receiving callbacks (so more analogous to interrupts than sampling in a loop). Eg the oninput callback. I've used it for implementing auto save without making a localStorage call on every key press, for example.

I think it makes sense if you view it from a control theory perspective rather than an embedded perspective. The mechanics of the UI (be that a physical button or text input) create a flaggy signal. Naively updating the UI on that signal would create jank. So we apply some hysteresis to obtain a clean signal. In the day way that acting 50 times on a single button press is incorrect behavior, saving (or searching or what have you) 50 times from typing a single sentence isn't correct (or at least undesired).

The example of 10ms is way too low though, anything less than 250ms seems needlessly aggressive to me. 250ms is still going to feel very snappy. I think if you're typing at 40-50wpm you'll probably have an interval of 100-150ms between characters, so 10ms is hardly debouncing anything.

Findecanor•4h ago
An office keyboard's own debouncing could delay a key press 30 ms, and then the OS, software and graphics/monitor hardware would delay it just as much before the user could see the character on screen. So, indeed, 10 ms is much too low.
maxbond•4h ago
Perhaps the people at MDN are 10x typists, with competition-grade gaming keyboards.
zeta0134•3h ago
Additionally, regardless of naming, debouncing is an accessibility feature for a surprisingly large portion of the population. Many users who grew up with double-click continue to attempt to provide this input on web forms, because it mostly works. Many more with motor control issues may struggle to issue just a single click reliably, especially on a touchscreen.
gibsonsmog•2h ago
Holy moly, for years I've had in the back of my head this thought about why, earlier in my career, I'd see random doubly submitted form submissions on certain projects. Same form code and processing as other sites, legitimate submissions too. Eventually we added more spam filtering and restrictions unrelated to these legitimate ones, but it was probably the double-click users causing those errant submissions. I'd never even have thought of those users. Fascinating
account42•2h ago
> 250ms is still going to feel very snappy

WTF no it won't.

jiehong•5h ago
In electronics, I think we'd use a latch, so it switches high, and stays high despite input change.

Doesn't really apply to a search box, where it's more of a delayed event if no event during a specific time window, only keeping last event.

Tade0•5h ago
> One important difference is that if you have unlimited amounts of low latency and processing power, you can do a full search for each keystroke,

But you don't want that, as it's useless. Until the user actually finished typing, they're going to have more results than they can meaningfully use - especially that the majority will be irrelevant and just get in the way of real results.

The signal in between is actually, really not useful - at least not on first try when the user is not aware what's in the data source and how can they hack the search query to get their results with minimal input.

maxbond•4h ago
No one wants to see results for the letter "a", no one wants their database processing that search, and updating the UI while you're typing can be really distracting.
meindnoch•3h ago
>No one wants to see results for the letter "a"

Don't make assumptions about what the user may or may not want to search for.

E.g. in my music collection I have albums from both !!! [1] and Ø [2]. I've encountered software that "helpfully" prevented me from searching for these artists, because the developers thought that surely noone would search for such terms.

_______

[1] https://www.discogs.com/artist/207714-!!! ← See? The HN link highlighter also thinks that URLs cannot end with !!!.

[2] https://www.discogs.com/artist/31887-Ø

extra88•3h ago
As a user, I often do want a list to start from a single letter. In a browser address bar, it could start showing items Amazon, Apple, etc.
Tade0•2h ago
That is fine. Do you want it to flicker between keystrokes when you're still typing?
extra88•2h ago
"Flicker" can mean a lot of things, I generally don't have a problem with the list changing while I type.
account42•2h ago
Yes. Unless you are pecking at your keyboard your eyes are free to look at the results on the screen and stop typing once you get the result you want. The only thing that's needed is for the results to be stable, i.e. if the top result for "abc" also matches "abcd" then it should also be the top result for "abcd". Unfortunately many search/autocomplete implementations fail at this but that's still a problem even with "debouncing".
prmph•1h ago
Are you really able to scan all the results in a few milliseconds?

Even the 10ms in TFA is too low. I personally wouldn't mind (or probably even notice) a delay of 100 ms.

account42•16m ago
It doesn't matter how fast you can read the results, you benefit from instant results as long as you can read them faster than you can complete typing.

Whatever delay you add before showing results doesn't get hidden by the display and user's reading latency, it adds to it.

Findecanor•5h ago
I agree that this is a bad analogy.

I've programmed my own keyboards, mice and game controllers. If you want the fastest response time then you'd make debouncing be asymmetric: report press ("Make") on the first leading edge, and don't report release ("Break") until the signal has been stable for n ms after a trailing edge. That is the opposite of what's done in the blog article.

Having a delay on the leading edge is for electrically noisy environments, such as among electric motors and a long wire from the switch to the MCU, where you could potentially get spurious signals that are not from a key press. Debouncing could also be done in hardware without delay, if you have a three-pole switch and an electronic latch.

A better analogy would perhaps be "Event Compression": coalescing multiple consecutive events into one, used when producer and consumer are asynchronous. Better but not perfect.

haileys•5h ago
Debouncing is a term of art in UI development and has been for a long time. It is analogous to, but of course not exactly the same as, debouncing in electronics.
amelius•4h ago
It's basically debouncing plus edge detection.
jon-wood•4h ago
Search is a bad example there, a better one would have been clicking a button to add an item to a list, or pressing a shortcut key to do so, where you want to only submit that item once even if someone frantically clicks on the button because they're feeling impatient.
account42•2h ago
No you should not filter user input like this. Keep user interfaces simple and predictable.

If it really only makes sense to perform the action once than disable/remove the button on the first click. If it makes sense to click the button multiple times then there should be no limit to how fast you can do that. It's really infuriating when crappy software drops user input because its too slow to process one input before the next. There is reason why input these days comes in events that are queued and we aren't still checking if the key is up or down in a loop.

matthewmacleod•3h ago
Actually I think it's pretty similar to your example. The "intended semantics" of the search action in that sort of field are to search for the text you enter – not to search for the the side-effects of in-progress partial completion.

Yes, it's not an exact comparison (hence analogy) – but it's not anything worth getting into a fight about.

account42•2h ago
The user intent is usually to get to what they are looking for as quickly as possible. If you intentionally introduce delays by forcing them to enter the complete query or pause to receive intermediate results then you are slowing that down.
meindnoch•3h ago
In typical web development fashion, they've heard about something ("debouncing"), had a vague (but incorrect) idea what it means, and started using it everywhere. There was no adult around to correct them early on, so now the community stuck with the wrong thing forever. If you spend some time in web development as an outsider, you'll notice tons of things like this.
soulofmischief•1h ago
What a bitter lens with which to view the world.

The reality is that language evolves all the time through specialized use and adoption, web development is no different. Every profession and craft builds a pattern language from both borrowed and new terms.

You can explain the phenomenon without patronizing and insulting anyone who works on frontend code.

bravesoul2•2h ago
I like you said obnoxious... it is assumed this behaviour is what people want rather than just press a button or hit enter when ready.
account42•2h ago
It's also worth mentioning that real debouncing doesn't always have to depend on time when you have an analog signal. Instead you could have different thresholds for going from stat A to B vs going from B to A with enough distance between those threshold that you won't switch back and forth during an event. This can even be implemented physically in the switch itself by having separate ON and OFF contacts.
davnicwil•1h ago
Thank you for this comment! Suddenly 'bouncing' makes total sense as a mental image when before it only vaguely tracked in some abstract way about tons of tiny events bouncing around and triggering things excitedly until you contain them with debounce() :-)

Come to think of it throttle is the much easier to understand analogy.

achou•5h ago
One thing to watch out for when using debounce/throttle is the poor interaction with async functions. Debounced/throttled async functions can easily lead to unexpected behavior because they typically return the last result they have when the function is called, which would be a previous Promise for an async function. You can get a result that appears to violate causality, because the result of the promise returned by the debounce/throttle will (in a typical implementation) be from a prior invocation that happened before your debounce/throttle call.

There are async-safe variants but the typical lodash-style implementations are not. If you want the semantics of "return a promise when the function is actually invoked and resolve it when the underlying async function resolves", you'll have to carefully vet if the implementation actually does that.

pas•5h ago
this sounds interesting but it's a bit too early here for me. by any chance can we (not simply a royal we :D) ask you to provide a code example (of a correct implementation), or a link to one? many thanks!
cnity•5h ago
Reactive programming (such as with RxJS [0]) can be a good solution to this, since they provide primitives that understand time-based dependencies.

[0]: https://rxjs.dev/api/index/function/switchMap

ffsm8•1h ago
Debouncing correctly is still super hard, even with rxjs.

There are always countless edge cases that behave incorrectly - it might not be important and can be ignored, but while the general idea of debouncing sounds easy - and adding it to an rxjs observable is indeed straightforward...

Actually getting the desired behavior done via rxjs gets complicated super fast if you're required to be correct/spec compliant

demetris•4h ago
Another thing to watch for is whether you actually need debouncing.

For example, debouncing is often recommended for handlers of the resize event, but, in most cases, it is not needed for handlers of observations coming from ResizeObserver.

I think this is the case for other modern APIs as well. I know that, for example, you don’t need debouncing for the relatively new scrollend event (it does the debouncing on its own).

yurishimo•59m ago
Sad that the `scrollend` event isn't supported by Safari and doesn't look to be a part of their release this fall either.
tossandthrow•4h ago
Damn, there was another thread not too long ago claiming that a sync does not mean concurrent - this would have been a great example to bring up.
ignoramous•2h ago
Such stuff has first-class support in Kotlin: Structured concurrency simplifies multi-threaded programming pretty effectively.
joeframbach•15m ago
That doesn't sound correct. An async function ought to return a _new_ Promise on each invocation, and each of those returned Promises are independent. Are you conflating memoization? Memoized functions will have these problems with denouncing, but not your standard async function.
fnord77•5h ago
https://en.wikipedia.org/wiki/Switch#Contact_bounce
Oxodao•4h ago
Ooh thanks for the link, didn't know this was where this came from
thomascountz•5h ago
I recently wrote a bit about debouncing fetch using timeouts and AbortController, including small demos, here: https://thomascountz.com/2025/07/02/debouncing-api-calls
G_o_D•3h ago
Debounce -> Like when we throw a ball once on ground, but it keeps bouncing, To prevent that

Human interaction with circuits, sensors, receptors, occur like that

When we click a keyboard key or switch circuit switch the receptors are very sensitive

we feel we did once but during that one press our fingers hands are vibrating multiple times hence the event get registered multiple times due to pulsating, hence all after first event, the second useful event that can be considered legitimate if the idle period between both matches desired debounce delay

in terms of web and software programming or network request handling

it is used as a term to debounce to push away someone something aggresive

Example wise

a gate and a queue Throttling -> gate get opened every 5 min and let one person in, no matter what

Debounce -> if the persons in queue are deliberately being aggressive thrashing at door to make it open we push them away Now instead of 5 min, we tell them you have to wait another 5 min since you are harassing, if before that they try again, we again tell them to wait another 5 min Thus debounce is to prevent aggresive behaviour

In terms of say client server request over network

We can throttle requests processed by server, let say server will only process requests that happen every 5 min like how apis have limit, during that before 5min no matter how many request made they will be ignored

But if client is aggressive like they keep clicking submit button, keep making 100s of requests that even after throttling server would suffer kind of ddos

so at client side we add debounce to button click event

so even if user keep clicking it being impatient, unnecessary network request will not be made to server unless user stop

_def•2h ago
I think it's a fitting analogy. Depends on the intended behaviour, really.

That said, this is a good resource on the original meaning: https://www.ganssle.com/debouncing.htm

lma21•1h ago
I've always used the term Coalescing in the past: https://en.wikipedia.org/wiki/Coalescing_(computer_science)
joeframbach•5m ago
And I've used coalesce to describe Array.prototype.reduce and Object.assign as well.
ncann•1h ago
I needed an implementation of debounce in Java recently and was surprised to find out that there's no existing decent solution - there's none from the standard library, nor popular utilities libraries like Guava or Apache Commons. There are some implementations floating around like on Stackoverflow but I found them lacking, either there's no thread safety or there's no flexibility in supporting the execution of the task at the leading edge or trailing edge or both. Anyone has a good recommendation on a good implementation?
game_the0ry•58m ago
Not sure if anyone else has noticed, but this has been a super popular interview question for front end interviews.