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

Comments

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

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

Multiprocessing all the way!

emmelaich•7mo ago
(2021)

Good article!

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

2025: The Year in LLMs

https://simonwillison.net/2025/Dec/31/the-year-in-llms/
263•simonw•5h ago•143 comments

I canceled my book deal

https://austinhenley.com/blog/canceledbookdeal.html
385•azhenley•10h ago•243 comments

Scientists unlock brain's natural clean-up system for new treatments for stroke

https://www.monash.edu/pharm/about/news/news-listing/latest/scientists-unlock-brains-natural-clea...
111•PaulHoule•6h ago•19 comments

Show HN: BusterMQ, Thread-per-core NATS server in Zig with io_uring

https://bustermq.sh/
55•jbaptiste•4h ago•7 comments

Flow5 Released to Open Source

https://flow5.tech/docs/releasenotes.html
10•picture•1h ago•1 comments

Warren Buffett steps down as Berkshire Hathaway CEO after six decades

https://www.latimes.com/business/story/2025-12-31/warren-buffett-steps-down-as-berkshire-hathaway...
472•ValentineC•7h ago•308 comments

Resistance training load does not determine hypertrophy

https://physoc.onlinelibrary.wiley.com/doi/10.1113/JP289684
85•Luc•6h ago•83 comments

Demystifying DVDs

https://hiddenpalace.org/News/One_Bad_Ass_Hedgehog_-_Shadow_the_Hedgehog#Demystifying_DVDs
136•boltzmann-brain•3d ago•13 comments

Judge to Texas: You Can't Age-Gate the Internet Without Evidence

https://www.techdirt.com/2025/12/31/judge-to-texas-you-cant-age-gate-the-entire-internet-without-...
39•djoldman•1h ago•20 comments

All-optical synthesis chip for large-scale intelligent semantic vision

https://www.science.org/doi/10.1126/science.adv7434
65•QueensGambit•8h ago•12 comments

My role as a founder-CTO: year 8

https://miguelcarranza.es/cto-year-8
113•ridruejo•5d ago•92 comments

Ÿnsect, a French insect farming startup, has been been placed into liquidation

https://techcrunch.com/2025/12/26/how-reality-crushed-ynsect-the-french-startup-that-had-raised-o...
84•fcpguru•5d ago•82 comments

On privacy and control

https://toidiu.com/blog/2025-12-25-privacy-and-control/
154•todsacerdoti•10h ago•86 comments

GoGoGrandparent (YC S16) Is Hiring Tech Leads

https://www.ycombinator.com/companies/gogograndparent/jobs/w2jGKM7-gogograndparent-yc-s16-is-hiri...
1•davidchl•3h ago

Tell HN: Happy New Year

270•schappim•15h ago•144 comments

Observed Agent Sandbox Bypasses

https://voratiq.com/blog/yolo-in-the-sandbox/
38•m-hodges•3d ago•29 comments

The compiler is your best friend

https://blog.daniel-beskin.com/2025-12-22-the-compiler-is-your-best-friend-stop-lying-to-it
151•based2•13h ago•103 comments

Web Browsers have stopped blocking pop-ups

https://www.smokingonabike.com/2025/12/31/web-browsers-have-stopped-blocking-pop-ups/
91•coldpie•11h ago•85 comments

PyPI in 2025: A Year in Review

https://blog.pypi.org/posts/2025-12-31-pypi-2025-in-review/
54•miketheman•9h ago•17 comments

Reminiscences of a Stock Operator (1923)

https://gutenberg.org/cache/epub/60979/pg60979-images.html
6•thomassmith65•4d ago•2 comments

Akin's Laws of Spacecraft Design (2011) [pdf]

https://www.ece.uvic.ca/~elec399/201409/Akin%27s%20Laws%20of%20Spacecraft%20Design.pdf
275•tosh•18h ago•84 comments

Show HN: Use Claude Code to Query 600 GB Indexes over Hacker News, ArXiv, etc.

https://exopriors.com/scry
324•Xyra•21h ago•115 comments

Scaffolding to Superhuman: How Curriculum Learning Solved 2048 and Tetris

https://kywch.github.io/blog/2025/12/curriculum-learning-2048-tetris/
123•a1k0n•13h ago•30 comments

When square pixels aren't square

https://alexwlchan.net/2025/square-pixels/
119•PaulHoule•15h ago•56 comments

Pixar's True Story

https://computerhistory.org/blog/pixars-true-story/
7•kristianp•2h ago•1 comments

Iron Beam: Israel's first operational anti drone laser system

https://mod.gov.il/en/press-releases/press-room/israel-mod-and-rafael-deliver-first-operational-h...
105•fork-bomber•14h ago•174 comments

The Delete Act

https://privacy.ca.gov/drop/about-drop-and-the-delete-act/
124•weaksauce•4h ago•62 comments

The most famous transcendental numbers

https://sprott.physics.wisc.edu/pickover/trans.html
145•vismit2000•16h ago•95 comments

Microtonal Spiral Piano

https://shih1.github.io/spiral/
84•phoenix_ashes•5d ago•13 comments

How AI labs are solving the power problem

https://newsletter.semianalysis.com/p/how-ai-labs-are-solving-the-power
137•Symmetry•15h ago•211 comments