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

Comments

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

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

Multiprocessing all the way!

emmelaich•8mo ago
(2021)

Good article!

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

First, make me care

https://gwern.net/blog/2026/make-me-care
521•andsoitis•11h ago•149 comments

The browser is the sandbox

https://simonwillison.net/2026/Jan/25/the-browser-is-the-sandbox/
15•enos_feedler•1h ago•7 comments

Scientists identify brain waves that define the limits of 'you'

https://www.sciencealert.com/scientists-identify-brain-waves-that-define-the-limits-of-you
139•mikhael•6h ago•26 comments

Iran's internet blackout may become permanent, with access for elites only

https://restofworld.org/2026/iran-blackout-tiered-internet/
124•siev•2h ago•51 comments

A macOS app that blurs your screen when you slouch

https://github.com/tldev/posturr
548•dnw•15h ago•178 comments

Case study: Creative math – How AI fakes proofs

https://tomaszmachnik.pl/case-study-math-en.html
75•musculus•7h ago•46 comments

SF Microclimates

https://microclimates.solofounders.com/
22•rmason•4h ago•4 comments

Compiling models to megakernels

https://blog.luminal.com/p/compiling-models-to-megakernels
6•jafioti•1d ago•0 comments

Show HN: A desktop app that blocks work when you bite your nails

https://github.com/cacoos/trackhands
8•cacoos•7h ago•0 comments

Video Games as Art

https://gwern.net/video-game-art
29•andsoitis•4h ago•11 comments

You can just port things to Cloudflare Workers

https://sigh.dev/posts/you-can-just-port-things-to-cloudflare-workers/
7•STRiDEX•4h ago•0 comments

The Science of Fermentation [audio]

https://www.bbc.co.uk/programmes/m002pqg6
36•fallinditch•2d ago•7 comments

Delta single handle ball faucets (1963)

https://archive.org/details/DeltaSingleHandleBallFaucets
44•userbinator•4d ago•25 comments

Environmentalists worry Google behind bid to control Oregon town's water

https://www.sfgate.com/national-parks/article/mount-hood-water-google-21307223.php
54•voxadam•3h ago•1 comments

A static site generator written in POSIX shell

https://aashvik.com/posts/shell-ssg/
5•todsacerdoti•5d ago•0 comments

The future of software engineering is SRE

https://swizec.com/blog/the-future-of-software-engineering-is-sre/
71•Swizec•8h ago•29 comments

Using PostgreSQL as a Dead Letter Queue for Event-Driven Systems

https://www.diljitpr.net/blog-post-postgresql-dlq
194•tanelpoder•14h ago•60 comments

Building a Real-Time HN Display for $15

https://medium.com/@lee.harding/building-a-real-time-hn-display-for-15-3ea1772051ff
19•kylegalbraith•3d ago•4 comments

Guix for Development

https://dthompson.us/posts/guix-for-development.html
62•clircle•5d ago•22 comments

Spanish track was fractured before high-speed train disaster, report finds

https://www.bbc.com/news/articles/c1m77dmxlvlo
181•Rygian•11h ago•152 comments

Show HN: An interactive map of US lighthouses and navigational aids

https://www.lighthouses.app/
61•idd2•12h ago•19 comments

Web-based image editor modeled after Deluxe Paint

https://github.com/steffest/DPaint-js
202•bananaboy•17h ago•19 comments

Show HN: NukeCast – If it happened today, where would the fallout go

https://nukecast.com/
4•todd_tracerlab•3h ago•0 comments

Turbopack: Building faster by building less

https://nextjs.org/blog/turbopack-incremental-computation
34•feross•5d ago•16 comments

The '3.5% rule': How a small minority can change the world (2019)

https://www.bbc.com/future/article/20190513-it-only-takes-35-of-people-to-change-the-world
263•choult•9h ago•175 comments

ICE using Palantir tool that feeds on Medicaid data

https://www.eff.org/deeplinks/2026/01/report-ice-using-palantir-tool-feeds-medicaid-data
1099•JKCalhoun•13h ago•673 comments

Integrating WebView with Nature Programming Language

https://nature-lang.org/blog/20260121
6•weiwenhao•4d ago•2 comments

Oneplus phone update introduces hardware anti-rollback

https://consumerrights.wiki/w/Oneplus_phone_update_introduces_hardware_anti-rollback
389•validatori•10h ago•232 comments

Tell HN: I cut Claude API costs from $70/month to pennies

7•ok_orco•6h ago•3 comments

Bitwise conversion of doubles using only FP multiplication and addition (2020)

https://dougallj.wordpress.com/2020/05/10/bitwise-conversion-of-doubles-using-only-floating-point...
29•vitaut•15h ago•3 comments