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

Comments

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

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

Multiprocessing all the way!

emmelaich•7mo ago
(2021)

Good article!

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

Adafruit: Arduino’s Rules Are ‘Incompatible With Open Source’

https://thenewstack.io/adafruit-arduinos-rules-are-incompatible-with-open-source/
105•MilnerRoute•12h ago•37 comments

Rio de Janeiro's talipot palm trees bloom for the first and only time

https://en.jardineriaon.com/The-talipot-palm-trees-of-Rio-de-Janeiro-bloom-for-the-first-and-only...
119•1659447091•1w ago•30 comments

Why proteins fold and how GPUs help us fold

https://aval.bearblog.dev/nvidiaproteins/
14•diginova•1h ago•1 comments

Arborium: Tree-sitter code highlighting with Native and WASM targets

https://arborium.bearcove.eu/
49•zdw•3h ago•10 comments

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

228•david927•14h ago•745 comments

The Whole App is a Blob

https://drobinin.com/posts/the-whole-app-is-a-blob/
41•valzevul•3h ago•6 comments

How well do you know C++ auto type deduction?

https://www.volatileint.dev/posts/auto-type-deduction-gauntlet/
29•volatileint•5d ago•17 comments

John Varley has died

http://floggingbabel.blogspot.com/2025/12/john-varley-1947-2025.html
41•decimalenough•4h ago•6 comments

The Problem of Teaching Physics in Latin America (1963)

https://calteches.library.caltech.edu/46/2/LatinAmerica.htm
26•rramadass•10h ago•7 comments

CapROS: Capability-Based Reliable Operating System

https://www.capros.org/
71•gjvc•6h ago•27 comments

Read Something Wonderful

https://readsomethingwonderful.com/
77•snorbleck•2h ago•12 comments

Unscii

http://viznut.fi/unscii/
23•Levitating•3h ago•0 comments

Elevated errors across many models

https://status.claude.com/incidents/9g6qpr72ttbr
292•pablo24602•9h ago•141 comments

Hashcards: A plain-text spaced repetition system

https://borretti.me/article/hashcards-plain-text-spaced-repetition
298•thomascountz•14h ago•137 comments

JSDoc is TypeScript

https://culi.bearblog.dev/jsdoc-is-typescript/
145•culi•11h ago•179 comments

SVG Fullstack Website

https://github.com/icitry/SVGWebsite
8•modinfo•2h ago•1 comments

An attempt to articulate Forth's practical strengths and eternal usefulness

https://im-just-lee.ing/forth-why-cb234c03.txt
47•todsacerdoti•1w ago•21 comments

In the Beginning was the Command Line (1999)

https://web.stanford.edu/class/cs81n/command.txt
131•wseqyrku•6d ago•62 comments

Rob Reiner has died

https://www.hollywoodreporter.com/movies/movie-news/rob-reiner-dead-harry-met-sally-princess-brid...
27•RickJWagner•3h ago•17 comments

Running on Empty: Copper

https://thehonestsorcerer.substack.com/p/running-on-empty-copper
48•the-needful•6d ago•41 comments

History of Declarative Programming

https://shenlanguage.org/TBoS/tbos_15.html
46•measurablefunc•8h ago•12 comments

SoundCloud just banned VPN access

https://old.reddit.com/r/SoundCloudMusic/comments/1pltd19/soundcloud_just_banned_vpn_access/
72•empressplay•4h ago•40 comments

2002: Last.fm and Audioscrobbler Herald the Social Web

https://cybercultural.com/p/lastfm-audioscrobbler-2002/
187•cdrnsf•10h ago•108 comments

Shai-Hulud compromised a dev machine and raided GitHub org access: a post-mortem

https://trigger.dev/blog/shai-hulud-postmortem
212•nkko•21h ago•129 comments

DARPA GO: Generative Optogenetics

https://www.darpa.mil/research/programs/go
41•birriel•7h ago•11 comments

Price of a bot army revealed across online platforms

https://www.cam.ac.uk/stories/price-bot-army-global-index
122•teleforce•15h ago•50 comments

Developing a food-safe finish for my wooden spoons

https://alinpanaitiu.com/blog/developing-hardwax-oil/
183•alin23•4d ago•113 comments

The Typeframe PX-88 Portable Computing System

https://www.typeframe.net/
107•birdculture•13h ago•33 comments

AI and the ironies of automation – Part 2

https://www.ufried.com/blog/ironies_of_ai_2/
232•BinaryIgor•17h ago•101 comments

Nvidia-backed Starcloud trains first AI model in space, orbital data centers

https://www.cnbc.com/2025/12/10/nvidia-backed-starcloud-trains-first-ai-model-in-space-orbital-da...
10•walterbell•1h ago•5 comments