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

Comments

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

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

Multiprocessing all the way!

emmelaich•11mo ago
(2021)

Good article!

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

I Cancelled Claude: Token Issues, Declining Quality, and Poor Support

https://nickyreinert.de/en/2026/2026-04-24-claude-critics/
125•y42•51m ago•45 comments

Sabotaging projects by overthinking, scope creep, and structural diffing

https://kevinlynagh.com/newsletter/2026_04_overthinking/
150•alcazar•2h ago•35 comments

Norway Set to Become Latest Country to Ban Social Media for Under 16s

https://www.bloomberg.com/news/articles/2026-04-24/norway-wants-kids-to-be-kids-with-social-media...
175•1vuio0pswjnm7•2h ago•129 comments

Why I'm Done Making Desktop Applications (2009)

https://www.kalzumeus.com/2009/09/05/desktop-aps-versus-web-apps/
53•claxo•1h ago•29 comments

Different Language Models Learn Similar Number Representations

https://arxiv.org/abs/2604.20817
43•Anon84•2h ago•12 comments

Spinel: Ruby AOT Native Compiler

https://github.com/matz/spinel
231•dluan•8h ago•60 comments

Show HN: Browser Harness – Gives LLM freedom to complete any browser task

https://github.com/browser-use/browser-harness
6•gregpr07•2h ago•0 comments

Mounting tar archives as a filesystem in WebAssembly

https://jeroen.github.io/notes/webassembly-tar/
80•datajeroen•6h ago•25 comments

US special forces soldier arrested after allegedly winning $400k on Maduro raid

https://www.cnn.com/2026/04/23/politics/us-special-forces-soldier-arrested-maduro-raid-trade
530•nkrisc•18h ago•561 comments

DeepSeek v4

https://api-docs.deepseek.com/
1540•impact_sy•13h ago•1165 comments

Show HN: How LLMs Work – Interactive visual guide based on Karpathy's lecture

https://ynarwal.github.io/how-llms-work/
225•ynarwal__•10h ago•54 comments

Hear your agent suffer through your code

https://github.com/AndrewVos/endless-toil
122•AndrewVos•5h ago•55 comments

Machine Learning Reveals Unknown Transient Phenomena in Historic Images

https://arxiv.org/abs/2604.18799
14•solarist•2h ago•10 comments

An update on recent Claude Code quality reports

https://www.anthropic.com/engineering/april-23-postmortem
853•mfiguiere•23h ago•650 comments

Physicists revive 1990s laser concept to propose a next-generation atomic clock

https://phys.org/news/2026-04-physicists-revive-1990s-laser-concept.html
5•wglb•15h ago•2 comments

Bitwarden CLI compromised in ongoing Checkmarx supply chain campaign

https://socket.dev/blog/bitwarden-cli-compromised
829•tosh•1d ago•404 comments

Why I Write (1946)

https://www.orwellfoundation.com/the-orwell-foundation/orwell/essays-and-other-works/why-i-write/
241•RyanShook•14h ago•61 comments

GPT-5.5

https://openai.com/index/introducing-gpt-5-5/
1483•rd•22h ago•989 comments

Show HN: Gova – The declarative GUI framework for Go

https://github.com/NV404/gova
94•aliezsid•10h ago•17 comments

8087 Emulation on 8086 Systems

https://www.os2museum.com/wp/learn-something-old-every-day-part-xx-8087-emulation-on-8086-systems/
38•ingve•5h ago•13 comments

Meta tells staff it will cut 10% of jobs

https://www.bloomberg.com/news/articles/2026-04-23/meta-tells-staff-it-will-cut-10-of-jobs-in-pus...
748•Vaslo•21h ago•762 comments

MeshCore development team splits over trademark dispute and AI-generated code

https://blog.meshcore.io/2026/04/23/the-split
257•wielebny•23h ago•139 comments

Show HN: Atomic – Local-first, AI-augmented personal knowledge base

https://atomicapp.ai/
27•kenforthewin•4h ago•7 comments

South Korea police arrest man for posting AI photo of runaway wolf

https://www.bbc.com/news/articles/c4gx1n0dl9no
201•giuliomagnifico•7h ago•125 comments

Using the internet like it's 1999

https://joshblais.com/blog/using-the-internet-like-its-1999/
212•joshuablais•20h ago•151 comments

Show HN: leaf – a terminal Markdown previewer with a GUI-like experience

https://github.com/RivoLink/leaf
14•RivoLink•5h ago•3 comments

Researchers Simulated a Delusional User to Test Chatbot Safety

https://www.404media.co/delusion-using-chatgpt-gemini-claude-grok-safety-ai-psychosis-study/
12•Brajeshwar•1h ago•2 comments

TorchTPU: Running PyTorch Natively on TPUs at Google Scale

https://developers.googleblog.com/torchtpu-running-pytorch-natively-on-tpus-at-google-scale/
181•mji•19h ago•16 comments

UK Biobank health data keeps ending up on GitHub

https://biobank.rocher.lc
179•Cynddl•1d ago•50 comments

How to be anti-social – a guide to incoherent and isolating social experiences

https://nate.leaflet.pub/3mk4xkaxobc2p
158•calcifer•6h ago•172 comments