frontpage.
newsnewestaskshowjobs

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.

OpenAI Submits S-1 Draft to SEC

https://openai.com/index/openai-submits-confidential-s-1/
240•hackerBanana•2h ago•144 comments

Surveillance Is Not Safety: A statement on the UK's latest threat to privacy [pdf]

https://signal.org/blog/pdfs/2026-06-08-uk-surveillance-is-not-safety.pdf
346•g0xA52A2A•4h ago•111 comments

Siri AI

https://www.apple.com/apple-intelligence/
371•0xedb•6h ago•309 comments

Show HN: Performative-UI – A react component library of design tropes

https://vorpus.github.io/performativeUI/
737•lizhang•10h ago•149 comments

MiMo-v2.5-Pro-UltraSpeed: 1T model with 1000 tokens per second

https://mimo.xiaomi.com/blog/mimo-tilert-1000tps
479•gainsurier•8h ago•328 comments

Apple Core AI Framework

https://developer.apple.com/documentation/coreai/
160•hmokiguess•5h ago•26 comments

EU-banned pesticides found in rice, tea and spices

https://www.foodwatch.org/en/eu-banned-pesticides-found-in-rice-tea-and-spices
214•john-titor•8h ago•81 comments

Looking Forward to Postgres 19: Query Hints

https://www.pgedge.com/blog/looking-forward-to-postgres-19-query-hints
28•jjgreen•3d ago•3 comments

Anti-social: It's fads, not friends, which now dominate social media feeds

https://www.bbc.com/worklife/article/20260520-how-social-media-ceased-to-be-social
526•1vuio0pswjnm7•12h ago•395 comments

Show HN: Gitdot – a better GitHub. Open-source, written in Rust

https://gitdot.io/
119•baepaul•7h ago•112 comments

Why are cells small?

https://burrito.bio/essays/what-limits-a-cells-size
100•mailyk•5h ago•44 comments

xAI is looking more like a datacentre REIT than a frontier lab

https://martinalderson.com/posts/xais-new-rental-business/
372•martinald•9h ago•295 comments

Apple reveals new AI architecture built around Google Gemini models

https://www.macrumors.com/2026/06/08/apple-reveals-new-ai-architecture/
311•unclefuzzy•5h ago•296 comments

FrontierCode

https://cognition.ai/blog/frontier-code
77•streamer45•3h ago•18 comments

Ask HN: What are tools you have made for yourself since the advent of AI?

127•aryamaan•5h ago•239 comments

Games Between Programs: The Ruliology of Competition

https://writings.stephenwolfram.com/2026/06/games-between-programs-the-ruliology-of-competition/
6•andromaton•3d ago•0 comments

Launch HN: Intuned (YC S22) – Build and run reliable browser automations as code

https://intunedhq.com
97•fkilaiwi•10h ago•44 comments

Doing Something That's Never Been Done Before

https://talglobus.com/p/doing-something-thats-never-been-done-before/
22•surprisetalk•3d ago•10 comments

AI is slowing down

https://www.wheresyoured.at/ai-is-slowing-down/
358•crescit_eundo•8h ago•376 comments

OCaml Onboarding: Introduction to the Dune build system

https://ocamlpro.com/blog/2025_07_29_ocaml_onboarding_introduction_to_dune/
139•andrewstetsenko•4d ago•17 comments

Fooling Go's X.509 Certificate Verification

https://danielmangum.com/posts/fooling-go-x509-certificate-verification/
36•hasheddan•2d ago•17 comments

1worldflag: A blue dot on a transparent background

https://1worldflag.com/
164•davidbarker•22h ago•141 comments

Switzerland wil have a referendum to cap population at 10M

https://www.admin.ch/en/sustainability-initiative
223•napolux•5h ago•447 comments

Stop the Apple Music app from launching

https://lowtechguys.com/musicdecoy/
560•bobbiechen•7h ago•223 comments

How much of Thermo Fisher's antibody data has been manipulated?

https://reeserichardson.blog/2026/05/28/how-much-of-thermo-fishers-antibody-data-has-been-manipul...
399•mhrmsn•17h ago•87 comments

Massachusetts bans sale of precise location data in new privacy rights bill

https://techcrunch.com/2026/06/08/massachusetts-votes-to-pass-new-privacy-rights-bill-that-bans-s...
243•01-_-•7h ago•37 comments

Using XDG-Compliant Config Files (2024)

https://wxwidgets.org/blog/2024/01/using-xdg-compliant-config-files/
34•ankitg12•4d ago•7 comments

Show HN: Mach – A compiled systems language looking for contributions

https://github.com/octalide/mach
6•octalide•1h ago•1 comments

Are you expected to run five Python type-checkers now?

https://pyrefly.org/blog/too-many-type-checkers/
132•ocamoss•11h ago•149 comments

Apple WWDC 2026

https://www.apple.com/apple-events/event-stream/
234•nextstep•7h ago•454 comments