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.

Space Cadet Pinball on Linux

https://brennan.io/2026/05/09/pinball-and-escrow/
66•jandeboevrie•1h ago•17 comments

I returned to AWS, and was reminded why I left

http://fourlightyears.blogspot.com/2026/05/i-returned-to-aws-and-was-reminded-hard.html
48•andrewstuart•1d ago•14 comments

Idempotency Is Easy Until the Second Request Is Different

https://blog.dochia.dev/blog/idempotency/
126•ludovicianul•3d ago•59 comments

Bun's experimental Rust rewrite hits 99.8% test compatibility on Linux x64 glibc

https://twitter.com/jarredsumner/status/2053047748191232310
608•heldrida•1d ago•584 comments

The One Dollar Counterfeiter

https://www.amusingplanet.com/2026/05/emerich-juettner-one-dollar.html
188•cainxinth•3d ago•62 comments

Show HN: Building a web server in assembly to give my life (a lack of) meaning

https://github.com/imtomt/ymawky
318•imtomt•9h ago•148 comments

Casio S100X Japanese Lacquer Edition (JP Page Only)

https://www.casio.com/jp/basic-calculators/premium/en-s100x-jc1-u/
180•dr_kiszonka•3d ago•78 comments

9 Mothers (YC P26) Is Hiring

https://jobs.ashbyhq.com/9-mothers?utm_source=x8pZ4B3P3Q
1•ukd1•48m ago

Internet Archive Switzerland

https://blog.archive.org/2026/05/06/internet-archive-switzerland-expanding-a-global-mission-to-pr...
633•hggh•1d ago•104 comments

Gemini API File Search is now multimodal

https://blog.google/innovation-and-ai/technology/developers-tools/expanded-gemini-api-file-search...
119•gmays•9h ago•20 comments

We see something that works, and then we understand it

https://lemire.me/blog/2025/12/04/we-see-something-that-works-and-then-we-understand-it/
126•surprisetalk•3d ago•44 comments

I’ve banned query strings

https://chrismorgan.info/no-query-strings
450•susam•20h ago•236 comments

Replacing a 3 GB SQLite db with a 10 MB FST (finite state transducer) binary

https://til.andrew-quinn.me/posts/replacing-a-3-gb-sqlite-database-with-a-7-mb-fst-finite-state-t...
47•hiAndrewQuinn•2h ago•5 comments

Think Linear Algebra (2023)

https://allendowney.github.io/ThinkLinearAlgebra/index.html
12•tamnd•3h ago•0 comments

Debian must ship reproducible packages

https://lists.debian.org/debian-devel-announce/2026/05/msg00001.html
221•robalni•7h ago•80 comments

Local privilege escalation via execve()

https://www.freebsd.org/security/advisories/FreeBSD-SA-26:13.exec.asc
173•Deeg9rie9usi•16h ago•82 comments

Zed Editor Theme-Builder

https://zed.dev/theme-builder
243•cuechan•19h ago•71 comments

Distributing Mac software is increasing my cortisol levels

https://blog.kronis.dev/blog/apple-is-increasing-my-cortisol-levels
328•LorenDB•22h ago•223 comments

A recent experience with ChatGPT 5.5 Pro

https://gowers.wordpress.com/2026/05/08/a-recent-experience-with-chatgpt-5-5-pro/
649•_alternator_•1d ago•476 comments

LLMs corrupt your documents when you delegate

https://arxiv.org/abs/2604.15597
432•rbanffy•1d ago•170 comments

Show HN: I made a Clojure-like language in Go, boots in 7ms

https://github.com/nooga/let-go
195•marcingas•18h ago•55 comments

I'm writing a history of Visual Basic, Chapter 1 is up

https://evilgeniuslabs.ca/blog/visual-basic-history-chapter-1-launch
121•speckx•3d ago•43 comments

Making your own programming language is easier than you think (but also harder)

https://lisyarus.github.io/blog/posts/making-your-own-programming-language.html
112•ibobev•2d ago•57 comments

Show HN: Rust but Lisp

https://github.com/ThatXliner/rust-but-lisp
151•thatxliner•15h ago•68 comments

From Buffon's Needle to Buffon's Noodle

https://mbmccoy.dev/posts/buffons-noodle/
9•_alternator_•2d ago•2 comments

The hypocrisy of cyberlibertarianism

https://matduggan.com/the-intolerable-hypocrisy-of-cyberlibertarianism/
357•ColinWright•22h ago•316 comments

LLMorphism: When humans come to see themselves as language models

https://arxiv.org/abs/2605.05419
26•okey•4h ago•13 comments

Task Paralysis and AI

https://g5t.de/articles/20260510-task-paralysis-and-ai/index.html
47•MrGilbert•6h ago•41 comments

Using Claude Code: The unreasonable effectiveness of HTML

https://twitter.com/trq212/status/2052809885763747935
476•pretext•1d ago•262 comments

The first microcomputer: The transfluxor-powered Arma Micro Computer from 1962

https://www.righto.com/2024/02/the-first-microcomputer-transfluxor.html
64•rsecora•3d ago•3 comments