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
24•steveklabnik•25m ago•2 comments

Screenshots from developers: 2002 vs. 2015 (2015)

https://anders.unix.se/2015/12/10/screenshots-from-developers--2002-vs.-2015/
147•turrini•3h ago•51 comments

Trains cancelled over fake bridge collapse image

https://www.bbc.com/news/articles/cwygqqll9k2o
40•josephcsible•1h ago•12 comments

Kilauea erupts, destroying webcam [video]

https://www.youtube.com/watch?v=TK2N99BDw7A
88•zdw•2h ago•16 comments

GrapheneOS is the only Android OS providing full security patches

https://grapheneos.social/@GrapheneOS/115647408229616018
463•akyuu•11h ago•193 comments

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

https://www.usap.gov/usapgov/travelAndDeployment/documents/Continental-Field-Manual-2024.pdf
38•SheinhardtWigCo•3h ago•5 comments

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

http://www.tinycorelinux.net/
354•LorenDB•11h ago•165 comments

Zebra-Llama: Towards Efficient Hybrid Models

https://arxiv.org/abs/2505.17272
76•mirrir•5h ago•35 comments

Saving Japan's exceptionally rare 'snow monsters'

https://www.bbc.com/future/article/20251203-japans-disappearing-snow-monsters
26•1659447091•2h ago•0 comments

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

https://apps.apple.com/us/app/fusecells-logic-grid-puzzle/id6754704139
16•keini•1h ago•5 comments

OMSCS Open Courseware

https://sites.gatech.edu/omscsopencourseware/
129•kerim-ca•6h ago•44 comments

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

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

PatchworkOS: An OS for x86_64, built from scratch in C and assembly

https://github.com/KaiNorberg/PatchworkOS
19•pykello•2h ago•1 comments

HTML as an Accessible Format for Papers

https://info.arxiv.org/about/accessible_HTML.html
201•el3ctron•10h ago•107 comments

Bikeshedding, or why I want to build a laptop

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

Catala – Law to Code

https://catala-lang.org
33•Grognak•3h ago•11 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...
89•bookofjoe•4h ago•55 comments

Mathematics Without Numbers (1959)

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

OpenTelemetry Distribution Builder

https://github.com/observIQ/otel-distro-builder
8•pveierland•2h ago•1 comments

Autism's confusing cousins

https://www.psychiatrymargins.com/p/autisms-confusing-cousins
220•Anon84•14h ago•237 comments

Mirror_bridge – C++ reflection for generating Python/JS/Lua bindings

https://chico.dev/Mirror-Bridge/
23•fthiesen•2d ago•9 comments

Infisical (YC W23) Is Hiring Engineers to Build the Modern OSS Security Stack

https://www.ycombinator.com/companies/infisical/jobs/2pwGcK9-senior-full-stack-engineer-us-canada
1•vmatsiiako•8h ago

Show HN: Tascli, a command line based (human) task and record manager

https://github.com/Aperocky/tascli
23•Aperocky•4h ago•12 comments

Touching the Elephant – TPUs

https://considerthebulldog.com/tte-tpu/
157•giuliomagnifico•13h ago•44 comments

Finding Gene Cernan's Missing Moon Camera

https://www.spacecamera.co/articles/2020/3/3/gene-cernans-missing-lunar-surface-camera
65•theodorespeaks•4d ago•6 comments

Abstract Interpretation in the Toy Optimizer

https://bernsteinbear.com/blog/toy-abstract-interpretation/
32•ChadNauseam•2d ago•6 comments

Wave of (Open Street Map) Vandalism in South Korea

https://www.openstreetmap.org/user/KennyDap/diary/407844
53•shortrounddev2•3h ago•4 comments

The unexpected effectiveness of one-shot decompilation with Claude

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

Magnitude-7.0 earthquake hits in remote wilderness along Alaska-Canada border

https://apnews.com/article/earthquake-alaska-canada-yukon-7c0f68370e387b1b23fa7fe7fc9c2c71
12•appreciatorBus•1h ago•2 comments

Term-keys – Lossless keyboard input for Emacs

https://github.com/CyberShadow/term-keys
18•harryday•6d ago•4 comments