frontpage.
newsnewestaskshowjobs

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.

Meta Muse Glimmer – open weights 30B local coding model

https://research.meta.ai/blog/introducing-muse-glimmer-open-agentic-model
284•riordan•2h ago•108 comments

Because It's Not Fun Enough: why languages fail

https://bytecode.news/posts/2026/08/because-it-s-not-fun-enough
45•jottinger•1h ago•24 comments

Docker Sandboxes – Disposable, isolated sandboxes for AI agents

https://www.docker.com/products/docker-sandboxes/
322•etoxin•6h ago•185 comments

Tail-call optimization in C is relatively recent

https://lwn.net/Articles/1034703/
28•prakashqwerty•1h ago•11 comments

Squeak/Smalltalk 6.1 Release Notes

https://squeak.org/release_notes/6.1/
10•fniephaus•43m ago•1 comments

Parametron: 50s Japanese computer that uses neither transistors nor vacuum tubes

https://ethw.org/Milestones:Parametron,_1954
18•xeonmc•2h ago•1 comments

What Happened to HackerOne?

https://blog.teknogeek.io/posts/what-happened-to-hackerone/
282•hipparchus•10h ago•142 comments

Run Android ARM64 VR APKs on Apple Vision Pro

https://github.com/shinyquagsire23/Klepton
114•LorenDB•9h ago•16 comments

Tail-Call Interpreters in Rust – Jimmy Ostler

https://lordgoati.us/blog/tail-call/
45•amatheus•3d ago•15 comments

An Interesting Fourier Transform – 1/F Noise

https://www.dsprelated.com/showarticle/40.php
69•q7m•3d ago•15 comments

Show HN: Voice driven murder mystery, Interview AI suspects with your voice

https://www.whodunnitai.com/
125•MrRowTheBoat•9h ago•52 comments

How Blackwing Pencils are Made [video]

https://www.youtube.com/watch?v=fow-LsdaH2E
30•NaOH•4d ago•12 comments

How I use LLMs to learn complex topics

https://laurentiugabriel.github.io/blog/articles/how-i-use-llms-to-learn/
705•laurentiurad•17h ago•445 comments

DeepSeek costs OpenCode Go user $1.14/day; dual DGX breaks even in 24 years

https://twitter.com/thdxr/status/2086599224674681242
11•delduca•34m ago•2 comments

Taxi drivers rarely die of Alzheimer's

https://theconversation.com/taxi-drivers-rarely-die-of-alzheimers-how-complex-mental-maps-and-spa...
321•jader201•21h ago•229 comments

Findphone: Locate a nearby Bluetooth device by signal strength

https://github.com/ben-z/findphone
5•helsinkiandrew•5d ago•1 comments

A 'bananas' order for 5000 obscure book titles fuels suspicion

https://www.irishtimes.com/world/europe/2026/08/10/a-mysterious-buying-spree-is-unsettling-europe...
48•ohaodha•1h ago•41 comments

How We Pushed CDC into Postgres

https://www.snowflake.com/en/blog/engineering/postgres-to-snowflake-replication-mirroring/
108•craigkerstiens•11h ago•19 comments

Ask HN: What are you working on? (August 2026)

270•david927•19h ago•934 comments

Cool URIs Don't Change (1998)

https://www.w3.org/Provider/Style/URI
255•Klaster_1•22h ago•62 comments

ATProto for Distributed Systems Engineers

https://atproto.com/articles/atproto-for-distsys-engineers
101•LelouBil•3d ago•18 comments

An alias-based formulation of the borrow checker (2018)

https://smallcultfollowing.com/babysteps/blog/2018/04/27/an-alias-based-formulation-of-the-borrow...
17•parksb•2d ago•1 comments

Picophysics: Single file physics for games on platforms like N64, PSX, DC

https://gitlab.com/Kazade/picophysics
68•klaussilveira•5d ago•22 comments

Tuxedo No. 2 – Cocktail recipes

https://tuxedono2.com
108•smartmic•16h ago•35 comments

Nearest Pint

https://knowwhereconsulting.co.uk/maps/pubs/
41•bookofjoe•5d ago•22 comments

Everything you do is being recorded

https://www.theatlantic.com/technology/2026/05/ai-wearable-surveillance-countermeasures/687203/
344•ike_usawa•1d ago•295 comments

I made tinnitus my friend, then it disappeared [video]

https://mynoise.net/vlog.php?ep=20260803
174•gregsadetsky•18h ago•138 comments

Meta's new open-weight model targets local agentic AI

https://twitter.com/finkd/status/2086754845218726027
16•bakigul•2h ago•2 comments

New Zealand lost its music media, and what we're building to replace it

https://propelmusic.co.nz/articles/the-sound-went-quiet-nz-music-media
121•berghoffer•16h ago•82 comments

Auto mode is now the default in Claude Code

https://claude.com/blog/auto-mode-default-in-claude-code
251•sbehere•9h ago•260 comments