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.

Small models also found the vulnerabilities that Mythos found

https://aisle.com/blog/ai-cybersecurity-after-mythos-the-jagged-frontier
889•dominicq•10h ago•249 comments

We spoke to the man making viral Lego-style AI videos for Iran

https://www.bbc.com/news/articles/cjd8jrd1vnyo
29•breve•46m ago•5 comments

The End of Eleventy

https://brennan.day/the-end-of-eleventy/
38•ValentineC•1h ago•18 comments

How We Broke Top AI Agent Benchmarks: And What Comes Next

https://rdi.berkeley.edu/blog/trustworthy-benchmarks-cont/
257•Anon84•8h ago•69 comments

Apple Silicon and Virtual Machines: Beating the 2 VM Limit (2023)

https://khronokernel.com/macos/2023/08/08/AS-VM.html
158•krackers•6h ago•107 comments

447 TB/cm² at zero retention energy – atomic-scale memory on fluorographane

https://zenodo.org/records/19513269
150•iliatoli•7h ago•77 comments

How Complex is my Code?

https://philodev.one/posts/2026-04-code-complexity/
38•speckx•4d ago•4 comments

Pijul a FOSS distributed version control system

https://pijul.org/
92•kouosi•4d ago•13 comments

Dark Castle

https://darkcastle.co.uk/
137•evo_9•7h ago•18 comments

Advanced Mac Substitute is an API-level reimplementation of 1980s-era Mac OS

https://www.v68k.org/advanced-mac-substitute/
207•zdw•11h ago•55 comments

How a dancer with ALS used brainwaves to perform live

https://www.electronicspecifier.com/products/sensors/how-a-dancer-with-als-used-brainwaves-to-per...
5•1659447091•1h ago•1 comments

Cirrus Labs to join OpenAI

https://cirruslabs.org/
239•seekdeep•14h ago•120 comments

How to build a `Git diff` driver

https://www.jvt.me/posts/2026/04/11/how-git-diff-driver/
87•zdw•9h ago•7 comments

Surelock: Deadlock-Free Mutexes for Rust

https://notes.brooklynzelenka.com/Blog/Surelock
186•codetheweb•3d ago•58 comments

The Soul of an Old Machine

https://skalski.dev/the-soul-of-an-old-machine/
32•mskalski•4d ago•7 comments

Show HN: Pardonned.com – A searchable database of US Pardons

389•vidluther•21h ago•222 comments

What is a property?

https://alperenkeles.com/posts/what-is-a-property/
61•alpaylan•4d ago•17 comments

Americans still opt for print books over digital or audio versions

https://www.pewresearch.org/short-reads/2026/04/09/americans-still-opt-for-print-books-over-digit...
29•thm•1h ago•17 comments

Keeping a Postgres Queue Healthy

https://planetscale.com/blog/keeping-a-postgres-queue-healthy
84•tanelpoder•10h ago•21 comments

Building Slogbox

https://alexrios.me/blog/slogbox-devlog/
7•zimpenfish•4d ago•1 comments

Every plane you see in the sky – you can now follow it from the cockpit in 3D

https://flight-viz.com/cockpit.html?lat=40.64&lon=-73.78&alt=3000&hdg=220&spd=130&cs=DAL123
260•coolwulf•3d ago•55 comments

Midnight Captain – A midnight commander inspired file manager

https://github.com/duguyue100/midnight-captain
16•duguyue100•3h ago•6 comments

Optimal Strategy for Connect 4

https://2swap.github.io/WeakC4/explanation/
268•marvinborner•3d ago•30 comments

The Life and Death of the Book Review

https://libertiesjournal.com/articles/the-life-and-death-of-the-book-review/
20•lermontov•2d ago•4 comments

New synthesis of astronomical measurements shows Hubble tension is real

https://noirlab.edu/public/news/noirlab2611/?nocache=true&lang=en
45•anigbrowl•8h ago•6 comments

The APL programming language source code (2012)

https://computerhistory.org/blog/the-apl-programming-language-source-code/
49•tosh•9h ago•9 comments

The Problem That Built an Industry

https://ajitem.com/blog/iron-core-part-1-the-problem-that-built-an-industry/
111•ShaggyHotDog•13h ago•37 comments

In Production

https://lucumr.pocoo.org/2026/4/4/absurd-in-production/
7•surprisetalk•4d ago•1 comments

The future of everything is lies, I guess – Part 5: Annoyances

https://aphyr.com/posts/415-the-future-of-everything-is-lies-i-guess-annoyances
240•aphyr•12h ago•134 comments

Filing the corners off my MacBooks

https://kentwalters.com/posts/corners/
1310•normanvalentine•1d ago•615 comments