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.

Antigravity 2.0 Tops the OpenSCAD Architectural 3D LLM Benchmark

https://modelrift.com/blog/openscad-llm-benchmark/
185•jetter•4h ago•76 comments

If you’re an LLM, please read this

https://annas-archive.gl/blog/llms-txt.html
417•janandonly•3h ago•259 comments

Launch HN: Superset (YC P26) – IDE for the agents era

https://github.com/superset-sh/superset
10•avipeltz•25m ago•5 comments

A Forth-inspired language for writing websites

https://robida.net/entries/2026/05/21/a-forth-inspired-language-for-writing-websites
3•speckx•18m ago•0 comments

Show HN: ShadowCat – file transfer through QR Codes in a Browser

https://github.com/unprovable/ShadowCat
62•unprovable•4h ago•26 comments

Chess Invariants

http://muratbuffalo.blogspot.com/2026/05/chess-invariants.html
47•ingve•4h ago•30 comments

A case against Boolean logic

https://abuseofnotation.github.io/boolean-thinking/
41•boris_m•4h ago•60 comments

Project Hail Mary – Stellar Navigation Chart

https://valhovey.github.io/gaia-mary/
1027•speleo•22h ago•214 comments

Sam Altman Won in Court Against Elon Musk. But, We All Lost

https://www.newyorker.com/news/letter-from-silicon-valley/sam-altman-won-in-court-against-elon-mu...
89•littlexsparkee•2h ago•51 comments

The Spread of Christianity Animated

https://www.openculture.com/2026/05/the-spread-of-christianity-animated-from-antiquity-until-toda...
7•leopoldj•1h ago•0 comments

Deno 2.8

https://deno.com/blog/v2.8
39•roflcopter69•3h ago•11 comments

The memory shortage is causing a repricing of consumer electronics

https://davidoks.blog/p/ai-is-killing-the-cheap-smartphone
331•d0ks•17h ago•391 comments

Circle Medical (YC S15) Is Hiring a Mobile Engineer

https://www.ycombinator.com/companies/circle-medical/jobs/onMKAG9-mobile-engineer-android
1•jboula•3h ago

Slumber a TUI HTTP Client

https://slumber.lucaspickering.me
129•jicea•10h ago•43 comments

Cleve Moler has died

https://www.mathworks.com/company/aboutus/founders/clevemoler.html
202•mychele•12h ago•16 comments

Blog ran on Ubuntu 16.04 for 10 years. I migrated it to FreeBSD

https://crocidb.com/post/this-blog-ran-on-ubuntu-16-04-for-10-years-i-migrated-it-to-freebsd/
332•speckx•20h ago•191 comments

Uv is fantastic, but its package management UX is a mess

https://www.loopwerk.io/articles/2026/uv-ux-mess/
273•nchagnet•18h ago•126 comments

Was my $48K GPU server worth it?

https://rosmine.ai/2026/05/13/was-my-48k-gpu-worth-it/
507•apwheele•3d ago•386 comments

CODA: Rewriting Transformer Blocks as GEMM-Epilogue Programs

https://arxiv.org/abs/2605.19269
89•matt_d•10h ago•11 comments

The surprising story behind the first British person in space

https://www.bbc.com/culture/article/20260518-helen-sharman-the-story-behind-the-first-british-per...
84•xoxxala•1d ago•39 comments

AI has a multiplying effect on existing technical skills

https://www.joshwcomeau.com/email/wham-launch-005-elephant-2-p/
95•moebrowne•1h ago•113 comments

Steve Wozniak cheered after telling students they have AI – actual intelligence

https://www.businessinsider.com/steve-wozniak-apple-ai-graduation-speech-2026-5
358•signa11•6h ago•336 comments

Indexing a year of video locally on a 2021 MacBook with Gemma4-31B (50GB swap)

https://blog.simbastack.com/indexed-a-year-of-video-locally/
429•asenna•1d ago•124 comments

Using Kagi Search with Low Vision

https://veroniiiica.com/using-kagi-search-with-low-vision/
233•speckx•19h ago•77 comments

The death of the brick and mortar toy store

https://brainbaking.com/post/2026/05/the-death-of-the-brick-and-mortar-toy-store/
119•speckx•3d ago•149 comments

Lost Images from the 1945 Trinity Nuclear Test Restored

https://spectrum.ieee.org/trinity-nuclear-test
391•pseudolus•1d ago•114 comments

Python 3.15: features that didn't make the headlines

https://blog.changs.co.uk/python-315-features-that-didnt-make-the-headlines.html
410•rbanffy•1d ago•201 comments

Mycorrhizal Fungi, Nature's Key to Plant Survival and Success

https://pacifichorticulture.org/articles/mycorrhizal-fungi-natures-key-to-plant-survival-and-succ...
119•mooreds•1d ago•30 comments

Breakthroughs for batteries could soon make them better

https://www.economist.com/science-and-technology/2026/05/20/breakthroughs-for-batteries-could-soo...
49•pingou•3h ago•58 comments

Flipper One – we need your help

https://blog.flipper.net/flipper-one-we-need-your-help/
1207•sandebert•1d ago•464 comments