frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

How async/await works in Python (2021)

https://tenthousandmeters.com/blog/python-behind-the-scenes-12-how-asyncawait-works-in-python/
61•sebg•1y ago

Comments

quentinp•1y ago
While it stays at the Python level, https://github.com/AndreLouisCaron/a-tale-of-event-loops really helped me to understand how asyncio and Trio are implemented. I had no idea how sleeps worked before reading that post.
incomingpain•1y ago
Page didnt load for me.

https://realpython.com/async-io-python/

Multiprocessing all the way!

emmelaich•1y ago
(2021)

Good article!

punnerud•1y ago
A more simplified version:

Synchronous code is like a single-lane road where cars (tasks) must travel one after another in perfect sequence. If one car stops for gas (waiting for I/O), every car behind it must stop too. While orderly and predictable, this creates massive traffic jams as tasks wait unnecessarily for others to complete before they can proceed.

Pure asynchronous code (with callbacks) is like dispatching multiple cars onto independent routes with no coordination. Cars move freely without waiting for each other, but they arrive at unpredictable times and following their progress becomes chaotic. It's efficient but creates a complex tangle of paths that becomes hard to maintain.

Async/await combines the best of both approaches with a multi-lane highway system. Cars follow clear, synchronous-looking routes (making code readable), but only wait at strategic "await" exit ramps when truly necessary. When a car needs data, it signals with "await", pulls off the highway temporarily, and other cars continue flowing past. Once its operation completes, it merges back into traffic and continues. This gives you the logical simplicity of synchronous code with the performance benefits of asynchronous execution - cars only wait at crossroads when they must, maximizing throughput while maintaining order.

The genius of async/await is that it lets developers write code that looks sequential while the runtime handles all the complex traffic management under the hood.

explodes•1y ago
Excellent write up. I appreciate the level of details here showing the history from the days of old, before async/await were even keywords.
bilsbie•1y ago
How does the GIL come into play here?
punnerud•1y ago
GIL is like a "red-cap" on the head for the CPU-core running the task, so you would not be able to run true Async without GIL. Have to hand the "red-cap" back, for the next task.

Instead of using a global lock ("red-cap"), Python objects have introduced a specialized reference counting system that distinguishes between "local" references (owned by a single thread) and "shared" references (accessed by multiple threads).

In that way enabling to remove GIL in the long run, now starting with making it optional.

Click

https://clickclickclick.click/
68•andrewzeno•53m ago•10 comments

Anthropic acquires Stainless

https://www.anthropic.com/news/anthropic-acquires-stainless
332•tomeraberbach•6h ago•232 comments

Hyperpolyglot Lisp: Common Lisp, Racket, Clojure, Emacs Lisp

https://hyperpolyglot.org/lisp
116•veqq•4h ago•24 comments

We stopped AI bot spam in our GitHub repo using Git's –author flag

https://archestra.ai/blog/only-responsible-ai
386•ildari•8h ago•183 comments

We let AIs run radio stations

https://andonlabs.com/blog/andon-fm
126•lukaspetersson•5h ago•129 comments

The Quiet Renovation at Bitwarden

https://blog.ppb1701.com/the-quiet-renovation-at-bitwarden
484•DaSHacka•2d ago•228 comments

Show HN: Files.md – Open-source alternative to Obsidian

https://github.com/zakirullin/files.md
518•zakirullin•10h ago•269 comments

The Futility of Lava Lamps: What Random Means

https://loup-vaillant.fr/articles/lava-lamps-and-randomness
34•birdculture•2d ago•17 comments

Elon Musk has lost his lawsuit against Sam Altman and OpenAI

https://techcrunch.com/2026/05/18/elon-musk-has-lost-his-lawsuit-against-sam-altman-and-openai/
720•nycdatasci•6h ago•366 comments

Anthropic co-founder to present AI encyclical alongside Pope Leo XIV

https://www.vaticannews.va/en/pope/news/2026-05/pope-leo-xiv-first-encyclical-magnifica-humanitas...
4•cucho•38m ago•0 comments

Agora-1: The Multi-Agent World Model

https://odyssey.ml/introducing-agora-1
69•olivercameron•5h ago•15 comments

Designing an FPGA Calculator from Scratch

https://baltazarstudios.com/calculator/
37•zdw•23h ago•2 comments

The FBI Wants to Buy Nationwide Access to License Plate Readers

https://www.404media.co/the-fbi-wants-to-buy-nationwide-access-to-license-plate-readers/
176•cdrnsf•4h ago•69 comments

Two computers, one monitor, zero fiddling (2025)

https://alexplescan.com/posts/2025/08/16/kvm/
153•ankitg12•2d ago•85 comments

The Fil-C Optimized Calling Convention

https://fil-c.org/calling_convention
97•pizlonator•2d ago•17 comments

Understanding Singleflight in Go

https://www.codingexplorations.com/blog/understanding-singleflight-in-golang-a-solution-for-elimi...
43•ghostbit•2d ago•6 comments

Earth's Radio Bubble: Every signal we've ever sent into space

https://www.thescientificdrop.com/2026/05/earths-radio-bubble-every-signal-weve.html
9•jonbaer•15h ago•3 comments

Cutting inference cold starts by 40x with LP, FUSE, C/R, and CUDA-checkpoint

https://modal.com/blog/truly-serverless-gpus
65•charles_irl•6h ago•15 comments

Show HN: InsForge – Open-source Heroku for coding agents

https://github.com/InsForge/InsForge
27•mrcoldbrew•8h ago•6 comments

Iran starts Bitcoin-backed ship insurance for Hormuz strait

https://www.bloomberg.com/news/articles/2026-05-18/iran-starts-bitcoin-backed-shipping-insurance-...
235•srameshc•6h ago•355 comments

Shutterstock to pay $35M over hard-to-cancel subscriptions

https://www.ftc.gov/news-events/news/press-releases/2026/05/shutterstock-pay-35-million-settle-ft...
103•Lihh27•4h ago•43 comments

Loopmaster – Livecoding Music IDE

https://loopmaster.xyz/
45•stagas•5h ago•14 comments

Heirs and Spares in Early Modern France

https://www.historytoday.com/archive/feature/heirs-and-spares-early-modern-france
4•pepys•3d ago•0 comments

Show HN: Number Gacha, a gacha game distilled to its essence

https://isabisabel.com/gacha/
4•babel16•5d ago•0 comments

Project Glasswing: what Mythos showed us

https://blog.cloudflare.com/cyber-frontier-models/
266•Fysi•10h ago•100 comments

What Is Date:Italy?

http://aesthetikx.info/blog/date_italy.html
121•jollyjerry•2d ago•51 comments

Alignment pretraining: AI discourse creates self-fulfilling (mis)alignment

https://arxiv.org/abs/2601.10160
14•anigbrowl•2h ago•10 comments

Haiku OS runs on M1 Macs now

https://discuss.haiku-os.org/t/my-haiku-arm64-progress/19044?page=2
256•tekkertje•5h ago•84 comments

Stratum: System-Hardware Co-Design with 3D-Stackable DRAM for Efficient Moe

https://dl.acm.org/doi/10.1145/3725843.3756043
16•rbanffy•3d ago•4 comments

I 3D Printed Origami [video]

https://www.youtube.com/watch?v=FNVBK7-h9Fs
58•Teever•2d ago•9 comments