frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

The API Is a Dead End; Machines Need a Labor Economy

1•bot_uid_life•1m ago•0 comments

Digital Iris [video]

https://www.youtube.com/watch?v=Kg_2MAgS_pE
1•Jyaif•2m ago•0 comments

New wave of GLP-1 drugs is coming–and they're stronger than Wegovy and Zepbound

https://www.scientificamerican.com/article/new-glp-1-weight-loss-drugs-are-coming-and-theyre-stro...
3•randycupertino•3m ago•0 comments

Convert tempo (BPM) to millisecond durations for musical note subdivisions

https://brylie.music/apps/bpm-calculator/
1•brylie•6m ago•0 comments

Show HN: Tasty A.F.

https://tastyaf.recipes/about
1•adammfrank•6m ago•0 comments

The Contagious Taste of Cancer

https://www.historytoday.com/archive/history-matters/contagious-taste-cancer
1•Thevet•8m ago•0 comments

U.S. Jobs Disappear at Fastest January Pace Since Great Recession

https://www.forbes.com/sites/mikestunson/2026/02/05/us-jobs-disappear-at-fastest-january-pace-sin...
1•alephnerd•8m ago•0 comments

Bithumb mistakenly hands out $195M in Bitcoin to users in 'Random Box' giveaway

https://koreajoongangdaily.joins.com/news/2026-02-07/business/finance/Crypto-exchange-Bithumb-mis...
1•giuliomagnifico•8m ago•0 comments

Beyond Agentic Coding

https://haskellforall.com/2026/02/beyond-agentic-coding
3•todsacerdoti•9m ago•0 comments

OpenClaw ClawHub Broken Windows Theory – If basic sorting isn't working what is?

https://www.loom.com/embed/e26a750c0c754312b032e2290630853d
1•kaicianflone•11m ago•0 comments

OpenBSD Copyright Policy

https://www.openbsd.org/policy.html
1•Panino•12m ago•0 comments

OpenClaw Creator: Why 80% of Apps Will Disappear

https://www.youtube.com/watch?v=4uzGDAoNOZc
2•schwentkerr•16m ago•0 comments

What Happens When Technical Debt Vanishes?

https://ieeexplore.ieee.org/document/11316905
2•blenderob•17m ago•0 comments

AI Is Finally Eating Software's Total Market: Here's What's Next

https://vinvashishta.substack.com/p/ai-is-finally-eating-softwares-total
3•gmays•18m ago•0 comments

Computer Science from the Bottom Up

https://www.bottomupcs.com/
2•gurjeet•18m ago•0 comments

Show HN: A toy compiler I built in high school (runs in browser)

https://vire-lang.web.app
1•xeouz•20m ago•0 comments

You don't need Mac mini to run OpenClaw

https://runclaw.sh
1•rutagandasalim•21m ago•0 comments

Learning to Reason in 13 Parameters

https://arxiv.org/abs/2602.04118
2•nicholascarolan•23m ago•0 comments

Convergent Discovery of Critical Phenomena Mathematics Across Disciplines

https://arxiv.org/abs/2601.22389
1•energyscholar•23m ago•1 comments

Ask HN: Will GPU and RAM prices ever go down?

1•alentred•23m ago•0 comments

From hunger to luxury: The story behind the most expensive rice (2025)

https://www.cnn.com/travel/japan-expensive-rice-kinmemai-premium-intl-hnk-dst
2•mooreds•24m ago•0 comments

Substack makes money from hosting Nazi newsletters

https://www.theguardian.com/media/2026/feb/07/revealed-how-substack-makes-money-from-hosting-nazi...
5•mindracer•25m ago•0 comments

A New Crypto Winter Is Here and Even the Biggest Bulls Aren't Certain Why

https://www.wsj.com/finance/currencies/a-new-crypto-winter-is-here-and-even-the-biggest-bulls-are...
1•thm•25m ago•0 comments

Moltbook was peak AI theater

https://www.technologyreview.com/2026/02/06/1132448/moltbook-was-peak-ai-theater/
2•Brajeshwar•26m ago•0 comments

Why Claude Cowork is a math problem Indian IT can't solve

https://restofworld.org/2026/indian-it-ai-stock-crash-claude-cowork/
3•Brajeshwar•26m ago•0 comments

Show HN: Built an space travel calculator with vanilla JavaScript v2

https://www.cosmicodometer.space/
2•captainnemo729•26m ago•0 comments

Why a 175-Year-Old Glassmaker Is Suddenly an AI Superstar

https://www.wsj.com/tech/corning-fiber-optics-ai-e045ba3b
1•Brajeshwar•26m ago•0 comments

Micro-Front Ends in 2026: Architecture Win or Enterprise Tax?

https://iocombats.com/blogs/micro-frontends-in-2026
2•ghazikhan205•29m ago•1 comments

These White-Collar Workers Actually Made the Switch to a Trade

https://www.wsj.com/lifestyle/careers/white-collar-mid-career-trades-caca4b5f
1•impish9208•29m ago•1 comments

The Wonder Drug That's Plaguing Sports

https://www.nytimes.com/2026/02/02/us/ostarine-olympics-doping.html
1•mooreds•29m ago•0 comments
Open in hackernews

Show HN: Onesinglecounter, a Globally Available Counter

https://onesinglecounter.com
3•v3lmx•7mo ago
Hey HN,

onesinglecounter is a single globally available counter with 2 buttons: one increments by 1, the other resets to 0. The website keeps track of the largest values attained in the last minute, hour, day, week, month, year, and all time.

This is a toy/experiment website to see how anonymous people will interact: one person is enough to keep the counter close to 0, so it's interesing to me to see how high the counter can get.

The backend is written in Go, and the frontend in Svelte (no kit), using shadcn for components. They communicate using a websocket that sends updates on the current value of the counter and the recorded best values per timeframe.

I started with a naive approach of storing all the connected clients in a global state, and going through all of them on each update (eg. someone clicks one one button). However, this approach quickly fell apart when the number of clients grows: number of clients * number of events per second was too much for the server to handle (this could be also because of other mistakes on my part, the early implementations were not optimal).

I then moved on to using a tick system, where the state is updated in real time from the clients to the server, but the server only update the client every tick. This drastically improved performance, and is not even noticeable on a low tick rate.

I also moved from using a mutex protected counter to an atomic value. The golang `sync/atomic` package provides an implementation for atomic operations on numbers, which allows for lock-free updates to the counter. This simplified the code, and there is no tradeoff that I could see in this particular case.

I researched other approaches around UDP and multicast, but UDP is not available natively in browsers, which is a shame as I could have streamed the updates with way less overhead.

I also learned about `sync.Cond`, which allows for synchronization between goroutines, which allowed a simple way to notify multiple goroutines when an event occurs, such as a tick update. I ended up using an implementation with channels that I found here while researching the subject (https://blogtitle.github.io/go-advanced-concurrency-patterns...), as this was more performant in my use case that using `sync.Cond` directly (from the limited testing I did, all else being equal, the `sync` package utilized 99% CPU, vs 75% for the channel implementation. There might be something else going on here, I did not really dig into this).

Another issue that seemed simple at first but wasn't straightforward was the best values per timeframe. I ended up using a golang cron library that schedules a job to run every timeframe to potentially reset the best values to the current value of the counter. This was the simplest way I found to get the values to reset not every timeframe, but at the beginning of each timeframe.

I am very interested in hearing opinions and suggestions on how you would have tackled some of the problems I encountered!

You can check out the website at https://onesinglecounter.com, and the source code is available at github.com/v3lmx/onesinglecounter.

Comments

Hackbraten•7mo ago
I just see a blank page?
v3lmx•7mo ago
Very sorry, I messed up my deployment... It should be up now