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.

I am building a cloud

https://crawshaw.io/blog/building-a-cloud
124•bumbledraven•1h ago•29 comments

Alberta startup sells no-tech tractors for half price

https://wheelfront.com/this-alberta-startup-sells-no-tech-tractors-for-half-price/
1618•Kaibeezy•14h ago•523 comments

Apple fixes bug that cops used to extract deleted chat messages from iPhones

https://techcrunch.com/2026/04/22/apple-fixes-bug-that-cops-used-to-extract-deleted-chat-messages...
520•cdrnsf•10h ago•130 comments

We found a stable Firefox identifier linking all your private Tor identities

https://fingerprint.com/blog/firefox-tor-indexeddb-privacy-vulnerability/
607•danpinto•13h ago•164 comments

A True Life Hack: What Physical 'Life Force' Turns Biology's Wheels?

https://www.quantamagazine.org/what-physical-life-force-turns-biologys-wheels-20260420/
39•Prof_Sigmund•1d ago•4 comments

5x5 Pixel font for tiny screens

https://maurycyz.com/projects/mcufont/
530•zdw•3d ago•119 comments

The Onion to Take over InfoWars

https://www.nytimes.com/2026/04/20/business/infowars-alex-jones-the-onion.html
75•lxm•2d ago•6 comments

Borrow-checking without type-checking

https://www.scattered-thoughts.net/writing/borrow-checking-without-type-checking/
42•jamii•3h ago•6 comments

Tempest vs. Tempest: The Making and Remaking of Atari's Iconic Video Game

https://tempest.homemade.systems
54•mwenge•5h ago•19 comments

Over-editing refers to a model modifying code beyond what is necessary

https://nrehiew.github.io/blog/minimal_editing/
338•pella•12h ago•190 comments

Website streamed live directly from a model

https://flipbook.page/
233•sethbannon•12h ago•65 comments

OpenAI's response to the Axios developer tool compromise

https://openai.com/index/axios-developer-tool-compromise/
60•shpat•5h ago•26 comments

Plexus P/20 Emulator

https://spritetm.github.io/plexus_20_emu/
8•hggh•3d ago•0 comments

Flow Map Learning via Nongradient Vector Flow [pdf]

https://openreview.net/pdf?id=C1bkDPqvDW
19•E-Reverance•3h ago•0 comments

Ars Technica: Our newsroom AI policy

https://arstechnica.com/staff/2026/04/our-newsroom-ai-policy/
9•zdw•1h ago•1 comments

Technical, cognitive, and intent debt

https://martinfowler.com/fragments/2026-04-02.html
246•theorchid•14h ago•62 comments

Ping-pong robot beats top-level human players

https://www.reuters.com/sports/ping-pong-robot-ace-makes-history-by-beating-top-level-human-playe...
106•wslh•15h ago•111 comments

Verus is a tool for verifying the correctness of code written in Rust

https://verus-lang.github.io/verus/guide/
43•fanf2•2d ago•7 comments

Parallel agents in Zed

https://zed.dev/blog/parallel-agents
208•ajeetdsouza•12h ago•116 comments

Bring your own Agent to MS Teams

https://microsoft.github.io/teams-sdk/blog/bring-your-agent-to-teams/
51•umangsehgal93•8h ago•29 comments

Qwen3.6-27B: Flagship-Level Coding in a 27B Dense Model

https://qwen.ai/blog?id=qwen3.6-27b
799•mfiguiere•17h ago•375 comments

Scoring Show HN submissions for AI design patterns

https://www.adriankrebs.ch/blog/design-slop/
297•hubraumhugo•15h ago•213 comments

Ultraviolet corona discharges on treetops during storms

https://www.psu.edu/news/earth-and-mineral-sciences/story/treetops-glowing-during-storms-captured...
223•t-3•17h ago•64 comments

The handmade beauty of Machine Age data visualizations

https://resobscura.substack.com/p/the-handmade-beauty-of-machine-age
25•benbreen•16h ago•1 comments

Workspace Agents in ChatGPT

https://openai.com/index/introducing-workspace-agents-in-chatgpt/
131•mfiguiere•12h ago•47 comments

Bodega cats of New York

https://bodegacatsofnewyork.com
188•zdw•5d ago•65 comments

What killed the Florida orange?

https://slate.com/business/2026/04/florida-state-orange-food-houses-real-estate.html
143•danso•2d ago•135 comments

The Neon King of New Orleans

https://gardenandgun.com/new-orleans-neon-king
49•renameme•9h ago•7 comments

Windows 9x Subsystem for Linux

https://social.hails.org/@hailey/116446826733136456
929•sohkamyung•20h ago•218 comments

Approximating Hyperbolic Tangent

https://jtomschroeder.com/blog/approximating-tanh/
39•jtomschroeder•6h ago•5 comments