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.

Claude Fable 5

https://www.anthropic.com/news/claude-fable-5-mythos-5
1694•Philpax•7h ago•1341 comments

Upcoming breaking changes for NPM v12

https://github.blog/changelog/2026-06-09-upcoming-breaking-changes-for-npm-v12/
157•plasma•3h ago•48 comments

Ultrafast machine learning on FPGAs via Kolmogorov-Arnold Networks

https://aarushgupta.io/posts/kan-fpga/
146•ag2718•5h ago•17 comments

AI misidentification results in wrongful arrest; man seeks justice

https://www.wsoctv.com/news/local/ai-misidentification-results-wrongful-arrest-man-seeks-justice/...
49•text0404•1h ago•12 comments

If Claude Fable stops helping you, you'll never know

https://jonready.com/blog/posts/claude-fable5-is-allowed-to-sabotage-your-app-if-youre-a-competit...
382•mips_avatar•3h ago•172 comments

Making Graphics Like it's 1993

https://staniks.github.io/articles/catlantean-3d-blog-1/
752•sklopec•13h ago•127 comments

RIP software hackathons. Long live the hardware hackathon

https://blog.oscars.dev/posts/rip-software-hackathons-long-live-the-hardware-hackathon/
26•ozcap•1h ago•3 comments

CEOs Who Think AI Replaces Their Employees Are Just Bad CEOs

https://www.techdirt.com/2026/06/09/ceos-who-think-ai-replaces-their-employees-are-just-bad-ceos/
381•speckx•5h ago•154 comments

Exif Smuggling

https://github.com/signalblur/exifsmugglingpoc
46•rolph•3h ago•20 comments

A giant star may have destroyed itself in one of the rarest explosions

https://phys.org/news/2026-05-giant-star-destroyed-universe-rarest.html
155•wglb•1d ago•21 comments

Lies We Tell Ourselves About Email Addresses

https://gitpush--force.com/commits/2026/06/lies-we-tell-ourselves-about-email/
18•theanonymousone•1d ago•7 comments

It's Death

https://jesseduffield.com/ITS-DEATH/
7•inatreecrown2•49m ago•0 comments

Test-case reducers are underappreciated debugging tools

https://tratt.net/laurie/blog/2026/test_case_reducers_are_underappreciated_debugging_tools.html
76•ltratt•13h ago•10 comments

More Molly Guards

https://unsung.aresluna.org/more-molly-guards/
6•zdw•3d ago•0 comments

OpenCV 5 Is Here: The Biggest Leap in Years for Computer Vision

https://opencv.org/opencv-5/
680•ternaus•3d ago•119 comments

Show HN: Resonate – Low-latency, high-resolution spectral analysis

https://alexandrefrancois.org/Resonate/
15•arjf•3d ago•8 comments

Let's Encrypt bans certificate usage in any US sanctioned territory [pdf]

https://letsencrypt.org/documents/LE-SA-v1.7-June-04-2026-diff.pdf
306•piskov•1d ago•246 comments

Flat Datacenter Networks at Scale at Amazon

https://perspectives.mvdirona.com/2026/06/flat-datacenter-networks-at-scale/
83•tanelpoder•20h ago•16 comments

Grit: Rewriting Git in Rust with Agents

https://blog.gitbutler.com/true-grit
61•cbrewster•4h ago•51 comments

The LD_DEBUG environment variable (2012)

https://bnikolic.co.uk/blog/linux-ld-debug.html
54•tanelpoder•7h ago•1 comments

FCC wants to kill burner phones by forcing telecoms to get all customers' IDs

https://www.404media.co/fcc-wants-to-kill-burner-phones-by-forcing-telecoms-to-get-all-customers-...
425•berlianta•9h ago•267 comments

Apple decided not to roll out Siri in EU after denied request for exemption

https://www.reuters.com/business/apple-failed-make-its-ai-tool-comply-eu-regulations-eu-commissio...
344•flanged•8h ago•579 comments

Launch HN: Transload (YC P26) – Measuring freight items with CCTV

33•nils_spatial•8h ago•10 comments

Starlink shifts hardware from one-time purchase to $10/month rental

https://arstechnica.com/tech-policy/2026/06/starlink-takes-page-from-cable-firms-with-10-monthly-...
11•Lihh27•36m ago•0 comments

Biff.core: system composition for Clojure web apps

https://biffweb.com/p/core/
102•jacobobryant•8h ago•21 comments

Is Grep All You Need? How Agent Harnesses Reshape Agentic Search

https://arxiv.org/abs/2605.15184
116•Anon84•11h ago•52 comments

Company Will Add Phone, AirPod, and Smartwatch Trackers to ALPRs

https://www.404media.co/this-company-will-add-phone-airpod-and-smartwatch-trackers-to-license-pla...
79•Cider9986•3h ago•26 comments

Show HN: Gravity – interactive solar-system simulator, from Newton to Einstein

https://qunabu.github.io/Gravity/
139•qunabu•12h ago•34 comments

The iPhone's Last Stand?

https://stratechery.com/2026/the-iphones-last-stand/
164•swolpers•14h ago•206 comments

Ask HN: Are you still using a Vision Pro?

126•y1n0•5h ago•149 comments