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

Comments

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

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

Multiprocessing all the way!

emmelaich•10mo ago
(2021)

Good article!

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

Flash-MoE: Running a 397B Parameter Model on a Laptop

https://github.com/danveloper/flash-moe
201•mft_•5h ago•69 comments

The Future of Version Control

https://bramcohen.com/p/manyana
47•c17r•2h ago•20 comments

Project Nomad – Knowledge That Never Goes Offline

https://www.projectnomad.us
173•jensgk•4h ago•28 comments

Building an FPGA 3dfx Voodoo with Modern RTL Tools

https://noquiche.fyi/voodoo
82•fayalalebrun•3h ago•15 comments

You are not your job

https://jry.io/writing/you-are-not-your-job/
28•jryio•1h ago•18 comments

Reports of code's death are greatly exaggerated

https://stevekrouse.com/precision
13•stevekrouse•6h ago•2 comments

More common mistakes to avoid when creating system architecture diagrams

https://www.ilograph.com/blog/posts/more-common-diagram-mistakes/
72•billyp-rva•5h ago•28 comments

Windows native app development is a mess

https://domenic.me/windows-native-dev/
134•domenicd•7h ago•124 comments

A review of dice that came with the white castle

https://boardgamegeek.com/thread/3533812/a-review-of-dice-that-came-with-the-white-castle
81•doener•3d ago•17 comments

Brute-forcing my algorithmic ignorance with an LLM in 7 days

http://blog.dominikrudnik.pl/my-google-recruitment-journey-part-1
52•qikcik•4h ago•30 comments

A case against currying

https://emi-h.com/articles/a-case-against-currying.html
49•emih•4h ago•62 comments

25 Years of Eggs

https://www.john-rush.com/posts/eggs-25-years-20260219.html
167•avyfain•4d ago•53 comments

Cloudflare flags archive.today as "C&C/Botnet"; no longer resolves via 1.1.1.2

https://radar.cloudflare.com/domains/domain/archive.today
250•winkelmann•13h ago•206 comments

I hate: Programming Wayland applications

https://www.p4m.dev/posts/29/index.html
109•dwdz•2h ago•76 comments

The IBM scientist who rewrote the rules of information just won a Turing Award

https://www.ibm.com/think/news/ibm-scientist-charles-bennett-turing-award
33•rbanffy•5h ago•4 comments

Why Lab Coats Turned White

https://www.asimov.press/p/lab-coat
37•mailyk•3d ago•23 comments

My first patch to the Linux kernel

https://pooladkhay.com/posts/first-kernel-patch/
177•pooladkhay•2d ago•35 comments

iBook Clamshell

https://www.ibook-clamshell.com/index.php/en/
45•polishdude20•2h ago•31 comments

Node.js worker threads are problematic, but they work great for us

https://www.inngest.com/blog/node-worker-threads
43•goodoldneon•4d ago•21 comments

Tinybox – A powerful computer for deep learning

https://tinygrad.org/#tinybox
556•albelfio•21h ago•323 comments

The three pillars of JavaScript bloat

https://43081j.com/2026/03/three-pillars-of-javascript-bloat
414•onlyspaceghost•15h ago•242 comments

Bored of eating your own dogfood? Try smelling your own farts

https://shkspr.mobi/blog/2026/03/bored-of-eating-your-own-dogfood-try-smelling-your-own-farts/
236•ColinWright•4h ago•143 comments

Monuses and Heaps

https://doisinkidney.com/posts/2026-03-03-monus-heaps.html
36•aebtebeten•3d ago•2 comments

A Fuzzer for the Toy Optimizer

https://bernsteinbear.com/blog/toy-fuzzer/
27•surprisetalk•5d ago•5 comments

Professional video editing, right in the browser with WebGPU and WASM

https://tooscut.app/
332•mohebifar•19h ago•119 comments

How We Synchronized Editing for Rec Room's Multiplayer Scripting System

https://www.tyleo.com/blog/how-we-synchronized-editing-for-rec-rooms-multiplayer-scripting-system
15•tyleo•5h ago•11 comments

Chest Fridge (2009)

https://mtbest.net/chest-fridge/
165•wolfi1•16h ago•88 comments

HopTab – Open source macOS app switcher and tiler that replaces Cmd+Tab

https://www.royalbhati.com/hoptab
91•robhati•10h ago•28 comments

Ask HN: AI productivity gains – do you fire devs or build better products?

39•Bleiglanz•7h ago•66 comments

Floci – A free, open-source local AWS emulator

https://github.com/hectorvent/floci
255•shaicoleman•19h ago•86 comments