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

Comments

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

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

Multiprocessing all the way!

emmelaich•10mo ago
(2021)

Good article!

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

Temporal: A nine-year journey to fix time in JavaScript

https://bloomberg.github.io/js-blog/post/temporal/
235•robpalmer•3h ago•97 comments

Making WebAssembly a first-class language on the Web

https://hacks.mozilla.org/2026/02/making-webassembly-a-first-class-language-on-the-web/
169•mikece•13h ago•72 comments

Entities enabling scientific fraud at scale are large, resilient, growing (2025)

https://doi.org/10.1073/pnas.2420092122
193•peyton•5h ago•104 comments

BitNet: 100B Param 1-Bit model for local CPUs

https://github.com/microsoft/BitNet
230•redm•6h ago•116 comments

Where Some See Strings, She Sees a Space-Time Made of Fractals

https://www.quantamagazine.org/where-some-see-strings-she-sees-a-space-time-made-of-fractals-2026...
64•tzury•2h ago•8 comments

Show HN: Klaus – OpenClaw on a VM, batteries included

https://klausai.com/
47•robthompson2018•2h ago•34 comments

Lego's 0.002mm specification and its implications for manufacturing (2025)

https://www.thewave.engineer/articles.html/productivity/legos-0002mm-specification-and-its-implic...
290•scrlk•5h ago•225 comments

Fungal Electronics

https://arxiv.org/abs/2111.11231
27•byt3h3ad•1h ago•2 comments

Launch HN: Prism (YC X25) – Workspace and API to generate and edit videos

https://www.prismvideos.com
19•aliu327•2h ago•9 comments

Show HN: Open-source browser for AI agents

https://github.com/theredsix/agent-browser-protocol
48•theredsix•4h ago•17 comments

AI Agent Hacks McKinsey

https://codewall.ai/blog/how-we-hacked-mckinseys-ai-platform
247•mycroft_4221•8h ago•100 comments

5,200 holes carved into a Peruvian mountain left by an ancient economy

https://newatlas.com/environment/5-200-holes-peruvian-mountain/
15•defrost•1d ago•3 comments

Show HN: Vanilla JavaScript refinery simulator built to explain job to my kids

https://fuelingcuriosity.com/game.html
33•fuelingcurious•1h ago•16 comments

Medical technology company in Michigan hit by suspected Iran-linked cyberattack

https://www.fox17online.com/news/local-news/kzoo-bc/kalamazoo/stryker-headquarters-in-portage-clo...
6•SteveNuts•40m ago•0 comments

Wiz joins Google

https://www.wiz.io/blog/google-closes-deal-to-acquire-wiz
99•aldarisbm•3h ago•73 comments

The MacBook Neo

https://daringfireball.net/2026/03/the_macbook_neo
100•etothet•7h ago•230 comments

Launch HN: Sentrial (YC W26) – Catch AI Agent Failures Before Your Users Do

https://www.sentrial.com/
9•anayrshukla•2h ago•5 comments

Swiss e-voting pilot can't count 2,048 ballots after decryption failure

https://www.theregister.com/2026/03/11/swiss_evote_usb_snafu/
57•jjgreen•5h ago•118 comments

Show HN: I built a tool that watches webpages and exposes changes as RSS

https://sitespy.app
10•vkuprin•2h ago•4 comments

Searching for the Agentic IDE

https://twitter.com/karpathy/status/2031616709560610993
10•bigwheels•2h ago•14 comments

Show HN: I built an ISP infrastructure emulator from scratch with a custom vBNG

https://aether.saphal.me/dashboard/default
24•saphalpdyl•5h ago•3 comments

Building a TB-303 from Scratch

https://loopmaster.xyz/tutorials/tb303-from-scratch
183•stagas•3d ago•73 comments

Faster asin() was hiding in plain sight

https://16bpp.net/blog/post/faster-asin-was-hiding-in-plain-sight/
130•def-pri-pub•4h ago•79 comments

Zig – Type Resolution Redesign and Language Changes

https://ziglang.org/devlog/2026/#2026-03-10
367•Retro_Dev•17h ago•202 comments

Visualizing Ukkonen's Suffix Tree Algorithm

https://www.abahgat.com/blog/visualizing-ukkonens-algorithm/
15•gsky•1d ago•2 comments

PeppyOS: A simpler alternative to ROS 2 (now with containers support)

https://peppy.bot/
59•Ekami•3d ago•21 comments

Why the global elite gave up on spelling and grammar

https://www.wsj.com/lifestyle/jeffrey-epstein-files-bad-grammar-spelling-trump-ellison-dorsey-gat...
55•matthieu_bl•3h ago•132 comments

Cloudflare crawl endpoint

https://developers.cloudflare.com/changelog/post/2026-03-10-br-crawl-endpoint/
445•jeffpalmer•20h ago•176 comments

Writing my own text editor, and daily-driving it

https://blog.jsbarretto.com/post/text-editor
194•todsacerdoti•16h ago•103 comments

Yann LeCun raises $1B to build AI that understands the physical world

https://www.wired.com/story/yann-lecun-raises-dollar1-billion-to-build-ai-that-understands-the-ph...
581•helloplanets•1d ago•469 comments