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.

Show HN: Librario, a book metadata API that aggregates G Books, ISBNDB, and more

49•jamesponddotco•2h ago•18 comments

Finding and fixing Ghostty's largest memory leak

https://mitchellh.com/writing/ghostty-memory-leak-fix
252•thorel•7h ago•58 comments

Show HN: I used Claude Code to discover connections between 100 books

https://trails.pieterma.es/
212•pmaze•9h ago•74 comments

Open Chaos: A self-evolving open-source project

https://www.openchaos.dev/
313•stefanvdw1•10h ago•64 comments

Eulogy for Dark Sky, a data visualization masterpiece (2023)

https://nightingaledvs.com/dark-sky-weather-data-viz/
375•skadamat•13h ago•159 comments

AI is a business model stress test

https://dri.es/ai-is-a-business-model-stress-test
175•amarsahinovic•9h ago•196 comments

Show HN: Ferrite – Markdown editor in Rust with native Mermaid diagram rendering

https://github.com/OlaProeis/Ferrite
3•OlaProis•29m ago•0 comments

1970 Paris, cut into a grid and photographed

https://paris1970.jeantho.eu/index.html
27•panic•1w ago•5 comments

Code and Let Live

https://fly.io/blog/code-and-let-live/
220•usrme•1d ago•70 comments

Private equity firms acquired more than 500 autism centers in past decade: study

https://www.brown.edu/news/2026-01-07/private-equity-autism-centers
192•hhs•2h ago•111 comments

Show HN: mcpc – Universal command-line client for Model Context Protocol (MCP)

https://github.com/apify/mcp-cli
12•jancurn•4d ago•2 comments

Code Is Clay

https://campedersen.com/code-is-clay
33•ecto•6h ago•16 comments

Show HN: GlyphLang – An AI-first programming language

18•goose0004•2h ago•12 comments

Show HN: Play poker with LLMs, or watch them play against each other

https://llmholdem.com/
69•projectyang•6h ago•42 comments

Rats caught on camera hunting flying bats

https://scienceclock.com/rats-caught-on-camera-hunting-flying-bats-for-the-first-time/
74•akg130522•7h ago•9 comments

ASCII-Driven Development

https://medium.com/@calufa/ascii-driven-development-850f66661351
96•_hfqa•2d ago•65 comments

ChatGPT Health is a marketplace, guess who is the product?

https://consciousdigital.org/chatgpt-health-is-a-marketplace-guess-who-is-the-product/
236•yoaviram•2d ago•230 comments

I replaced Windows with Linux and everything's going great

https://www.theverge.com/tech/858910/linux-diary-gaming-desktop
563•rorylawless•10h ago•476 comments

Org Mode Syntax Is One of the Most Reasonable Markup Languages for Text (2017)

https://karl-voit.at/2017/09/23/orgmode-as-markup-only/
248•adityaathalye•17h ago•176 comments

Grateful Dead co-founder Bob Weir has died at age 78

https://www.rollingstone.com/music/music-news/bob-weir-grateful-dead-dead-obituary-1234810106/
15•asix66•1h ago•3 comments

New information extracted from Snowden PDFs through metadata version analysis

https://libroot.org/posts/going-through-snowden-documents-part-4/
283•libroot•14h ago•118 comments

Brands upset Buy For Me is featuring their products on Amazon without permission

https://www.modernretail.co/technology/brands-are-upset-that-buy-for-me-is-featuring-their-produc...
12•spenvo•3d ago•3 comments

UpCodes (YC S17) is hiring PMs, SWEs to automate construction compliance

https://up.codes/careers?utm_source=HN
1•Old_Thrashbarg•9h ago

Side-by-side comparison of how AI models answer moral dilemmas

https://civai.org/p/ai-values
76•jesenator•2d ago•45 comments

The eight ways that all the elements in the Universe are made (2021)

https://bigthink.com/starts-with-a-bang/8-ways-elements-made/
50•zdw•5d ago•26 comments

A child in the state of nature

https://lareviewofbooks.org/article/a-child-in-the-state-of-nature/
12•Caiero•3d ago•0 comments

Extracting books from production language models (2026)

https://arxiv.org/abs/2601.02671
30•logicprog•5h ago•3 comments

How wolves became dogs

https://www.economist.com/christmas-specials/2025/12/18/how-wolves-became-dogs
105•mooreds•5d ago•89 comments

NASA announces unprecedented return of sick ISS astronaut and crew

https://www.livescience.com/space/space-exploration/nasa-cancels-spacewalk-and-considers-early-cr...
98•bookofjoe•12h ago•89 comments

Bindless Oriented Graphics Programming

https://alextardif.com/BindlessProgramming.html
40•ibobev•3d ago•5 comments