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•11mo ago

Comments

quentinp•11mo 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•11mo ago
Page didnt load for me.

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

Multiprocessing all the way!

emmelaich•11mo ago
(2021)

Good article!

punnerud•11mo 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•11mo 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•11mo ago
How does the GIL come into play here?
punnerud•11mo 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.

1-Bit Hokusai's "The Great Wave"

https://www.hypertalking.com/2023/05/08/1-bit-pixel-art-of-hokusais-the-great-wave-off-kanagawa/
100•stephen-hill•3d ago•12 comments

New 10 GbE USB adapters are cooler, smaller, cheaper

https://www.jeffgeerling.com/blog/2026/new-10-gbe-usb-adapters-cooler-smaller-cheaper/
325•calcifer•8h ago•169 comments

Google plans to invest up to $40B in Anthropic

https://www.bloomberg.com/news/articles/2026-04-24/google-plans-to-invest-up-to-40-billion-in-ant...
664•elffjs•22h ago•664 comments

Martin Galway's music source files from 1980's Commodore 64 games

https://github.com/MartinGalway/C64_music
35•ingve•3h ago•6 comments

Lambda Calculus Benchmark for AI

https://victortaelin.github.io/lambench/
32•marvinborner•2h ago•11 comments

How to Implement an FPS Counter

https://vplesko.com/posts/how_to_implement_an_fps_counter.html
73•vplesko•3d ago•15 comments

A Man Who Invented the Future

https://hedgehogreview.com/web-features/thr/posts/the-man-who-invented-the-future
34•apollinaire•3d ago•8 comments

A web-based RDP client built with Go WebAssembly and grdp

https://github.com/nakagami/grdpwasm
26•mariuz•3h ago•8 comments

A 3D Body from Eight Questions – No Photo, No GPU

https://clad.you/blog/posts/questionnaire-mlp/
102•arkadiuss•3d ago•17 comments

Plain text has been around for decades and it’s here to stay

https://unsung.aresluna.org/plain-text-has-been-around-for-decades-and-its-here-to-stay/
163•rbanffy•13h ago•68 comments

Show HN: A Karpathy-style LLM wiki your agents maintain (Markdown and Git)

https://github.com/nex-crm/wuphf
130•najmuzzaman•5h ago•62 comments

Humpback whales are forming super-groups

https://www.bbc.com/future/article/20260416-the-humpback-super-groups-swarming-the-seas
148•andsoitis•3d ago•77 comments

Paraloid B-72

https://en.wikipedia.org/wiki/Paraloid_B-72
232•Ariarule•3d ago•41 comments

PCR is a surprisingly near-optimal technology

https://nikomc.com/2026/04/22/pcr/
60•mailyk•2d ago•7 comments

Replace IBM Quantum back end with /dev/urandom

https://github.com/yuvadm/quantumslop/blob/25ad2e76ae58baa96f6219742459407db9dd17f5/URANDOM_DEMO.md
217•pigeons•13h ago•32 comments

Sabotaging projects by overthinking, scope creep, and structural diffing

https://kevinlynagh.com/newsletter/2026_04_overthinking/
469•alcazar•23h ago•114 comments

The mail sent to a video game publisher

https://www.gamefile.news/p/panic-mail-arco-despelote-time-flies-thank-goodness-teeth
77•colinprince•3d ago•1 comments

My audio interface has SSH enabled by default

https://hhh.hn/rodecaster-duo-fw/
275•hhh•18h ago•83 comments

Iliad fragment found in Roman-era mummy

https://www.thehistoryblog.com/archives/75877
208•wise_blood•2d ago•66 comments

Panipat: The Rise of the Mughals

https://www.historytoday.com/archive/feature/panipat-rise-mughals
14•Thevet•3d ago•7 comments

Only One Side Will Be the True Successor to MS-DOS – Windows 2.x

https://blisscast.wordpress.com/2026/04/21/windows-2-gui-wonderland-12a/
14•keepamovin•3h ago•9 comments

Commenting and Approving Pull Requests

https://www.jakeworth.com/posts/on-commenting-and-approving-pull-requests/
4•jwworth•2d ago•0 comments

Open source memory layer so any AI agent can do what Claude.ai and ChatGPT do

https://alash3al.github.io/stash?_v01
95•alash3al•12h ago•45 comments

There Will Be a Scientific Theory of Deep Learning

https://arxiv.org/abs/2604.21691
286•jamie-simon•20h ago•121 comments

Cosmology with Geometry Nodes

https://www.blender.org/user-stories/cosmology-with-geometry-nodes/
86•shankysingh•12h ago•1 comments

Education must go beyond the mere production of words

https://www.ncregister.com/commentaries/schnell-repairing-the-ruins
92•signor_bosco•13h ago•39 comments

Email could have been X.400 times better

https://buttondown.com/blog/x400-vs-smtp-email
209•maguay•2d ago•172 comments

Turbo Vision 2.0 – a modern port

https://github.com/magiblot/tvision
166•andsoitis•9h ago•42 comments

Work with the garage door up (2024)

https://notes.andymatuschak.org/Work_with_the_garage_door_up
173•jxmorris12•3d ago•120 comments

DeepSeek v4

https://api-docs.deepseek.com/news/news260424
1981•impact_sy•1d ago•1512 comments