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.

Memory has grown to nearly two-thirds of AI chip component costs

https://epoch.ai/data-insights/ai-chip-component-cost-shares
109•intelkishan•2h ago•108 comments

DeepSeek reasonix, DeepSeek native coding agent with high caching and low cost

https://esengine.github.io/DeepSeek-Reasonix/
218•Alifatisk•5h ago•119 comments

Ruby for Good

https://ti.to/codeforgood/rubyforgood
59•mooreds•2h ago•19 comments

Constraint Decay: The Fragility of LLM Agents in Back End Code Generation

https://arxiv.org/abs/2605.06445
92•wek•5h ago•49 comments

I spent 50 hours drawing a line graph

https://www.dougmacdowell.com/50-hours-to-draw-some-lines.html
317•dougdude3339•3d ago•62 comments

Mastering Dyalog APL

https://mastering.dyalog.com/README.html
90•tosh•7h ago•18 comments

Usborne 1980s Computer Books

https://usborne.com/us/books/computer-and-coding-books
104•ngram•3h ago•32 comments

'AI washing': firms are scrambling to rebrand themselves as tech-focused

https://www.theguardian.com/technology/2026/may/24/ai-washing-pr-firms-scrambling-rebrand
108•Brajeshwar•3h ago•75 comments

I keep bouncing off the Scheme language

https://www.sicpers.info/2026/05/i-keep-bouncing-off-the-scheme-language/
94•ingve•2d ago•33 comments

Flick (YC F25) Is Hiring Front End Engineer to Build Figma for AI Filmmaking

https://www.ycombinator.com/companies/flick/jobs/Tdu6FH6-senior-frontend-engineer
1•rayruiwang•1h ago

Noroboto: Lying Fonts and Mitigation in Rust

https://tritium.legal/blog/noroboto
15•piker•2d ago•7 comments

Microsoft open-sources "the earliest DOS source code discovered to date"

https://arstechnica.com/gadgets/2026/04/microsoft-open-sources-the-earliest-dos-source-code-disco...
379•DamnInteresting•17h ago•124 comments

Childhood Computing

https://susam.net/childhood-computing.html
116•blenderob•6h ago•61 comments

Perceptual Image Codec: What Matters in Practical Learned Image Compression

https://apple.github.io/ml-pico/
55•ksec•6h ago•19 comments

Build Adafruit projects right from Firefox

https://www.firefox.com/en-US/landing/adafruit/
34•mch82•2d ago•8 comments

Curly braces: An evolution of Unix and C

https://thalia.dev/blog/unix-braces/
31•thaliaarchi•4d ago•6 comments

Wake up! 16b

https://hellmood.111mb.de/wake_up_16b_writeup.html
370•MaximilianEmel•18h ago•25 comments

Scammers are abusing an internal Microsoft account to send spam links

https://techcrunch.com/2026/05/21/scammers-are-abusing-an-internal-microsoft-account-to-send-spam/
234•spike021•17h ago•131 comments

Don't know where your data is from? Bayesian modeling for unknown coordinates

https://christopherkrapu.com/blog/2026/dont-know-where-your-data-is-from/
3•ckrapu•1h ago•0 comments

Swap tables, flash-friendly swap, swap_ops, and more

https://lwn.net/SubscriberLink/1072657/394b87abd7cc215e/
61•mkesper•4d ago•1 comments

FreeBSD Foundation Executive Director Tries Daily Driving FreeBSD on Laptop

https://www.phoronix.com/news/FreeBSD-On-Laptop-Driver
45•Bender•2h ago•42 comments

The C64 Dead Test Font

https://www.masswerk.at/nowgobang/2026/c64-dead-test-font
111•masswerk•14h ago•19 comments

Silk: Open-source cooperative fiber scheduler

https://github.com/ClickHouse/silk
93•animetyan•4d ago•13 comments

Alexander Grothendieck Revolutionized 20th-Century Mathematics

https://www.quantamagazine.org/how-alexander-grothendieck-revolutionized-20th-century-mathematics...
118•anujbans•15h ago•23 comments

Time to talk about my writerdeck

https://veronicaexplains.net/my-first-writerdeck/
437•hggh•1d ago•268 comments

Predicting the 2026 Bristol Bay and Kodiak Salmon Runs

https://www.salmonfinder.com/2026/05/13/bristol-bay-kodiak-predictions-2026
8•mooreds•2d ago•4 comments

Converting an Integer to a Decimal String in Under Two Nanoseconds

https://onlinelibrary.wiley.com/doi/10.1002/spe.70079
96•mpweiher•5d ago•51 comments

On The <dl> (2021)

https://benmyers.dev/blog/on-the-dl/
423•ravenical•1d ago•124 comments

DeepSeek to Make Permanent 75% Discount on Flagship AI Model

https://www.bloomberg.com/news/articles/2026-05-23/deepseek-to-make-permanent-75-discount-on-flag...
118•moh_maya•4h ago•117 comments

$100 CPU Shootout: Comparing the Ryzen 5 5500, Core i3-14100F, & Core i3-12100F

https://www.tomshardware.com/pc-components/cpus/100-budget-cpu-shootout-ddr4
5•bushwart•39m ago•3 comments