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.

Five frontier LLMs disagree on 67% of 1k real-world fact-check claims

https://lenz.io/research/llm-disagreement
231•kostaj•1h ago•151 comments

YouTube to automatically label AI-generated videos

https://blog.youtube/news-and-events/improving-ai-labels-viewers-creators/
1061•nopg•18h ago•639 comments

AMD pulls a bait-and-switch on Linux users with Vivado licensing changes

https://itsfoss.com/news/amd-vivado-bait-and-switch-on-linux-users/
200•teleforce•3h ago•89 comments

I think Anthropic and OpenAI have found product-market fit

https://simonwillison.net/2026/May/27/product-market-fit/
976•simonw•21h ago•1083 comments

Hallucinate – Massively Multiplayer Online Rave

https://hallucinate.site
287•stagas•10h ago•123 comments

Rapira (Рапира) – Soviet programming language interpreter

https://github.com/begoon/rapira
64•begoon•3d ago•34 comments

A Eureka machine that thinks like nature and explores what AI cannot

https://iisc.ac.in/a-eureka-machine-that-thinks-like-nature-and-explores-what-ai-cannot/
123•kunalsin9h•7h ago•34 comments

Ruby vs. Java vs. TypeScript: my experience on building a Cowork DOCX plugin

https://tanin.nanakorn.com/ruby-java-typescrip-claude-docx-plugin/
30•theanonymousone•2d ago•9 comments

SimCity 3k in 4k (2025)

https://www.thran.uk/writ/hdid/2025/12/simcity-3k-in-4k.html
417•speckx•20h ago•162 comments

I analysed 20 years of my chats

https://drobinin.com/posts/am-i-a-bad-friend/
211•valzevul•14h ago•97 comments

Commission fines Temu €200M for breaching the Digital Services Act

https://ec.europa.eu/commission/presscorner/home/en
69•MrDresden•3h ago•45 comments

What Apple and Google are doing to push notifications

https://www.jacquescorbytuech.com/writing/what-apple-and-google-are-doing-your-push-notifications
341•iamacyborg•18h ago•344 comments

Nendo's Wonderful Toru, an Electric Kettle for Alessi

https://www.core77.com/posts/143823/Nendos-Wonderful-Toru-an-Electric-Kettle-for-Alessi
11•surprisetalk•3d ago•4 comments

I'm Getting into Mesh Networks (Meshtastic, MeshCore, and Reticulum)

https://www.jonaharagon.com/posts/im-getting-into-mesh-networks-meshtastic-meshcore-and-reticulum/
256•Panda_•18h ago•101 comments

More Whimsical OEIS Sequences

https://www.jeremykun.com/shortform/2026-05-22-1528/
31•surprisetalk•1d ago•6 comments

Libwce: The entropy layer of a wavelet codec, on its own

https://yogthos.net/posts/2026-05-24-libwce.html
10•yogthos•4d ago•0 comments

Seeing Around Corners Using Smartphone-Grade Lidar

https://spectrum.ieee.org/smartphone-grade-lidar
35•marc__1•3d ago•7 comments

The Ask

https://randsinrepose.com/archives/the-ask/
101•digitallogic•2d ago•62 comments

Biff is a command line datetime Swiss army knife

https://github.com/BurntSushi/biff
74•burntsushi•11h ago•34 comments

Rust (and Slint) on a Jailbroken Kindle

https://sverre.me/blog/rust-on-kindle/
198•homarp•18h ago•29 comments

RamAIn (YC W26) Is Hiring

https://www.ycombinator.com/companies/ramain/jobs/hqvmyKN-founding-gtm-engineer
1•svee•11h ago

DuckDuckGo search saw 28% more visits after Google said people love AI mode

https://www.pcgamer.com/hardware/duckduckgos-ai-free-search-saw-nearly-28-percent-more-visits-in-...
953•HelloUsername•21h ago•455 comments

Investigating how prompt politeness affects LLM accuracy (2025)

https://arxiv.org/abs/2510.04950
99•KnuthIsGod•2d ago•113 comments

Go: Support for Generic Methods

https://github.com/golang/go/issues/77273
271•f311a•1d ago•232 comments

Warm up your MacBook (2019)

https://z3ugma.github.io/2019/11/18/warm-up-your-macbook/
101•kristianp•17h ago•102 comments

Incident with Pull Requests, Issues, Git Operations and API Requests

https://www.githubstatus.com/incidents/xy1tt3hs572m
321•maxnoe•1d ago•205 comments

A New Typst Template for Pandoc (2025)

https://imaginarytext.ca/posts/2025/typst-templates-for-pandoc/
97•ankitg12•2d ago•20 comments

Stress disrupts hippocampal integration of overlapping events, memory inference

https://www.science.org/doi/10.1126/sciadv.aea5496?user_id=66c4bf745d78644b3aa57b08
150•gmays•21h ago•22 comments

Google employee charged with $1M Polymarket insider trading bet on search term

https://www.cnbc.com/2026/05/27/google-employee-polymarket-insider-trading.html
259•pseudolus•13h ago•158 comments

Zero Lines Maze: What the 8-Bit Guy's One-Liner Can Still Teach Us

https://retrogamecoders.com/zero-lines-maze/
59•ibobev•2d ago•22 comments