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.

The last six months in LLMs in five minutes

https://simonwillison.net/2026/May/19/5-minute-llms/
208•yakkomajuri•4h ago•102 comments

Click (2016)

https://clickclickclick.click/
260•andrewzeno•7h ago•64 comments

Codex-maxxing

https://jxnl.co/writing/2026/05/10/codex-maxxing/
29•dnw•1h ago•17 comments

Anyone on the Internet Can Ring Your Doorbell

https://www.abgeo.dev/blog/anyone-can-ring-your-doorbell
67•jrdres•2d ago•26 comments

Turn your Android phone into a ham radio transceiver

https://www.kv4p.com/
33•krupan•2d ago•2 comments

PyTorch Landscape

https://pytorch.landscape2.io
16•salamo•1h ago•0 comments

Regex Chess: A 2-ply minimax chess engine in 84,688 regular expressions

https://nicholas.carlini.com/writing/2025/regex-chess.html
81•surprisetalk•4d ago•13 comments

Anthropic acquires Stainless

https://www.anthropic.com/news/anthropic-acquires-stainless
413•tomeraberbach•13h ago•287 comments

Pope Leo XIV’s first encyclical Magnifica humanitas to be published May 25

https://www.vaticannews.va/en/pope/news/2026-05/pope-leo-xiv-first-encyclical-magnifica-humanitas...
180•cucho•6h ago•104 comments

Cursor Introduces Composer 2.5

https://cursor.com/blog/composer-2-5
95•asar•12h ago•52 comments

1024000^2 Blocks, 2B2T Minecraft Server World Download Project, and Discoveries

https://github.com/2b2tplace/1m_release
130•exploraz•15h ago•77 comments

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

https://archestra.ai/blog/only-responsible-ai
453•ildari•14h ago•207 comments

The quiet renovation at Bitwarden

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

Peter Salus has died

https://www.tuhs.org/pipermail/tuhs/2026-May/033750.html
102•speckx•3h ago•8 comments

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

https://hyperpolyglot.org/lisp
149•veqq•10h ago•35 comments

When can the C++ compiler devirtualize a call?

https://quuxplusone.github.io/blog/2021/02/15/devirtualization/
45•lionkor•1d ago•10 comments

We let AIs run radio stations

https://andonlabs.com/blog/andon-fm
222•lukaspetersson•11h ago•190 comments

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

https://isabisabel.com/gacha/
114•babel16•5d ago•46 comments

Peter Neumann has died

https://www.tuhs.org/pipermail/tuhs/2026-May/033748.html
12•pabs3•2h ago•1 comments

Show HN: Hsrs – Type-Safe Haskell Bindings Generator for Rust

https://github.com/harmont-dev/hsrs
8•suis_siva•2h ago•0 comments

Project Glasswing: what Mythos showed us

https://blog.cloudflare.com/cyber-frontier-models/
314•Fysi•16h ago•122 comments

AI eats the world (Spring 26) [pdf]

https://static1.squarespace.com/static/50363cf324ac8e905e7df861/t/6a0af5d0484fbf5fe9a7743e/177910...
194•topherjaynes•17h ago•109 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/
894•nycdatasci•12h ago•446 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
59•jonbaer•21h ago•32 comments

Two computers, one monitor, zero fiddling (2025)

https://alexplescan.com/posts/2025/08/16/kvm/
193•ankitg12•3d ago•113 comments

LLMCap – A proxy that hard-stops LLM API calls when you hit a dollar cap

https://www.llmcap.io/
5•cfaruk•2h ago•2 comments

Why is it called Kent House?

https://diamondgeezer.blogspot.com/2026/05/kent-house.html
10•susam•2d ago•1 comments

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

https://arxiv.org/abs/2601.10160
45•anigbrowl•8h ago•17 comments

Agora-1: The Multi-Agent World Model

https://odyssey.ml/introducing-agora-1
99•olivercameron•11h ago•18 comments

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

https://github.com/zakirullin/files.md
607•zakirullin•16h ago•297 comments