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.

Native all the way, until you need text

https://justsitandgrin.im/posts/native-all-the-way-until-you-need-text/
5•dive•36m ago•1 comments

Zerostack – A Unix-inspired coding agent written in pure Rust

https://crates.io/crates/zerostack/1.0.0
447•gidellav•14h ago•215 comments

Mozilla to UK regulators: VPNs are essential privacy and security tools

https://blog.mozilla.org/netpolicy/2026/05/15/mozilla-to-uk-regulators-vpns-are-essential-privacy...
319•WithinReason•6h ago•127 comments

Prolog Basics Explained with Pokémon

https://unplannedobsolescence.com/blog/prolog-basics-pokemon/
36•birdculture•2d ago•4 comments

A nicer voltmeter clock

https://lcamtuf.substack.com/p/a-nicer-voltmeter-clock
224•surprisetalk•13h ago•27 comments

Colossus: The Forbin Project

https://en.wikipedia.org/wiki/Colossus:_The_Forbin_Project
125•doener•2d ago•43 comments

Hosting a website on an 8-bit microcontroller

https://maurycyz.com/projects/mcusite/
158•zdw•11h ago•13 comments

OpenAI and Government of Malta partner to roll out ChatGPT Plus to all citizens

https://openai.com/index/malta-chatgpt-plus-partnership/
221•bookofjoe•16h ago•268 comments

Playing Atari ST Music on the Amiga with Zero CPU

https://arnaud-carre.github.io/2026-05-15-ym-fast-emu/
61•z303•4h ago•19 comments

Moving away from Tailwind, and learning to structure my CSS

https://jvns.ca/blog/2026/05/15/moving-away-from-tailwind--and-learning-to-structure-my-css-/
580•mpweiher•1d ago•324 comments

SANA-WM, a 2.6B open-source world model for 1-minute 720p video

https://nvlabs.github.io/Sana/WM/
354•mjgil•1d ago•140 comments

How Diamonds Are Made

https://diamond.jaydip.me/
8•lemonberry•1d ago•0 comments

We've made the world too complicated

https://user8.bearblog.dev/the-world-is-too-complicated/
320•James72689•1d ago•319 comments

Twilight of the Velocipede: Typesetting Races Before the Age of Linotype

https://publicdomainreview.org/essay/twilight-of-the-velocipede/
22•benbreen•15h ago•0 comments

Accelerando (2005)

https://www.antipope.org/charlie/blog-static/fiction/accelerando/accelerando.html
306•eamag•1d ago•174 comments

The Third Hard Problem

https://mmapped.blog/posts/48-the-third-hard-problem
98•surprisetalk•2d ago•48 comments

Illusions of understanding in the sciences

https://link.springer.com/article/10.1007/s42113-026-00271-1
55•sebg•2d ago•26 comments

MCP Hello Page

https://www.hybridlogic.co.uk/blog/2026/05/mcp-hello-page
110•Dachande663•14h ago•36 comments

Frontier AI has broken the open CTF format

https://kabir.au/blog/the-ctf-scene-is-dead
388•frays•1d ago•403 comments

Roman Letters

https://romanletters.org/
41•diodorus•2d ago•9 comments

Halt and Catch Fire

https://unstack.io/halt-and-catch-fire
150•ScottWRobinson•18h ago•80 comments

C++26 Shipped a SIMD Library Nobody Asked For

https://lucisqr.substack.com/p/c26-shipped-a-simd-library-nobody
153•signa11•2d ago•112 comments

Unknowable Math Can Help Hide Secrets

https://www.quantamagazine.org/how-unknowable-math-can-help-hide-secrets-20260511/
57•Xcelerate•3d ago•11 comments

δ-mem: Efficient Online Memory for Large Language Models

https://arxiv.org/abs/2605.12357
223•44za12•1d ago•58 comments

Why did Clovis toolmakers choose difficult quartz crystal?

https://phys.org/news/2026-04-clovis-toolmakers-difficult-quartz-crystal.html
29•PaulHoule•2d ago•18 comments

A molecule with half-Möbius topology

https://www.science.org/doi/10.1126/science.aea3321
101•bryanrasmussen•4d ago•7 comments

Self-Distillation Enables Continual Learning [pdf]

https://arxiv.org/abs/2601.19897
71•teleforce•11h ago•17 comments

Show HN: Rocksky – Music scrobbling and discovery on the AT Protocol

https://tangled.org/rocksky.app/rocksky
88•tsiry•19h ago•39 comments

3D Gaussian Splatting in a Weekend

https://bfeldman.me/3dgs-weekend/
108•b__feldman•3d ago•10 comments

I believe there are entire companies right now under AI psychosis

https://twitter.com/mitchellh/status/2055380239711457578
2013•reasonableklout•1d ago•1180 comments