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•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.

Bijou64: A variable-length integer encoding

https://www.inkandswitch.com/tangents/bijou64/
125•justinweiss•2h ago•47 comments

Notes from the Mistral AI Now Summit in Paris

https://koenvangilst.nl/lab/mistral-ai-now-summit
45•vnglst•1h ago•3 comments

GTA 6 Developers Unionize

https://rockstarintel.com/gta-6-developers-announce-rockstar-games-union/
216•AndrewKemendo•1h ago•102 comments

Danish Pension Blacklists SpaceX over 'Catastrophic Governance'

https://www.bloomberg.com/news/articles/2026-05-29/danish-pension-fund-blacklists-spacex-citing-g...
164•leopoldj•2h ago•90 comments

I am retiring from tech to live offline

https://openpath.quest/2026/i-am-retiring-from-tech-to-live-offline/
444•PinkG•2h ago•296 comments

High Density Living, 2000 Years Ago: Inside the Roman Apartment Building

https://commonedge.org/high-density-living-2000-years-ago-inside-the-roman-apartment-building/
88•surprisetalk•4h ago•26 comments

The Dead Economy Theory

https://www.owenmcgrann.com/p/the-dead-economy-theory
139•WillDaSilva•1h ago•142 comments

The Framework 12 is dead. Apple killed it [video]

https://www.youtube.com/watch?v=aPVAnwuSjfk
24•throwaway2037•2h ago•37 comments

CAPTCHAs can still detect AI agents

https://research.roundtable.ai/captchas-detect-ai/
12•timshell•1h ago•6 comments

Someone used my open source project to phish people

https://andrej.sh/posts/phishing-through-my-open-source-project
33•andrejsshell•4h ago•7 comments

Tulip mania: when a single flower was worth more than a house (2025)

https://dutchreview.com/culture/tulip-mania-netherlands/
119•dotcoma•5h ago•108 comments

Real-time LLM Inference on Standard GPUs: 3k tokens/s per request

https://blog.kog.ai/real-time-llm-inference-on-standard-gpus-3-000-tokens-s-per-request/
155•NicoConstant•7h ago•71 comments

Blue Origin's New Glenn blows up during static fire test

https://twitter.com/nasaspaceflight/status/2060164928472854821
431•enraged_camel•16h ago•438 comments

Durable execution, the hard way

https://github.com/hatchet-dev/durable-execution-the-hard-way
20•abelanger•1d ago•0 comments

The UK government's Low Value Purchase System is a waste of time

https://shkspr.mobi/blog/2026/05/the-uk-governments-low-value-purchase-system-is-a-waste-of-time/
123•ColinWright•5h ago•75 comments

Cedana (YC S23) Is Hiring

https://www.ycombinator.com/companies/cedana/jobs/d1vYocG-forward-deployed-engineer-ai-hpc
1•neelm•5h ago

The Secret Garden of Rock-Paper-Scissors

https://theshamblog.com/the-secret-garden-of-rock-paper-scissors/
17•scottshambaugh•3h ago•2 comments

Headway Therapy Patients Forced to Scan Their Faces to Keep Getting Care

https://www.404media.co/headway-therapy-facial-scan-biometric-data-identity-verification/
69•pavel_lishin•3h ago•17 comments

The Science of Weather and the Nature of Science

https://www.the-hinternet.com/p/the-science-of-weather-and-the-nature
4•benbreen•21h ago•0 comments

Orchestrating AI code review at scale

https://blog.cloudflare.com/ai-code-review/
103•pramodbiligiri•3d ago•40 comments

Claude Opus 4.8

https://www.anthropic.com/news/claude-opus-4-8
1692•craigmart•1d ago•1314 comments

Bricks and Minifigs Stole a Man's $200k Lego Collection

https://mybricklog.com/blog/bricks-minifigs-corporate-stole-old-mans-200000-lego-collection
1233•philips•22h ago•551 comments

Let's compile Quake like it's 1997

https://fabiensanglard.net/compile_like_1997/
149•goranmoomin•14h ago•50 comments

An Obsessive Focus on UX: Pilot's Pressure-Regulating Kire-Na Highlighter

https://www.core77.com/posts/143832/An-Obsessive-Focus-on-UX-Pilots-Pressure-Regulating-Kire-Na-H...
49•surprisetalk•3d ago•11 comments

Even (very) noisy LLM evaluators are useful for improving AI agents

https://www.tensorzero.com/blog/even-very-noisy-llm-evaluators-are-useful-for-improving-ai-agents/
25•GabrielBianconi•2d ago•6 comments

We should be more tired than the model

https://vickiboykis.com/2026/05/28/we-should-be-more-tired-than-the-model/
90•tosh•5h ago•83 comments

Local Git Remotes

https://cblgh.org/posts/local-git-remotes/
62•surprisetalk•4h ago•48 comments

Wterm – A terminal emulator for the web

https://wterm.dev/
41•m3h•8h ago•12 comments

Volkswagen blocks Home Assistant by requiring client assertion

https://github.com/robinostlund/homeassistant-volkswagencarnet/issues/967
336•Kwastie•11h ago•170 comments

Is AI causing a repeat of Front end's Lost Decade?

https://mastrojs.github.io/blog/2026-05-23-is-AI-causing-a-repeat-of-frontends-lost-decade/
190•xyzal•6h ago•185 comments