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.

Laws of Software Engineering

https://lawsofsoftwareengineering.com
429•milanm081•5h ago•212 comments

As Oceans Warm, Great White Sharks Are Overheating

https://e360.yale.edu/digest/great-white-sharks-climate
78•speckx•1h ago•50 comments

Original GrapheneOS responses to WIRED fact checker

https://discuss.grapheneos.org/d/34369-original-grapheneos-responses-to-wired-fact-checker
40•ChrisArchitect•1h ago•18 comments

Fusion Power Plant Simulator

https://www.fusionenergybase.com/fusion-power-plant-simulator
41•sam•1h ago•14 comments

Tim Cook's Impeccable Timing

https://stratechery.com/2026/tim-cooks-impeccable-timing/
143•hasheddan•4h ago•208 comments

John Ternus to become Apple CEO

https://www.apple.com/newsroom/2026/04/tim-cook-to-become-apple-executive-chairman-john-ternus-to...
2089•schappim•19h ago•1191 comments

Show HN: GoModel – an open-source AI gateway in Go; 44x lighter than LiteLLM

https://github.com/ENTERPILOT/GOModel/
41•santiago-pl•1h ago•11 comments

Show HN: VidStudio, a browser based video editor that doesn't upload your files

https://vidstudio.app/video-editor
155•kolx•4h ago•57 comments

Running a Minecraft Server and More on a 1960s Univac Computer

https://farlow.dev/2026/04/17/running-a-minecraft-server-and-more-on-a-1960s-univac-computer
90•brilee•3d ago•15 comments

Your favorite brands got worse on purpose

https://www.worseonpurpose.com/p/your-favorite-brands-got-worse-on-purpose
95•neon_electro•1h ago•36 comments

Tindie store under "scheduled maintenance" for days

https://www.tindie.com/
65•somemisopaste•3h ago•21 comments

A type-safe, realtime collaborative Graph Database in a CRDT

https://codemix.com/graph
94•phpnode•5h ago•29 comments

MNT Reform is an open hardware laptop, designed and assembled in Germany

http://mnt.stanleylieber.com/reform/
177•speckx•1d ago•71 comments

Anthropic says OpenClaw-style Claude CLI usage is allowed again

https://docs.openclaw.ai/providers/anthropic
365•jmsflknr•12h ago•213 comments

Anthropic takes $5B from Amazon and pledges $100B in cloud spending in return

https://techcrunch.com/2026/04/20/anthropic-takes-5b-from-amazon-and-pledges-100b-in-cloud-spendi...
121•Brajeshwar•3h ago•121 comments

Slava's Monoid Zoo

https://factorcode.org/slava/monoids.html
30•luu•1d ago•5 comments

Leonardo, Borgia, and Machiavelli: A Fateful Collusion

https://www.historytoday.com/archive/leonardo-borgia-and-machiavelli-fateful-collusion
12•apollinaire•5d ago•0 comments

Clojure: Transducers

https://clojure.org/reference/transducers
10•tosh•2d ago•1 comments

Salmon exposed to cocaine and its main byproduct roam more widely

https://www.science.org/content/article/cocaine-pollution-gives-salmon-wanderlust
106•1659447091•10h ago•61 comments

The Beauty of Bonsai Styles

https://longwoodgardens.org/blog/2023-05-17/beauty-bonsai-styles
159•lagniappe•11h ago•28 comments

A Roblox cheat and one AI tool brought down Vercel's platform

https://webmatrices.com/post/how-a-roblox-cheat-and-one-ai-tool-brought-down-vercel-s-entire-plat...
259•bishwasbh•11h ago•140 comments

High-Fidelity KV Cache Summarization Using Entropy and Low-Rank Reconstruction

https://jchandra.com/posts/hae-ols/
49•jchandra•2d ago•10 comments

Apple ignores DMA interoperability requests and contradicts own documentation

https://fsfe.org/news/2026/news-20260420-01.html
168•kirschner•5h ago•30 comments

Less human AI agents, please

https://nial.se/blog/less-human-ai-agents-please/
80•nialse•9h ago•97 comments

Louis Zocchi, games industry pioneer, has died

https://icv2.com/articles/news/view/62176/r-i-p-louis-zocchi-the-godfather-dice
103•sgbeal•9h ago•48 comments

Qwen3.6-Max-Preview: Smarter, Sharper, Still Evolving

https://qwen.ai/blog?id=qwen3.6-max-preview
672•mfiguiere•1d ago•359 comments

The purist's guide to phở in Hanoi

https://connla.substack.com/p/pho-in-hanoi-a-purists-guide
82•vinhnx•2d ago•30 comments

How to make a fast dynamic language interpreter

https://zef-lang.dev/implementation
225•pizlonator•15h ago•42 comments

Vera C. Rubin Observatory has Discovered 11,000 New Asteroids

https://www.universetoday.com/articles/the-vera-c-rubin-observatory-has-discovered-11000-new-aste...
41•tcp_handshaker•2h ago•4 comments

Kimi vendor verifier – verify accuracy of inference providers

https://www.kimi.com/blog/kimi-vendor-verifier
296•Alifatisk•21h ago•28 comments