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.

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

https://twitter.com/jarredsumner/status/2053047748191232310
372•heldrida•14h ago•363 comments

Rust but Lisp

https://github.com/ThatXliner/rust-but-lisp
47•thatxliner•2h ago•22 comments

Internet Archive Switzerland

https://blog.archive.org/2026/05/06/internet-archive-switzerland-expanding-a-global-mission-to-pr...
514•hggh•12h ago•76 comments

The Serial TTL connector we deserve

https://kohlschuetter.github.io/blog/posts/2026/05/07/serial-ttl-connector/
25•kohlschuetter•2d ago•22 comments

I’ve banned query strings

https://chrismorgan.info/no-query-strings
245•susam•8h ago•132 comments

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

https://github.com/nooga/let-go
77•marcingas•6h ago•19 comments

Local privilege escalation via execve()

https://www.freebsd.org/security/advisories/FreeBSD-SA-26:13.exec.asc
68•Deeg9rie9usi•4h ago•53 comments

Zed Editor Theme-Builder

https://zed.dev/theme-builder
144•cuechan•7h 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
32•ibobev•2d ago•7 comments

CPanel's Black Week: 3 New Vulnerabilities Patched After Attack on 44k Servers

https://www.copahost.com/blog/cpanels-black-week-three-new-vulnerabilities-patched-after-ransomwa...
102•ggallas•7h ago•55 comments

Production engineering when trading billions of dollars a day [video]

https://www.youtube.com/watch?v=zR9PpXWsKFQ
81•abstrus•1d ago•20 comments

Distributing Mac software is increasing my cortisol levels

https://blog.kronis.dev/blog/apple-is-increasing-my-cortisol-levels
183•LorenDB•9h ago•116 comments

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

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

LLMs corrupt your documents when you delegate

https://arxiv.org/abs/2604.15597
339•rbanffy•15h ago•130 comments

A recent experience with ChatGPT 5.5 Pro

https://gowers.wordpress.com/2026/05/08/a-recent-experience-with-chatgpt-5-5-pro/
593•_alternator_•21h ago•420 comments

Meta's embrace of A.I. is making its employees miserable

https://www.nytimes.com/2026/05/08/technology/meta-ai-employees-miserable.html
246•JumpCrisscross•5h ago•224 comments

The hypocrisy of cyberlibertarianism

https://matduggan.com/the-intolerable-hypocrisy-of-cyberlibertarianism/
248•ColinWright•10h ago•201 comments

EU Parliamentary Research Service calls VPNs "a loophole that needs closing"

https://cyberinsider.com/eu-calls-vpns-a-loophole-that-needs-closing-in-age-verification-push/
371•muse900•18h ago•268 comments

France Moves to Break Encrypted Messaging

https://reclaimthenet.org/france-moves-to-break-encrypted-messaging
40•Cider9986•2h ago•11 comments

I caught the car

https://undecidability.net/senior/
36•holden_nelson•4h ago•30 comments

Surfel-based global illumination on the web

https://juretriglav.si/surfel-based-global-illumination-on-the-web/
6•vmg12•5h ago•0 comments

Using Claude Code: The unreasonable effectiveness of HTML

https://twitter.com/trq212/status/2052809885763747935
407•pretext•19h ago•234 comments

Getting arrested in Japan

https://sundaicity.com/blogs/getting-arrested-in-japan
113•bane•2h ago•110 comments

Random tie knots (2014)

https://tieknots.how/
10•surprisetalk•3d ago•1 comments

PipeDream on the Acorn Archimedes

https://stonetools.ghost.io/pipedream-archimedes/
73•msephton•9h ago•36 comments

OpenAI’s WebRTC problem

https://moq.dev/blog/webrtc-is-the-problem/
468•atgctg•2d ago•140 comments

Mythical Man Month

https://martinfowler.com/bliki/MythicalManMonth.html
343•ingve•2d ago•190 comments

Forking the Web

https://dillo-browser.org/lab/web-fork/
104•wrxd•12h ago•110 comments

The ROKR wooden typewriter: a closer look

http://writingball.blogspot.com/2026/05/the-rokr-wooden-typewriter-closer-look.html
28•speckx•2d ago•3 comments

All my clients wanted a carousel, now it's an AI chatbot

https://adele.pages.casa/md/blog/all-my-clients-wanted-a-carousel-now-it-s-an-ai-chatbot.md
169•edent•17h ago•69 comments