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

Comments

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

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

Multiprocessing all the way!

emmelaich•6mo ago
(2021)

Good article!

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

System 7 natively boots on the Mac mini G4

https://macos9lives.com/smforum/index.php?topic=7711.0
214•ibobev•8h ago•38 comments

High Air Pollution Could Diminish Exercise Benefits by 50%, Study Finds

https://scienceclock.com/exercise-may-protect-less-when-air-pollution-is-high-study-finds/
11•ashishgupta2209•1h ago•1 comments

WinApps: Run Windows apps as if they were a part of the native Linux OS

https://github.com/winapps-org/winapps
179•klaussilveira•3d ago•71 comments

Airbus A320 – intense solar radiation may corrupt data critical for flight

https://www.airbus.com/en/newsroom/press-releases/2025-11-airbus-update-on-a320-family-precaution...
345•pyrophoenix•14h ago•95 comments

Belgian Police exposed using botnets to manipulate EU data law impact assessment

https://old.reddit.com/r/europe/comments/1p9kxhm/belgian_federal_police_forgot_to_turn_their_vpn/
54•saubeidl•1h ago•10 comments

Garfield's Proof of the Pythagorean Theorem

https://en.wikipedia.org/wiki/Garfield%27s_proof_of_the_Pythagorean_theorem
49•benbreen•5h ago•25 comments

Show HN: Explore what the browser exposes about you

https://neberej.github.io/exposedbydefault/
73•coffeecoders•4d ago•30 comments

Every mathematician has only a few tricks (2020)

https://mathoverflow.net/questions/363119/every-mathematician-has-only-a-few-tricks
147•nill0•10h ago•30 comments

Imgur geo-blocked the UK, so I geo-unblocked my network

https://blog.tymscar.com/posts/imgurukproxy/
412•tymscar•17h ago•141 comments

Confessions of a Software Developer: No More Self-Censorship

https://kerrick.blog/articles/2025/confessions-of-a-software-developer-no-more-self-censorship/
242•Kerrick•13h ago•209 comments

So you wanna build a local RAG?

https://blog.yakkomajuri.com/blog/local-rag
308•pedriquepacheco•19h ago•70 comments

Molly: An Improved Signal App

https://molly.im/
353•dtj1123•18h ago•207 comments

A triangle whose interior angles sum to zero

https://www.johndcook.com/blog/2025/11/28/tricusp-triangle/
113•tzury•11h ago•52 comments

I Know We're in an AI Bubble Because Nobody Wants Me

https://petewarden.com/2025/11/29/i-know-were-in-an-ai-bubble-because-nobody-wants-me-%f0%9f%98%ad/
30•iparaskev•2h ago•12 comments

Airloom – 3D Flight Tracker

https://objectiveunclear.com/airloom.html
233•azinman2•19h ago•71 comments

Show HN: Anthony Bourdain's Lost Li.st's

https://bourdain.greg.technology/
46•gregsadetsky•3d ago•16 comments

Language is primarily a tool for communication rather than thought (2024) [pdf]

https://gwern.net/doc/psychology/linguistics/2024-fedorenko.pdf
74•netfortius•21h ago•30 comments

The original ABC language, Python's predecessor (1991)

https://github.com/gvanrossum/abc-unix
109•tony•16h ago•37 comments

The risk of round numbers and sharp thresholds in clinical practice

https://www.nature.com/articles/s41746-025-02079-y
31•asplake•1w ago•7 comments

28M Hacker News comments as vector embedding search dataset

https://clickhouse.com/docs/getting-started/example-datasets/hackernews-vector-search-dataset
408•walterbell•18h ago•153 comments

Show HN: Choose your own adventure style Presentation

https://github.com/Skarlso/adventure-voter
42•skarlso•1w ago•9 comments

Electron vs. Tauri

https://www.dolthub.com/blog/2025-11-13-electron-vs-tauri/
91•birdculture•16h ago•47 comments

How stealth addresses work in Monero

https://www.johndcook.com/blog/2025/11/24/monero-stealth-addresses/
17•ibobev•4d ago•7 comments

Show HN: Mu – The Micro Network

https://github.com/asim/mu
41•asim•4d ago•23 comments

Don't tug on that, you never know what it might be attached to (2016)

https://blog.plover.com/2016/07/01/#tmpdir
128•todsacerdoti•20h ago•61 comments

I mathematically proved the best "Guess Who?" strategy [video]

https://www.youtube.com/watch?v=_3RNB8eOSx0
67•surprisetalk•6d ago•17 comments

A first look at Django's new background tasks

https://roam.be/notes/2025/a-first-look-at-djangos-new-background-tasks/
116•roam•14h ago•28 comments

Comments on "Glauert's optimum rotor disk revisited"

https://wes.copernicus.org/preprints/wes-2025-105/
3•bouchard•4d ago•1 comments

True P2P Email on Top of Yggdrasil Network

https://github.com/JB-SelfCompany/Tyr
146•basemi•19h ago•24 comments

How good engineers write bad code at big companies

https://www.seangoedecke.com/bad-code-at-big-companies/
345•gfysfm•16h ago•233 comments