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

Comments

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

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

Multiprocessing all the way!

emmelaich•11mo ago
(2021)

Good article!

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

SideX – A Tauri-based port of Visual Studio Code

https://github.com/Sidenai/sidex
39•0x1997•47m ago•22 comments

Show HN: I built a tiny LLM to demystify how language models work

https://github.com/arman-bd/guppylm
346•armanified•7h ago•31 comments

Gemma 4 on iPhone

https://apps.apple.com/nl/app/google-ai-edge-gallery/id6749645337
581•janandonly•12h ago•153 comments

An open-source 240-antenna array to bounce signals off the Moon

https://moonrf.com/
68•hillcrestenigma•4h ago•12 comments

Microsoft hasn't had a coherent GUI strategy since Petzold

https://www.jsnover.com/blog/2026/03/13/microsoft-hasnt-had-a-coherent-gui-strategy-since-petzold/
373•naves•14h ago•215 comments

Show HN: Real-time AI (audio/video in, voice out) on an M3 Pro with Gemma E2B

https://github.com/fikrikarim/parlor
52•karimf•13h ago•2 comments

Show HN: I made a YouTube search form with advanced filters

https://playlists.at/youtube/search/
202•nevernothing•7h ago•126 comments

The 1987 game “The Last Ninja” was 40 kilobytes

https://twitter.com/exQUIZitely/status/2040777977521398151
65•keepamovin•4h ago•23 comments

LÖVE: 2D Game Framework for Lua

https://github.com/love2d/love
280•cl3misch•1d ago•110 comments

Signals, the push-pull based algorithm

https://willybrauner.com/journal/signal-the-push-pull-based-algorithm
23•mpweiher•1d ago•3 comments

Show HN: Gemma Gem – AI model embedded in a browser – no API keys, no cloud

https://github.com/kessler/gemma-gem
59•ikessler•7h ago•11 comments

Why Switzerland has 25 Gbit internet and America doesn't

https://sschueller.github.io/posts/the-free-market-lie/
419•sschueller•13h ago•313 comments

Case study: recovery of a corrupted 12 TB multi-device pool

https://github.com/kdave/btrfs-progs/issues/1107
46•salt4034•5h ago•11 comments

Running Gemma 4 locally with LM Studio's new headless CLI and Claude Code

https://ai.georgeliu.com/p/running-google-gemma-4-locally-with
252•vbtechguy•14h ago•59 comments

Winners of the 2026 Kokuyo Design Awards

https://spoon-tamago.com/winners-of-the-2026-kokuyo-design-awards/
42•zdw•4h ago•6 comments

Sheets Spreadsheets in Your Terminal

https://github.com/maaslalani/sheets
45•_____k•2d ago•8 comments

We replaced Node.js with Bun for 5x throughput

https://trigger.dev/blog/firebun
49•pier25•5h ago•22 comments

Show HN: Modo – I built an open-source alternative to Kiro, Cursor, and Windsurf

https://github.com/mohshomis/modo
40•mohshomis•7h ago•8 comments

Employers use your personal data to figure out the lowest salary you'll accept

https://www.marketwatch.com/story/employers-are-using-your-personal-data-to-figure-out-the-lowest...
173•thisislife2•7h ago•86 comments

Media scraper Gallery-dl is moving to Codeberg after receiving a DMCA notice

https://github.com/mikf/gallery-dl/discussions/9304
119•MoltenMonster•4h ago•34 comments

One ant for $220: The new frontier of wildlife trafficking

https://www.bbc.com/news/articles/cg4g44zv37qo
10•gmays•3d ago•0 comments

Usenet Archives

https://usenetarchives.com
28•myth_drannon•6h ago•4 comments

Music for Programming

https://musicforprogramming.net
164•merusame•13h ago•70 comments

A tail-call interpreter in (nightly) Rust

https://www.mattkeeter.com/blog/2026-04-05-tailcall/
154•g0xA52A2A•16h ago•33 comments

Eight years of wanting, three months of building with AI

https://lalitm.com/post/building-syntaqlite-ai/
755•brilee•18h ago•228 comments

Computational Physics (2nd Edition) (2025)

https://websites.umich.edu/~mejn/cp2/
135•teleforce•15h ago•18 comments

Artemis II crew see first glimpse of far side of Moon [video]

https://www.bbc.com/news/videos/ce3d5gkd2geo
469•mooreds•17h ago•362 comments

In Japan, the robot isn't coming for your job; it's filling the one nobody wants

https://techcrunch.com/2026/04/05/japan-is-proving-experimental-physical-ai-is-ready-for-the-real...
159•rbanffy•9h ago•187 comments

The Mechanics of Steins Gate (2023) [pdf]

https://github.com/Votuko/steins-gate-mechanics/blob/main/The%20Mechanics%20of%20Steins%20Gate%20...
74•Ariarule•9h ago•14 comments

Caveman: Why use many token when few token do trick

https://github.com/JuliusBrussee/caveman
753•tosh•22h ago•328 comments