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.

New accessibility features powered by Apple Intelligence

https://www.apple.com/newsroom/2026/05/apple-unveils-new-accessibility-features-and-updates-with-...
88•interpol_p•56m ago•21 comments

Gaussian Splat of a Strawberry

https://superspl.at/scene/84df8849
170•danybittel•2h ago•65 comments

Show HN: Id-agent – Token efficient UUID alternative for AI agents

https://github.com/vostride/id-agent
23•pranshuchittora•1h ago•38 comments

Photo GIMP – A Patch for GIMP 3 for Photoshop Users

https://github.com/Diolinux/PhotoGIMP
84•SockThief•2d ago•47 comments

I Found Ultra-Pure Quantum Crystals in an Abandoned Mine in the Atacama Desert

https://medium.com/@breid.at/ultra-pure-quantum-crystals-from-an-abandoned-mine-in-a-mysterious-d...
122•vi_sextus_vi•2d ago•31 comments

Peter Neumann has died

https://www.tuhs.org/pipermail/tuhs/2026-May/033748.html
192•pabs3•9h ago•17 comments

Polypad

https://polypad.amplify.com/
114•ivank•2d ago•9 comments

Nim-Presto – REST API Framework for Nim Language

https://github.com/status-im/nim-presto
12•TheWiggles•1d ago•1 comments

Click (2016)

https://clickclickclick.click/
328•andrewzeno•13h ago•82 comments

Kv4p HT – A homebrew 1W radio (VHF or UHF) that plugs into an Android phone

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

Cursor Introduces Composer 2.5

https://cursor.com/blog/composer-2-5
181•asar•19h ago•142 comments

Anthropic acquires Stainless

https://www.anthropic.com/news/anthropic-acquires-stainless
478•tomeraberbach•19h ago•337 comments

Colonization of Venus

https://en.wikipedia.org/wiki/Colonization_of_Venus
9•simonebrunozzi•33m ago•1 comments

The lasting influence of Netscape Time

https://thehistoryoftheweb.com/the-lasting-influence-of-netscape-time/
56•zdw•2d ago•12 comments

The last six months in LLMs in five minutes

https://simonwillison.net/2026/May/19/5-minute-llms/
526•yakkomajuri•11h ago•423 comments

PyTorch Landscape

https://pytorch.landscape2.io
54•salamo•8h ago•14 comments

Mini Shai-Hulud Strikes Again: 314 npm Packages Compromised

https://safedep.io/mini-shai-hulud-strikes-again-314-npm-packages-compromised/
152•theanonymousone•7h ago•86 comments

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

https://github.com/2b2tplace/1m_release
154•exploraz•22h ago•93 comments

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

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

We let AIs run radio stations

https://andonlabs.com/blog/andon-fm
294•lukaspetersson•18h ago•223 comments

Energy return in running shoes explained (2025)

https://runrepeat.com/guides/energy-return-in-running-shoes
24•jstrieb•1d ago•22 comments

Make ZIP files smaller with ZIP Shrinker

https://evanhahn.com/make-zip-files-smaller-with-zip-shrinker/
42•zdw•2d ago•28 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...
250•cucho•13h ago•165 comments

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

https://isabisabel.com/gacha/
183•babel16•5d ago•77 comments

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

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

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

https://hyperpolyglot.org/lisp
168•veqq•17h ago•41 comments

AI eats the world (Spring 26) [pdf]

https://static1.squarespace.com/static/50363cf324ac8e905e7df861/t/6a0af5d0484fbf5fe9a7743e/177910...
262•topherjaynes•1d ago•141 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/
1002•nycdatasci•19h ago•506 comments

Two computers, one monitor, zero fiddling (2025)

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

Peter Salus has died

https://www.tuhs.org/pipermail/tuhs/2026-May/033750.html
151•speckx•10h ago•12 comments