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

Comments

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

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

Multiprocessing all the way!

emmelaich•8mo ago
(2021)

Good article!

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

The struggle of resizing windows on macOS Tahoe

https://noheger.at/blog/2026/01/11/the-struggle-of-resizing-windows-on-macos-tahoe/
1519•happosai•11h ago•617 comments

CLI agents make self-hosting on a home server easier and fun

https://fulghum.io/self-hosting
479•websku•10h ago•304 comments

JRR Tolkien reads from The Hobbit for 30 Minutes (1952)

https://www.openculture.com/2026/01/j-r-r-tolkien-reads-from-the-hobbit-for-30-minutes-1952.html
46•bookofjoe•4d ago•3 comments

Himalayas bare and rocky after reduced winter snowfall, scientists warn

https://www.bbc.com/news/articles/clyndv7zd20o
85•koolhead17•5h ago•40 comments

39c3: In-house electronics manufacturing from scratch: How hard can it be? [video]

https://media.ccc.de/v/39c3-in-house-electronics-manufacturing-from-scratch-how-hard-can-it-be
58•fried-gluttony•2d ago•7 comments

This game is a single 13 KiB file that runs on Windows, Linux and in the Browser

https://iczelia.net/posts/snake-polyglot/
170•snoofydude•10h ago•49 comments

Don't fall into the anti-AI hype

https://antirez.com/news/158
918•todsacerdoti•21h ago•1088 comments

iCloud Photos Downloader

https://github.com/icloud-photos-downloader/icloud_photos_downloader
416•reconnecting•13h ago•186 comments

Xfce is great

https://rubenerd.com/xfce-is-great/
158•mikece•3h ago•104 comments

I'm making a game engine based on dynamic signed distance fields (SDFs) [video]

https://www.youtube.com/watch?v=il-TXbn5iMA
285•imagiro•3d ago•35 comments

Sampling at negative temperature

https://cavendishlabs.org/blog/negative-temperature/
153•ag8•12h ago•46 comments

The next two years of software engineering

https://addyosmani.com/blog/next-two-years/
115•napolux•10h ago•69 comments

FUSE is All You Need – Giving agents access to anything via filesystems

https://jakobemmerling.de/posts/fuse-is-all-you-need/
117•jakobem•11h ago•49 comments

Uncrossy

https://uncrossy.com/
51•dgacmu•6h ago•18 comments

Gadget Exposed a Spy Camera [video]

https://www.youtube.com/watch?v=1reman2waLs
36•rib3ye•8h ago•19 comments

Perfectly Replicating Coca Cola [video]

https://www.youtube.com/watch?v=TDkH3EbWTYc
195•HansVanEijsden•3d ago•134 comments

Conbini Wars – map of Japanese convenience store ratios

https://conbini.kikkia.dev/
10•zdw•5d ago•0 comments

Insights into Claude Opus 4.5 from Pokémon

https://www.lesswrong.com/posts/u6Lacc7wx4yYkBQ3r/insights-into-claude-opus-4-5-from-pokemon
65•surprisetalk•5d ago•13 comments

Garbage collection is contrarian

https://trynova.dev/blog/garbage-collection-is-contrarian
37•aapoalas•2d ago•1 comments

Ask HN: What are you working on? (January 2026)

186•david927•15h ago•576 comments

Elo – A data expression language which compiles to JavaScript, Ruby, and SQL

https://elo-lang.org/
73•ravenical•4d ago•11 comments

Show HN: An LLM-optimized programming language

https://github.com/ImJasonH/ImJasonH/blob/main/articles/llm-programming-language.md
28•ImJasonH•5h ago•13 comments

A set of Idiomatic prod-grade katas for experienced devs transitioning to Go

https://github.com/MedUnes/go-kata
123•medunes•4d ago•20 comments

Poison Fountain

https://rnsaffn.com/poison3/
194•atomic128•15h ago•118 comments

Erich von Däniken has died

https://daniken.com/en/startseite-english/
72•Kaibeezy•13h ago•113 comments

Which programming languages are most token-efficient?

https://martinalderson.com/posts/which-programming-languages-are-most-token-efficient/
83•tehnub•6h ago•53 comments

Show HN: Engineering Schizophrenia: Trusting yourself through Byzantine faults

69•rescrv•10h ago•10 comments

Moving Scratch generation to Python on browser

https://kushaldas.in/posts/introducing-ektupy.html
33•kushaldas•2d ago•9 comments

I Cannot SSH into My Server Anymore (and That's Fine)

https://soap.coffee/~lthms/posts/i-cannot-ssh-into-my-server-anymore.html
104•TheWiggles•4d ago•82 comments

Code and Let Live

https://fly.io/blog/code-and-let-live/
449•usrme•2d ago•171 comments