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" (2023)

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

The Free Universal Construction Kit

https://fffff.at/free-universal-construction-kit/
130•robinhouston•3d ago•24 comments

New 10 GbE USB adapters are cooler, smaller, cheaper

https://www.jeffgeerling.com/blog/2026/new-10-gbe-usb-adapters-cooler-smaller-cheaper/
486•calcifer•14h ago•282 comments

Using coding assistance tools to revive projects you never were going to finish

https://blog.matthewbrunelle.com/its-ok-to-use-coding-assistance-tools-to-revive-the-projects-you...
42•speckx•4h ago•24 comments

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

https://github.com/MartinGalway/C64_music
135•ingve•9h ago•17 comments

Desmond Morris has died

https://www.bbc.com/news/articles/c51y797v200o
56•martey•4d ago•9 comments

Which one is more important: more parameters or more computation? (2021)

https://parl.ai/projects/params_vs_compute/
31•jxmorris12•1d ago•2 comments

Discret 11, the French TV encryption of the 80s

https://fabiensanglard.net/discret11/
110•adunk•9h ago•17 comments

Show HN: Kloak, A secret manager that keeps K8s workload away from secrets

https://getkloak.io/
10•neo2006•1h ago•3 comments

Hokusai and Tesselations

https://dl.ndl.go.jp/pid/1899550/1/11/
62•srean•3h ago•11 comments

AI agents that argue with each other to improve decisions

https://github.com/rockcat/HATS
12•rockcat12•2h ago•2 comments

GPT‑5.5 Bio Bug Bounty

https://openai.com/index/gpt-5-5-bio-bug-bounty/
95•Murfalo•6h ago•84 comments

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

https://github.com/nakagami/grdpwasm
92•mariuz•9h ago•38 comments

Commenting and approving pull requests

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

What async promised and what it delivered

https://causality.blog/essays/what-async-promised/
84•zdw•3d ago•76 comments

Insights into firewood use by early Middle Pleistocene hominins

https://www.sciencedirect.com/science/article/pii/S0277379126001824
36•wslh•2d ago•10 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/
57•keepamovin•9h ago•40 comments

Mine, an IDE for Coalton and Common Lisp

https://coalton-lang.github.io/mine/
8•varjag•2h ago•0 comments

Lute: A Standalone Runtime for Luau

https://lute.luau.org/
17•vrn-sn•2d ago•3 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/
234•rbanffy•19h ago•123 comments

Lambda Calculus Benchmark for AI

https://victortaelin.github.io/lambench/
109•marvinborner•9h ago•34 comments

Replace IBM Quantum back end with /dev/urandom

https://github.com/yuvadm/quantumslop/blob/25ad2e76ae58baa96f6219742459407db9dd17f5/URANDOM_DEMO.md
302•pigeons•19h ago•42 comments

America's Geothermal Breakthrough Could Unlock a 150-Gigawatt Energy Revolution

https://oilprice.com/Alternative-Energy/Geothermal-Energy/Americas-Geothermal-Breakthrough-Could-...
8•sleepyguy•52m ago•5 comments

Sabotaging projects by overthinking, scope creep, and structural diffing

https://kevinlynagh.com/newsletter/2026_04_overthinking/
501•alcazar•1d ago•127 comments

HEALPix

https://en.wikipedia.org/wiki/HEALPix
39•hyperific•7h ago•5 comments

The Stanford Freshmen Who Want to Rule the World

https://www.theatlantic.com/ideas/2026/04/stanford-students-power/686920/
8•apparent•40m ago•1 comments

Panipat: The rise of the Mughals

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

Niri 26.04: Scrollable-tiling Wayland compositor

https://github.com/niri-wm/niri/releases/tag/v26.04
178•nickjj•4h ago•54 comments

My audio interface has SSH enabled by default

https://hhh.hn/rodecaster-duo-fw/
300•hhh•1d ago•91 comments

The mail sent to a video game publisher

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