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.

I put all 8,642 Spanish laws in Git – every reform is a commit

https://github.com/EnriqueLop/legalize-es
477•enriquelop•4h ago•148 comments

AI chatbots are "Yes-Men" that reinforce bad relationship decisions, study finds

https://news.stanford.edu/stories/2026/03/ai-advice-sycophantic-models-research
190•oldfrenchfries•2h ago•143 comments

Britain today generating 90%+ of electricity from renewables

https://grid.iamkate.com/
304•rwmj•5h ago•197 comments

I Built an Open-World Engine for the N64 [video]

https://www.youtube.com/watch?v=lXxmIw9axWw
165•msephton•4h ago•15 comments

Cocoa-Way – Native macOS Wayland compositor for running Linux apps seamlessly

https://github.com/J-x-Z/cocoa-way
191•OJFord•6h ago•64 comments

C++26: A User-Friednly assert() macro

https://www.sandordargo.com/blog/2026/03/25/cpp26-user-friendly-assert
17•jandeboevrie•3d ago•2 comments

Folk are getting dangerously attached to AI that always tells them they're right

https://www.theregister.com/2026/03/27/sycophantic_ai_risks/
83•Brajeshwar•1h ago•43 comments

CERN uses tiny AI models burned into silicon for real-time LHC data filtering

https://theopenreader.org/Journalism:CERN_Uses_Tiny_AI_Models_Burned_into_Silicon_for_Real-Time_L...
204•TORcicada•8h ago•106 comments

I decompiled the White House's new app

https://thereallo.dev/blog/decompiling-the-white-house-app
26•amarcheschi•40m ago•9 comments

Show HN: Free, in-browser PDF editor

https://breezepdf.com/?v=2
8•philjohnson•32m ago•0 comments

Improved Git Diffs with Delta, Fzf and a Little Shell Scripting

https://nickjanetakis.com/blog/awesome-git-diffs-with-delta-fzf-and-a-little-shell-scripting
38•nickjj•4d ago•17 comments

Go hard on agents, not on your filesystem

https://jai.scs.stanford.edu/
493•mazieres•15h ago•276 comments

ICAO issued new power bank restriction on flight

https://www.icao.int/news/new-power-bank-restrictions-will-safeguard-international-aviation
10•phantomathkg•1h ago•2 comments

AMD's Ryzen 9 9950X3D2 Dual Edition crams 208MB of cache into a single chip

https://arstechnica.com/gadgets/2026/03/amds-ryzen-9-9950x3d2-dual-edition-crams-208mb-of-cache-i...
240•zdw•14h ago•123 comments

Toma (YC W24) is hiring a Senior/Staff Eng to build AI automotive coworkers

https://www.ycombinator.com/companies/toma/jobs/2lrQI7S-sr-staff-software-engineer
1•anthonykrivonos•4h ago

Paper Tape Is All You Need – Training a Transformer on a 1976 Minicomputer

https://github.com/dbrll/ATTN-11
75•rahen•3d ago•10 comments

A single-file C allocator with explicit heaps and tuning knobs

https://github.com/xtellect/spaces
38•enduku•2d ago•20 comments

The bee that everyone wants to save

https://naturalist.bearblog.dev/the-bee-that-everyone-wants-to-save/
197•nivethan•2d ago•63 comments

Gerard of Cremona

https://en.wikipedia.org/wiki/Gerard_of_Cremona
19•teleforce•2d ago•4 comments

Make macOS consistently bad unironically

https://lr0.org/blog/p/macos/
471•speckx•21h ago•327 comments

Going Founder Mode on Cancer

https://centuryofbio.com/p/sid
6•nextos•16h ago•1 comments

We built a multi-agent research hub. The waitlist is a reverse-CAPTCHA

https://enlidea.com
6•LZK•1h ago•3 comments

Go Naming Conventions: A Practical Guide

https://www.alexedwards.net/blog/go-naming-conventions
56•yurivish•3d ago•23 comments

LG's new 1Hz display is the secret behind a new laptop's battery life

https://www.pcworld.com/article/3096432/lgs-new-1hz-display-is-the-secret-behind-a-new-laptops-ba...
289•robotnikman•4d ago•147 comments

Anatomy of the .claude/ folder

https://blog.dailydoseofds.com/p/anatomy-of-the-claude-folder
550•freedomben•1d ago•236 comments

The risk of AI isn't making us lazy, but making "lazy" look productive

13•acmerfight•1h ago•15 comments

Arm releases first in-house chip, with Meta as debut customer

https://www.cnbc.com/2026/03/24/arm-launches-its-own-cpu-with-meta-as-first-customer.html
61•goplayoutside•3d ago•19 comments

Militarized snowflakes: The accidental beauty of Renaissance star forts

https://bigthink.com/strange-maps/star-forts/
6•Brajeshwar•14m ago•0 comments

Nashville library launches Memory Lab for digitizing home movies

https://www.axios.com/local/nashville/2026/03/16/nashville-library-digitize-home-movies
179•toomuchtodo•4d ago•42 comments

Iran-linked hackers breach FBI director's personal email

https://www.reuters.com/world/us/iran-linked-hackers-claim-breach-of-fbi-directors-personal-email...
351•m-hodges•1d ago•469 comments