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•8mo ago

Comments

quentinp•8mo 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•8mo ago
Page didnt load for me.

https://realpython.com/async-io-python/

Multiprocessing all the way!

emmelaich•8mo ago
(2021)

Good article!

punnerud•8mo 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•8mo 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•8mo ago
How does the GIL come into play here?
punnerud•8mo 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.

Lessons from 14 Years at Google

https://addyosmani.com/blog/21-lessons/
851•cdrnsf•11h ago•385 comments

Show HN: Terminal UI for AWS

https://github.com/huseyinbabal/taws
190•huseyinbabal•6h ago•96 comments

Why does a least squares fit appear to have a bias when applied to simple data?

https://stats.stackexchange.com/questions/674129/why-does-a-linear-least-squares-fit-appear-to-ha...
136•azeemba•6h ago•31 comments

The Showa Hundred Year Problem

https://www.dampfkraft.com/showa-100.html
13•polm23•4d ago•1 comments

The Unbearable Joy of Sitting Alone in a Café

https://candost.blog/the-unbearable-joy-of-sitting-alone-in-a-cafe/
438•mooreds•11h ago•278 comments

Linear Address Spaces: Unsafe at any speed (2022)

https://queue.acm.org/detail.cfm?id=3534854
116•nithssh•4d ago•78 comments

Street Fighter II, the World Warrier (2021)

https://fabiensanglard.net/sf2_warrier/
312•birdculture•11h ago•51 comments

Millennium Challenge: A corrupted military exercise and its legacy (2015)

https://warontherocks.com/2015/11/millennium-challenge-the-real-story-of-a-corrupted-military-exe...
20•lifeisstillgood•2h ago•11 comments

Ripple, a puzzle game about 2nd and 3rd order effects

https://ripplegame.app/
79•mooreds•8h ago•14 comments

Eurostar AI vulnerability: When a chatbot goes off the rails

https://www.pentestpartners.com/security-blog/eurostar-ai-vulnerability-when-a-chatbot-goes-off-t...
94•speckx•5h ago•26 comments

Six Harmless Bugs Lead to Remote Code Execution

https://mehmetince.net/the-story-of-a-perfect-exploit-chain-six-bugs-that-looked-harmless-until-t...
24•ozirus•3d ago•1 comments

Server-rendered multiplayer games with Lua (no client code)

https://cleoselene.com/
59•brunovcosta•6h ago•34 comments

Show HN: An interactive guide to how browsers work

https://howbrowserswork.com/
175•krasun•11h ago•28 comments

Web development is fun again

https://ma.ttias.be/web-development-is-fun-again/
296•Mojah•11h ago•382 comments

Agentic Patterns

https://github.com/nibzard/awesome-agentic-patterns
74•PretzelFisch•7h ago•7 comments

The great shift of English prose

https://www.worksinprogress.news/p/english-prose-has-become-much-easier
32•dsubburam•4d ago•21 comments

The Year of the 3D Printed Miniature (and Other Lies We Tell Ourselves)

https://matduggan.com/the-year-of-the-3d-printed-miniature-and-other-lies-we-tell-ourselves/
99•sagacity•6d ago•63 comments

OpenGitOps

https://opengitops.dev/
38•locknitpicker•6h ago•37 comments

Show HN: Hover – IDE style hover documentation on any webpage

https://github.com/Sampsoon/hover
37•sampsonj•7h ago•16 comments

Moiré Explorer

https://play.ertdfgcvb.xyz/#/src/demos/moire_explorer
129•Luc•13h ago•17 comments

Using Hinge as a Command and Control Server

https://mattwie.se/hinge-command-control-c2
94•mattwiese•12h ago•42 comments

Claude Code On-the-Go

https://granda.org/en/2026/01/02/claude-code-on-the-go/
215•todsacerdoti•6h ago•148 comments

Show HN: An LLM-Powered PCB Schematic Checker (Major Update)

https://traceformer.io/
31•wafflesfreak•4h ago•15 comments

Trellis AI (YC W24) is hiring engineers to build AI agents for healthcare access

https://www.ycombinator.com/companies/trellis-ai/jobs/ngvfeaq-member-of-technical-staff-full-time
1•macklinkachorn•9h ago

Maybe comments should explain 'what' (2017)

https://www.hillelwayne.com/post/what-comments/
190•zahrevsky•15h ago•182 comments

FreeBSD Home NAS, part 3: WireGuard VPN, routing, and Linux peers

https://rtfm.co.ua/en/freebsd-home-nas-part-3-wireguard-vpn-linux-peer-and-routing/
145•todsacerdoti•14h ago•8 comments

Bison return to Illinois' Kane County after 200 years

https://phys.org/news/2025-12-bison-illinois-kane-county-years.html
118•bikenaga•5d ago•34 comments

Stop Forwarding Errors, Start Designing Them

https://fast.github.io/blog/stop-forwarding-errors-start-designing-them/
77•andylokandy•7h ago•46 comments

How I archived 10 years of memories using Spotify

https://notes.xdavidhu.me/notes/how-i-archived-10-years-of-memories-using-spotify
84•xdavidhu•11h ago•38 comments

Show HN: Quantum Tunnel

https://chuanqisun.github.io/quantum-tunnel/
17•osmoscraft•2h ago•6 comments