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.

An OpenAI model has disproved a central conjecture in discrete geometry

https://openai.com/index/model-disproves-discrete-geometry-conjecture/
793•tedsanders•7h ago•584 comments

GitHub confirms breach of 3,800 repos via malicious VSCode extension

https://www.bleepingcomputer.com/news/security/github-confirms-breach-of-3-800-repos-via-maliciou...
574•Timofeibu•13h ago•206 comments

Show HN: I reverse engineered Apple's video wallpapers

https://github.com/kageroumado/phosphene
90•kageroumado•3h ago•23 comments

DOS Zone

https://dos.zone/
117•rglover•4h ago•23 comments

Colorado Amended SB051 (Age Verification Bill) to Exclude Open Source Projects

https://legiscan.com/CO/bill/SB051/2026
144•ki4jgt•6h ago•40 comments

The Letter S, by Donald Knuth (1980) [pdf]

https://gwern.net/doc/design/typography/1980-knuth.pdf
45•bambax•2h ago•5 comments

What is Demand Coop and why tech workers should join one

https://cahootzcoops.com/blog/what-is-a-demand-coop
23•DeonRob•1h ago•15 comments

Flipper One Tech Specs

https://docs.flipper.net/one/general/tech-specs
272•gregsadetsky•8h ago•99 comments

Your Most Improbable Life

https://kevinkelly.substack.com/p/your-most-improbable-life
46•jger15•2d ago•18 comments

How fast is N tokens per second really?

https://mikeveerman.github.io/tokenspeed/
316•hexagr•3d ago•73 comments

Qwen3.7-Max: The Agent Frontier

https://qwen.ai/blog?id=qwen3.7
625•kevinsimper•16h ago•250 comments

Archaeologists find Egyptian mummy buried with the 'Iliad'

https://www.openculture.com/2026/05/archaeologists-discover-ancient-egyptian-mummy-buried-with-pa...
60•diodorus•5d ago•25 comments

Saying goodbye to asm.js

https://spidermonkey.dev/blog/2026/05/20/saying-goodbye-to-asmjs.html
323•eqrion•14h ago•137 comments

Why is Inkwell stuck in review

https://www.manton.org/2026/05/19/why-is-inkwell-stuck-in.html
113•speckx•9h ago•36 comments

Haskell Foundation 2026 Update

https://discourse.haskell.org/t/haskell-foundation-2026-update/14136
5•azhenley•40m ago•0 comments

Intuit to lay off over 3k employees to refocus on AI

https://techcrunch.com/2026/05/20/intuit-to-lay-off-over-3000-employees-to-refocus-on-ai/
51•wapasta•2h ago•29 comments

Qian Xuesen: The missile genius America lost and China gained (2025)

https://www.usni.org/magazines/naval-history/2025/december/missile-genius-america-lost-and-china-...
123•thnaks•9h ago•67 comments

Google's AI is being manipulated. The search giant is quietly fighting back

https://www.bbc.com/future/article/20260519-google-tackles-attempts-to-hack-its-ai-results
262•tigerlily•15h ago•174 comments

SpaceX S-1

https://www.sec.gov/Archives/edgar/data/1181412/000162828026036936/spaceexplorationtechnologi.htm
250•cachecow•6h ago•190 comments

Sharla Boehm, the programmer whose code underpins the Internet

https://www.scientificamerican.com/article/the-programmer-whose-code-underpins-the-internet/
104•dxs•2d ago•25 comments

Reviving old scanners with an in-browser Linux VM bridged to WebUSB over USB/IP

https://yes-we-scan.app/details
16•gmac•2d ago•3 comments

Google Declaring War on the Web

https://tante.cc/2026/05/20/on-google-declaring-war-on-the-web/
374•cdrnsf•5h ago•250 comments

Incident Report: May 19, 2026 – GCP Account Suspension

https://blog.railway.com/p/incident-report-may-19-2026-gcp-account-outage
395•0xedb•18h ago•237 comments

Show HN: CPU-only transcription for YouTube, TikTok, X, Instagram videos

https://github.com/kouhxp/yapsnap
33•mrkn1•5h ago•12 comments

A Markdown-based test suite

https://blogsystem5.substack.com/p/markdown-based-test-suite
5•zdw•2d ago•0 comments

SBCL: the ultimate assembly code breadboard (2014)

https://pvk.ca/Blog/2014/03/15/sbcl-the-ultimate-assembly-code-breadboard/
129•yacin•11h ago•7 comments

Anthropic is expanding to Colossus2. Will use GB200

https://xcancel.com/nottombrown/status/2057194829986300375
90•aurareturn•5h ago•77 comments

Meta blocks human rights accounts from reaching audiences in Saudi Arabia, UAE

https://www.alqst.org/ar/posts/1190
939•giuliomagnifico•14h ago•404 comments

PopuLoRA: Co-Evolving LLM Populations for Reasoning Self- Play

https://vmax.ai/team/populora-co-evolving-llm-populations-for-reasoning-self-play
34•AMavorParker•5h ago•6 comments

Starship's Twelfth Flight Test

https://www.spacex.com/launches/starship-flight-12
99•pantalaimon•5h ago•87 comments