frontpage.
newsnewestaskshowjobs

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.

DeepSeek V4 Flash on a Single AMD MI300X

https://github.com/ryanzhou/deepseek-v4-flash-mi300x
86•zhoutong•2h ago•18 comments

Xbox goes down. You can't play games you own on disc

https://birchtree.me/blog/xbox-goes-down-you-cant-play-games-you-own-on-disc/
38•surprisetalk•21m ago•21 comments

AI-Generated Images Discourage Me from Reading Your Blog

https://nelson.cloud/ai-generated-images-discourage-me-from-reading-your-blog/
18•meysamazad•51m ago•0 comments

Buckminster Fuller: everything I know

https://www.bfi.org/about-fuller/everything-i-know/
12•simonebrunozzi•48m ago•6 comments

LLMs reward expertise

https://www.seangoedecke.com/llms-reward-expertise/
1044•MaxMussio•15h ago•444 comments

Mini retirements: like a sabbatical, but much smaller

https://www.ssp.sh/brain/mini-retirements/
21•zazuke•1h ago•36 comments

Roame (YC S23) Is Hiring Lead Engineer

https://www.ycombinator.com/companies/roame/jobs/mqqfa38-lead-full-stack-engineer
1•zman0225•21m ago

Harness Engineering for Self-Improvement

https://lilianweng.github.io/posts/2026-07-04-harness/
96•tosh•6h ago•15 comments

Ray Bradbury's "There Will Come Soft Rains" is set today (2026-08-04)

https://short-stories.co/@raybradbury/there-will-come-soft-rains-6k8vr4xxlnmj
30•askvictor•2h ago•3 comments

Show HN: Run an 80B Qwen in 4.3 GB of RAM on a Mac, and a 35B on an iPhone

https://github.com/leonickson1/Swiftlet
217•leonickson•19h ago•99 comments

You don't need React: creating a minimal UI library in Vanilla JavaScript

https://pedroth.github.io/?p=post/NoNeedReact
85•pedro_movai•4h ago•65 comments

Cyberpunk Video Games

https://shellzine.net/cyberpunk-video-games/
30•zdw•5d ago•20 comments

Ten advances in mathematics and theoretical computer science

https://openai.com/index/ten-advances-in-mathematics/
562•milkshakes•19h ago•850 comments

Amazonian civilization had estimated 3M people in 3% of forest area

https://www.science.org/content/article/odd-shapes-hidden-dense-amazon-rainforest-reveal-sprawlin...
182•marojejian•5d ago•142 comments

FFmpeg 9.0

https://github.com/FFmpeg/FFmpeg/blob/n9.0/RELEASE_NOTES
266•gyan•2h ago•48 comments

Devtools must be open source

https://blog.exe.dev/devtools-must-be-open-source
636•bryanmikaelian•22h ago•211 comments

Show HN: Fine-tune an 8B model on a 4 GB laptop GPU

https://github.com/MakazhanAlpamys/Soup
8•MakazhanAlpamys•1h ago•1 comments

An Honest Review of AI Programming

https://mropert.github.io/2026/08/04/an_honest_review_of_ai_programming/
10•ingve•2h ago•6 comments

Why etymologies matter: How tracing words can illuminate history (2024)

https://resobscura.substack.com/p/why-i-love-etymologies
7•benbreen•3d ago•0 comments

Archaeologists Find Ancient Glyphs in the Amazon

https://www.nytimes.com/2026/07/31/world/americas/amazon-archaeology-geoglyphs.html
15•wglb•2d ago•6 comments

That time when I failed the Microsoft interview

https://ochagavia.nl/blog/that-time-when-i-failed-the-microsoft-interview/
82•wofo•6d ago•160 comments

Why Large Language Models Fail at Tabular Prediction

https://arxiv.org/abs/2608.02412
7•sbulaev•2h ago•1 comments

Nobel Disease

https://en.wikipedia.org/wiki/Nobel_disease
17•num42•1h ago•2 comments

There Will Come Soft Rains (1950) [pdf]

https://users.wpi.edu/~zrbutzke/Docs/BradburyStories(1).pdf
184•pmg101•12h ago•65 comments

Ask HN: Who is hiring? (August 2026)

194•whoishiring•21h ago•178 comments

Safe Lock-free Primitives with iceoryx2's ByteAtomic

https://ekxide.io/blog/byte-wise-atomic-wrapper-to-prevent-ub/
3•elfenpiff•1h ago•1 comments

Homebench – Benchmark local LLMs for speed, memory, and quality

https://github.com/david-g-3654/homebench
4•davai-g•2h ago•0 comments

Smaller, faster, safer: running Kimi and GLM at scale

https://blog.cloudflare.com/smaller-faster-safer-models/
230•ascorbic•19h ago•58 comments

Twenty Years of Pandoc

https://pandoc.org/twenty-years-of-pandoc.html
298•fiddlosopher•21h ago•36 comments

Beauty in my backyard

https://worksinprogress.co/issue/beauty-in-my-backyard/
34•footest•4d ago•17 comments