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

Comments

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

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

Multiprocessing all the way!

emmelaich•7mo ago
(2021)

Good article!

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

Using LLMs at Oxide

https://rfd.shared.oxide.computer/rfd/0576
369•steveklabnik•8h ago•151 comments

Kilauea erupts, destroying webcam [video]

https://www.youtube.com/watch?v=TK2N99BDw7A
323•zdw•10h ago•73 comments

Z2 – Lithographically fabricated IC in a garage fab

https://sam.zeloof.xyz/second-ic/
157•embedding-shape•6h ago•26 comments

Screenshots from developers: 2002 vs. 2015 (2015)

https://anders.unix.se/2015/12/10/screenshots-from-developers--2002-vs.-2015/
283•turrini•11h ago•103 comments

GrapheneOS is the only Android OS providing full security patches

https://grapheneos.social/@GrapheneOS/115647408229616018
587•akyuu•19h ago•262 comments

Eurydice: a Rust to C compiler (yes)

https://jonathan.protzenko.fr/2025/10/28/eurydice.html
88•todsacerdoti•8h ago•33 comments

Discovering the indieweb with calm tech

https://alexsci.com/blog/calm-tech-discover/
73•todsacerdoti•6h ago•8 comments

The past was not that cute

https://juliawise.net/the-past-was-not-that-cute/
169•mhb•11h ago•211 comments

Tiny Core Linux: a 23 MB Linux distro with graphical desktop

http://www.tinycorelinux.net/
427•LorenDB•19h ago•191 comments

Perl's decline was cultural

https://www.beatworm.co.uk/blog/computers/perls-decline-was-cultural-not-technical
250•todsacerdoti•16h ago•311 comments

Z-Image: Powerful and highly efficient image generation model with 6B parameters

https://github.com/Tongyi-MAI/Z-Image
297•doener•6d ago•119 comments

Zebra-Llama – Towards efficient hybrid models

https://arxiv.org/abs/2505.17272
97•mirrir•13h ago•46 comments

What even is "literate programming"?

https://pqnelson.github.io/2024/05/29/literate-programming.html
8•joecobb•4d ago•3 comments

Why does the Salish Sea glow in the dark?

https://www.atlasobscura.com/articles/untold-earth-105-salish-sea-bioluminescence
16•prismatic•2d ago•6 comments

United States Antarctic Program Field Manual (2024) [pdf]

https://www.usap.gov/usapgov/travelAndDeployment/documents/Continental-Field-Manual-2024.pdf
91•SheinhardtWigCo•11h ago•17 comments

'Vampire Squid from Hell' Reveals the Ancient Origins of Octopuses

https://www.sciencealert.com/vampire-squid-from-hell-reveals-the-ancient-origins-of-octopuses
22•6LLvveMx2koXfwn•5d ago•1 comments

HTML as an Accessible Format for Papers (2023)

https://info.arxiv.org/about/accessible_HTML.html
232•el3ctron•18h ago•113 comments

OMSCS Open Courseware

https://sites.gatech.edu/omscsopencourseware/
176•kerim-ca•14h ago•70 comments

Bikeshedding, or why I want to build a laptop

https://geohot.github.io//blog/jekyll/update/2025/11/29/bikeshedding-or-laptop.html
113•cspags•6d ago•102 comments

Saving Japan's exceptionally rare 'snow monsters'

https://www.bbc.com/future/article/20251203-japans-disappearing-snow-monsters
78•1659447091•10h ago•7 comments

Recreating the lost SDK for a 42-year-old operating system: VisiCorp Visi On

https://git.sr.ht/~nkali/vision-sdk/tree/main/item/note/index.md
64•nkali•2d ago•6 comments

Autism's confusing cousins

https://www.psychiatrymargins.com/p/autisms-confusing-cousins
274•Anon84•22h ago•269 comments

Trains cancelled over fake bridge collapse image

https://www.bbc.com/news/articles/cwygqqll9k2o
175•josephcsible•9h ago•129 comments

Oblast: A better Blasto game for the Commodore 64

http://oldvcr.blogspot.com/2025/12/oblast-better-blasto-game-for-commodore.html
20•todsacerdoti•7h ago•5 comments

Coffee linked to slower biological ageing among those with severe mental illness

https://www.kcl.ac.uk/news/coffee-linked-to-slower-biological-ageing-among-those-with-severe-ment...
148•bookofjoe•12h ago•81 comments

What Is Generative UI?

https://tambo.co/blog/posts/what-is-generative-ui
30•grouchy•3d ago•31 comments

Mathematics Without Numbers (1959)

https://www.jstor.org/stable/20026529?seq=1
53•measurablefunc•5d ago•15 comments

The unexpected effectiveness of one-shot decompilation with Claude

https://blog.chrislewis.au/the-unexpected-effectiveness-of-one-shot-decompilation-with-claude/
205•knackers•1w ago•112 comments

Dhrystone

https://en.wikipedia.org/wiki/Dhrystone
21•krelian•4d ago•2 comments

Show HN: FuseCells – a handcrafted logic puzzle game with 2,500 levels

https://apps.apple.com/us/app/fusecells-logic-grid-puzzle/id6754704139
29•keini•9h ago•15 comments