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

Comments

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

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

Multiprocessing all the way!

emmelaich•7mo ago
(2021)

Good article!

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

GPT-5.2

https://openai.com/index/introducing-gpt-5-2/
751•atgctg•7h ago•596 comments

Nokia N900 Necromancy

https://yaky.dev/2025-12-11-nokia-n900-necromancy/
41•yaky•1h ago•14 comments

Denial of service and source code exposure in React Server Components

https://react.dev/blog/2025/12/11/denial-of-service-and-source-code-exposure-in-react-server-comp...
198•sangeeth96•4h ago•95 comments

Rivian Unveils Custom Silicon, R2 Lidar Roadmap, and Universal Hands Free

https://riviantrackr.com/news/rivian-unveils-custom-silicon-r2-lidar-roadmap-universal-hands-free...
202•doctoboggan•7h ago•288 comments

The highest quality codebase

https://gricha.dev/blog/the-highest-quality-codebase
424•Gricha•3d ago•290 comments

An SVG is all you need

https://jon.recoil.org/blog/2025/12/an-svg-is-all-you-need.html
136•sadiq•6h ago•56 comments

Litestream VFS

https://fly.io/blog/litestream-vfs/
219•emschwartz•7h ago•74 comments

Programmers and software developers lost the plot on naming their tools

https://larr.net/p/namings.html
145•todsacerdoti•7h ago•229 comments

The architecture of “not bad”: Decoding the Chinese source code of the void

https://suggger.substack.com/p/the-architecture-of-not-bad-decoding
62•Suggger•11h ago•67 comments

Show HN: Sim – Apache-2.0 n8n alternative

https://github.com/simstudioai/sim
142•waleedlatif1•8h ago•29 comments

Craft software that makes people feel something

https://rapha.land/craft-software-that-makes-people-feel-something/
240•lukeio•11h ago•115 comments

Powder and stone, or, why medieval rulers loved castles

https://1517.substack.com/p/powder-and-stone-or-why-medieval
27•areoform•4h ago•3 comments

UK House of Lords attempting to ban use of VPNs by anyone under 16

https://alecmuffett.com/article/134925
268•nvarsj•5h ago•254 comments

Pdsink: USB Power Delivery Sink library for embedded devices

https://github.com/pdsink/pdsink
5•zdw•4d ago•0 comments

Almond (YC X25) Is Hiring SWEs and MechEs

https://www.ycombinator.com/companies/almond-2/jobs
1•shawnpatel•4h ago

Christmas Tree Exec

https://en.wikipedia.org/wiki/Christmas_Tree_EXEC
13•jamesgill•5d ago•1 comments

The Walt Disney Company and OpenAI Partner on Sora

https://openai.com/index/disney-sora-agreement/
148•inesranzo•11h ago•415 comments

My productivity app is a never-ending .txt file (2020)

https://jeffhuang.com/productivity_text_file/
156•simonebrunozzi•6h ago•112 comments

Auto-grading decade-old Hacker News discussions with hindsight

https://karpathy.bearblog.dev/auto-grade-hn/
569•__rito__•1d ago•251 comments

French supermarket's Christmas advert is worldwide hit (without AI) [video]

https://www.youtube.com/watch?v=Na9VmMNJvsA
210•gbugniot•12h ago•120 comments

EFF launches Age Verification Hub

https://www.eff.org/press/releases/eff-launches-age-verification-hub-resource-against-misguided-laws
231•iamnothere•1d ago•209 comments

Launch HN: BrowserBook (YC F24) – IDE for deterministic browser automation

60•cschlaepfer•10h ago•32 comments

RFC 6677 DNS Transport over TCP – Implementation Requirements (2016)

https://www.ietf.org/rfc/rfc7766.txt
15•1vuio0pswjnm7•4h ago•14 comments

iPhone Typos? It's Not Just You – The iOS Keyboard Is Broken [video]

https://www.youtube.com/watch?v=hksVvXONrIo
467•walterbell•10h ago•325 comments

Going Through Snowden Documents, Part 1

https://libroot.org/posts/going-through-snowden-documents-part-1/
190•libroot•6h ago•114 comments

Golang optimizations for high‑volume services

https://packagemain.tech/p/golang-optimizations-for-highvolume
43•der_gopher•3d ago•9 comments

Prove It All Night: With no fame or fortune, what keeps a band onstage? (1999)

https://chicagoreader.com/news/prove-it-all-night/
58•NaOH•1w ago•21 comments

An Orbital House of Cards: Frequent Megaconstellation Close Conjunctions

https://arxiv.org/abs/2512.09643
77•rapnie•10h ago•43 comments

You gotta push if you wanna pull

https://www.morling.dev/blog/you-gotta-push-if-you-wanna-pull/
9•ingve•3d ago•5 comments

Helldivers 2 on-disk size 85% reduction

https://store.steampowered.com/news/app/553850/view/491583942944621371
252•SergeAx•1w ago•264 comments