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•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.

Postmortem: TanStack npm supply-chain compromise

https://tanstack.com/blog/npm-supply-chain-compromise-postmortem
570•varunsharma07•5h ago•213 comments

Claude Platform on AWS

https://claude.com/blog/claude-platform-on-aws
19•matrixhelix•1h ago•5 comments

If AI writes your code, why use Python?

https://medium.com/@NMitchem/if-ai-writes-your-code-why-use-python-bf8c4ba1a055
200•indigodaddy•6h ago•220 comments

UCLA discovers first stroke rehabilitation drug to repair brain damage (2025)

https://stemcell.ucla.edu/news/ucla-discovers-first-stroke-rehabilitation-drug-repair-brain-damage
250•bookofjoe•8h ago•49 comments

Show HN: A modern Music Player Daemon based on Rockbox firmware

https://github.com/tsirysndr/rockbox-zig
21•tsiry•2d ago•1 comments

Library for fast mapping of Java records to native memory

https://github.com/mamba-studio/TypedMemory
111•joe_mwangi•7h ago•25 comments

I let AI build a tool to help me figure out what was waking me up at night

https://martin.sh/i-let-ai-build-a-tool-to-help-me-figure-out-what-was-waking-me-up-at-night/
79•showmypost•5h ago•92 comments

Ratty – A terminal emulator with inline 3D graphics

https://ratty-term.org/
616•orhunp_•16h ago•203 comments

Nullsoft, 1997-2004 (2004)

https://slate.com/technology/2004/11/the-death-of-the-last-maverick-tech-company.html
232•downbad_•3d ago•70 comments

GitLab announces workforce reduction and end of their CREDIT values

https://about.gitlab.com/blog/gitlab-act-2/
347•AnonGitLabEmpl•5h ago•340 comments

Gmail registration now requires scanning a QR code and sending a text message

https://discuss.privacyguides.net/t/google-account-registration-now-requires-sending-an-sms-via-p...
575•negura•19h ago•427 comments

Fake building: Claude wrote 3k lines instead of import pywikibot

https://fireflysentinel.github.io/posts/fake-building-claude-3000-lines/
3•firef1y1203•29m ago•0 comments

Griffin PowerMate driver for modern macOS

https://github.com/jameslockman/Griffin-PowerMate-Driver
48•classichasclass•5h ago•17 comments

Google says criminal hackers used AI to find a major software flaw

https://www.nytimes.com/2026/05/11/us/politics/google-hackers-attack-ai.html
123•donohoe•13h ago•100 comments

A lost ancient script reveals how writing as we know it began

https://www.newscientist.com/article/2524042-a-lost-ancient-script-reveals-how-writing-as-we-know...
5•emot•4d ago•0 comments

Interaction Models

https://thinkingmachines.ai/blog/interaction-models/
105•smhx•5h ago•9 comments

Silverback Imfura took a chance, and ended up alone

https://gorillafund.org/mountain-gorillas/silverback-imfura-took-a-chance-and-ended-up-alone/
38•alex000kim•2d ago•12 comments

Training an LLM in Swift, Part 1: Taking matrix mult from Gflop/s to Tflop/s

https://www.cocoawithlove.com/blog/matrix-multiplications-swift.html
220•zdw•1d ago•11 comments

Interfaze: A new model architecture built for high accuracy at scale

https://interfaze.ai/blog/interfaze-a-new-model-architecture-built-for-high-accuracy-at-scale
115•yoeven•10h ago•30 comments

The rise and fall of snake oil

https://www.historytoday.com/archive/history-matters/rise-and-fall-snake-oil
32•samizdis•4d ago•20 comments

AMÁLIA and the future of European Portuguese LLMs

https://duarteocarmo.com/blog/amalia-and-the-future-of-european-portuguese-llms
119•johnbarron•3d ago•57 comments

Bild AI (YC W25) Is Hiring Founding Product Engineers

https://bild.ai/jobs
1•rooppal•9h ago

Show HN: OpenGravity – A zero-install, BYOK vanilla JS clone of Antigravity

https://github.com/ab-613/opengravity
55•ab613•6h ago•18 comments

Abstract Machines for Logic Programs

https://chrisistyping.bearblog.dev/abstract-machines-for-logic-programs/
19•surprisetalk•2d ago•1 comments

CUDA-oxide: Nvidia's official Rust to CUDA compiler

https://nvlabs.github.io/cuda-oxide/index.html
368•adamnemecek•10h ago•107 comments

Building a web server in aarch64 assembly to give my life (a lack of) meaning

https://imtomt.github.io/ymawky/
106•theanonymousone•3d ago•34 comments

The Boston library where you still can borrow a giant puppet

https://binj.news/2026/05/06/the-boston-library-where-you-still-can-borrow-a-giant-puppet/
55•gnabgib•3d ago•8 comments

Hardware Attestation as Monopoly Enabler

https://grapheneos.social/@GrapheneOS/116550899908879585
2089•ChuckMcM•1d ago•706 comments

They Live (1988) inspired Adblocker

https://github.com/davmlaw/they_live_adblocker
4•tokenburner•2h ago•0 comments

Show HN: E2a – Open-source email gateway for AI agents

https://github.com/Mnexa-AI/e2a
24•mnexa•6h ago•2 comments