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.

EEG shows brain can simultaneous encode two speech streams

https://journals.plos.org/plosbiology/article?id=10.1371/journal.pbio.3003876
117•giuliomagnifico•5h ago•68 comments

Kimi K3: Open Frontier Intelligence

https://www.kimi.com/blog/kimi-k3
1680•vincent_s•20h ago•989 comments

Pebble Mega Update – July 2026

https://repebble.com/blog/pebble-mega-update-july-2026
128•crazysaem•7h ago•52 comments

How Has Roman Concrete Lasted for Millennia? 1,900-Year-Old Latrine Offers Clues

https://www.smithsonianmag.com/smart-news/how-has-roman-concrete-lasted-for-millennia-a-1900-year...
136•divbzero•7h ago•104 comments

Microsoft Comic Chat is now open source

https://opensource.microsoft.com/blog/2026/07/16/microsoft-comic-chat-is-now-open-source/
697•jervant•19h ago•154 comments

Decoy Font

https://www.mixfont.com/experiments/decoy-font
572•ray__•18h ago•135 comments

An Engineer's Guide to USB Typе-С (2024)

https://www.ti.com/lit/eb/slyy228/slyy228.pdf?ts=1759892558029
184•gregsadetsky•6d ago•18 comments

LM Studio Bionic: the AI agent for open models

https://lmstudio.ai/blog/introducing-lm-studio-bionic
264•minimaxir•14h ago•93 comments

Solod: Go can be a better C

https://solod.dev
141•koeng•3d ago•80 comments

Starlink from 1984

https://nemanjatrifunovic.substack.com/p/starlink-from-1984
40•ingve•5d ago•15 comments

$100 AI Music Video: Claude Fable 5 vs. GPT-5.6 Sol

https://www.tryai.dev/blog/ai-music-video-arena-claude-vs-gpt-5.6
288•hershyb_•15h ago•384 comments

SQLite Is All You Need

https://www.dbpro.app/blog/sqlite-is-all-you-need
11•upmostly•2d ago•4 comments

NotebookLM is now Gemini Notebook

https://blog.google/innovation-and-ai/products/gemini-notebook/notebooklm-gemini-notebook/
315•xnx•19h ago•160 comments

The Little Book of Reinforcement Learning

https://github.com/alxndrTL/little-book-rl/
145•mustaphah•12h ago•18 comments

I Owe My Life to the Commodore 64

https://www.goto10retro.com/p/i-owe-my-life-to-the-commodore-64
18•ingve•1h ago•8 comments

Camera Chase Vehicle

https://transistor-man.com/gimbal_camera_rover.html
22•geerlingguy•1w ago•1 comments

Immersive Linear Algebra Book with Interactive Figures (2015)

https://immersivemath.com/ila/
235•srean•19h ago•27 comments

Detecting LLM-Generated Texts with “Classical” Machine Learning

https://blog.lyc8503.net/en/post/llm-classifier/
204•uneven9434•18h ago•147 comments

Old Icons

https://leancrew.com/all-this/2026/07/old-icons/
65•zdw•5d ago•14 comments

Helium escaping from atmosphere of nearby rocky exoplanet in a habitable zone

https://www.science.org/doi/10.1126/science.aea9708
113•anyonecancode•14h ago•35 comments

In Praise of Exhaustive Destructuring

https://antoine.vandecreme.net/blog/exhaustive-destructuring-praise/
23•avandecreme•5d ago•5 comments

Mathematics of Data Science

https://arxiv.org/abs/2607.11938
169•Anon84•14h ago•10 comments

CD sales growth outpaced vinyl in the first half of 2026

https://consequence.net/2026/07/the-cd-revival-is-getting-hard-to-ignore/
117•speckx•17h ago•127 comments

'Likweli': A new monkey species discovered in the Congo Basin

https://news.yale.edu/2026/07/15/meet-likweli-new-monkey-species-discovered-congo-basin
84•gmays•13h ago•18 comments

The human-in-the-loop is tired

https://pydantic.dev/articles/the-human-in-the-loop-is-tired
233•haritha1313•10h ago•129 comments

The LLM Critics Are Right. I Use LLMs Anyway

https://www.theocharis.dev/blog/llm-critics-are-right-i-use-llms-anyway/
237•JeremyTheo•23h ago•244 comments

How to Train a Gen AI Kick Drum Model on Your Old Linux Desktop with 6GB VRAM

https://www.zhinit.dev/blog/training-a-kick-drum-diffusion-model
139•zhinit•19h ago•67 comments

Show HN: Clx – Compile Lua to Native Executables Through C++20

https://github.com/samyeyo/clx
121•_samt_•5d ago•20 comments

Solving Santa Claus Puzzle

https://wyounas.github.io/puzzles/concurrency/2026/01/10/how-to-help-santa-claus-concurrently/
6•simplegeek•5d ago•1 comments

Goes-19 weather satellite enters Safe Hold mode

https://www.spaceweather.gov/news/goes-19-safe-hold
168•yabones•21h ago•84 comments