frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

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

Comments

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

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

Multiprocessing all the way!

emmelaich•1mo ago
(2021)

Good article!

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

The New Skill in AI Is Not Prompting, It's Context Engineering

https://www.philschmid.de/context-engineering
149•robotswantdata•1h ago•61 comments

I write type-safe generic data structures in C

https://danielchasehooper.com/posts/typechecked-generic-c-data-structures/
178•todsacerdoti•5h ago•61 comments

The hidden JTAG in a Qualcomm/Snapdragon device’s USB port

https://www.linaro.org/blog/hidden-jtag-qualcomm-snapdragon-usb/
77•denysvitali•3h ago•14 comments

There are no new ideas in AI only new datasets

https://blog.jxmo.io/p/there-are-no-new-ideas-in-ai-only
228•bilsbie•7h ago•126 comments

The Original LZEXE (A.K.A. Kosinski) Compressor Source Code Has Been Released

https://clownacy.wordpress.com/2025/05/24/the-original-lzexe-a-k-a-kosinski-compressor-source-code-has-been-released/
21•elvis70•2h ago•3 comments

End of an Era

https://www.erasmatazz.com/personal/self/end-of-an-era.html
26•marcusestes•2h ago•5 comments

Show HN: TokenDagger – A tokenizer faster than OpenAI's Tiktoken

https://github.com/M4THYOU/TokenDagger
227•matthewolfe•9h ago•64 comments

They don't make 'em like that any more: Sony DTC-700 audio DAT player/recorder

https://kevinboone.me/dtc-700.html
57•naves•4h ago•38 comments

Show HN: New Ensō – first public beta

https://untested.sonnet.io/notes/new-enso-first-public-beta/
201•rpastuszak•11h ago•78 comments

Creating fair dice from random objects

https://arstechnica.com/science/2025/05/your-next-gaming-dice-could-be-shaped-like-a-dragon-or-armadillo/
9•epipolar•2d ago•1 comments

Xfinity using WiFi signals in your house to detect motion

https://www.xfinity.com/support/articles/wifi-motion
136•bearsyankees•3h ago•97 comments

The provenance memory model for C

https://gustedt.wordpress.com/2025/06/30/the-provenance-memory-model-for-c/
190•HexDecOctBin•12h ago•98 comments

Entropy of a Mixture

https://cgad.ski/blog/entropy-of-a-mixture.html
8•cgadski•1h ago•1 comments

Jacobi Ellipsoid

https://en.wikipedia.org/wiki/Jacobi_ellipsoid
14•perihelions•2d ago•2 comments

Ask HN: What Are You Working On? (June 2025)

345•david927•1d ago•1075 comments

14.ai (YC W24) hiring founding engineers in SF to build a Zendesk alternative

https://14.ai/careers
1•michaelfester•5h ago

Donkey Kong Country 2 and Open Bus

https://jsgroth.dev/blog/posts/dkc2-open-bus/
173•colejohnson66•7h ago•42 comments

Ask HN: What's the 2025 stack for a self-hosted photo library with local AI?

112•jamesxv7•4h ago•55 comments

The Plot of the Phantom, a text adventure that took 40 years to finish

https://scottandrew.com/blog/2025/06/you-can-now-play-plot-of-the-phantom-the-text-adventure-game/
169•SeenNotHeard•3d ago•33 comments

Show HN: We're two coffee nerds who built an AI app to track beans and recipes

https://beanbook.app
25•rokeyzhang•3h ago•11 comments

Datadog's $65M/year customer mystery solved

https://blog.pragmaticengineer.com/datadog-65m-year-customer-mystery/
81•thunderbong•3h ago•20 comments

Researching LED Displays for the Time Circuits

https://www.partsnotincluded.com/researching-time-circuit-led-displays/
16•edent•3d ago•7 comments

Ask HN: 80s electronics book club; anyone remember this illustrator?

18•codpiece•2d ago•16 comments

CertMate – SSL Certificate Management System

https://github.com/fabriziosalmi/certmate
8•indigodaddy•1h ago•0 comments

Cloud-forming isoprene and terpenes from crops may drastically improve climate

https://www.smithsonianmag.com/science-nature/scientists-are-just-beginning-to-understand-how-life-makes-clouds-and-their-discoveries-may-drastically-improve-climate-science-180986872/
38•gsf_emergency_2•8h ago•29 comments

Printegrated Circuits: Merging 3D Printing and Electronics

https://spectrum.ieee.org/3d-printing-smart-objects
59•rbanffy•10h ago•21 comments

Reverse Engineering Vercel's BotID

https://www.nullpt.rs/reversing-botid
81•hazebooth•9h ago•12 comments

Asynchronous Error Handling Is Hard

https://parallelprogrammer.substack.com/p/asynchronous-error-handling-is-hard
29•hedgehog•1d ago•21 comments

Auth for B2B SaaS: it's not like auth for consumer software

https://tesseral.com/blog/b2b-auth-isnt-that-similar-to-b2c-auth
68•noleary•7h ago•38 comments

New proof dramatically compresses space needed for computation

https://www.scientificamerican.com/article/new-proof-dramatically-compresses-space-needed-for-computation/
166•baruchel•3d ago•90 comments