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.

Growing up in “404 Not Found”: China's nuclear city in the Gobi Desert

https://substack.com/inbox/post/182743659
437•Vincent_Yan404•11h ago•168 comments

A "Prime" View of HN

https://dosaygo-studio.github.io/prime-news/index.html
15•keepamovin•48m ago•9 comments

tc-ematch(8) extended matches for use with "basic", "cgroup" or "flow" filters

https://man7.org/linux/man-pages/man8/tc-ematch.8.html
10•hamonrye•1h ago•0 comments

Calendar

https://neatnik.net/calendar/?year=2026
741•twapi•12h ago•93 comments

Building a macOS app to know when my Mac is thermal throttling

https://stanislas.blog/2025/12/macos-thermal-throttling-app/
91•angristan•6h ago•42 comments

RustOCR – Now do OCR 5-10x faster than EasyOCR

https://crates.io/crates/rustocr
3•prabhatkr•28m ago•0 comments

Hungry Fat Cells Could Someday Starve Cancer to Death

https://www.ucsf.edu/news/2025/01/429411/how-hungry-fat-cells-could-someday-starve-cancer-death
89•mrtnmrtn•7h ago•24 comments

Replacing JavaScript with Just HTML

https://www.htmhell.dev/adventcalendar/2025/27/
566•soheilpro•16h ago•206 comments

Designing Predictable LLM-Verifier Systems for Formal Method Guarantee

https://arxiv.org/abs/2512.02080
16•PaulHoule•2h ago•2 comments

One year of keeping a tada list

https://www.ducktyped.org/p/one-year-of-keeping-a-tada-list
128•egonschiele•6d ago•40 comments

Never Use Pixelation to Hide Sensitive Text (2014)

https://dheera.net/posts/20140725-why-you-should-never-use-pixelation/
39•basilikum•1w ago•11 comments

Langfuse (YC W23) Is Hiring in Berlin, Germany

https://langfuse.com/careers
1•clemo_ra•6h ago

Floor796

https://floor796.com/
884•krtkush•1d ago•110 comments

Rex is a safe kernel extension framework that allows Rust in the place of eBPF

https://github.com/rex-rs/rex
114•zdw•5d ago•56 comments

Scientists discover beer bottle in the Mariana Trench (2024)

https://www.unilad.com/news/scientist-beer-bottle-deepest-point-ocean-mariana-trench-667878-20240213
30•thunderbong•1h ago•28 comments

How we lost communication to entertainment

https://ploum.net/2025-12-15-communication-entertainment.html
582•8organicbits•21h ago•323 comments

Streaming Uploads with LiveView

https://fly.io/phoenix-files/streaming-uploads-with-liveview/
6•m5r•6d ago•1 comments

2 in 3 Americans think AI will cause major harm to humans in the next 20 years [pdf]

https://www.pewresearch.org/wp-content/uploads/sites/20/2025/03/pi_2025.04.03_us-public-and-ai-ex...
61•randycupertino•1h ago•70 comments

Fathers’ choices may be packaged and passed down in sperm RNA

https://www.quantamagazine.org/how-dads-fitness-may-be-packaged-and-passed-down-in-sperm-rna-2025...
245•vismit2000•16h ago•152 comments

Learn computer graphics from scratch and for free

https://www.scratchapixel.com
15•theusus•6h ago•0 comments

Gpg.fail

https://gpg.fail
410•todsacerdoti•1d ago•247 comments

Dialtone – AOL 3.0 Server

https://dialtone.live/
90•rickcarlino•14h ago•44 comments

Last Year on My Mac: Look Back in Disbelief

https://eclecticlight.co/2025/12/28/last-year-on-my-mac-look-back-in-disbelief/
210•vitosartori•7h ago•141 comments

Rainbow Six Siege hacked as players get billions of credits and random bans

https://www.shanethegamer.com/esports-news/rainbow-six-siege-hacked-global-server-outage/
251•erhuve•22h ago•103 comments

The Origins of APL (1974) [video]

https://www.youtube.com/watch?v=8kUQWuK1L4w
46•ofalkaed•6d ago•7 comments

Functional programming and reliability: ADTs, safety, critical infrastructure

https://blog.rastrian.dev/post/why-reliability-demands-functional-programming-adts-safety-and-cri...
122•rastrian•17h ago•119 comments

Project Vend: Phase Two

https://www.anthropic.com/research/project-vend-2
164•kubami•6d ago•70 comments

Liberating Bluetooth on the ESP32

https://exquisite.tube/w/mEzF442Q4hUXnhQ8HmfZuq
117•todsacerdoti•19h ago•18 comments

Text rendering hates you (2019)

https://faultlore.com/blah/text-hates-you/
171•andsoitis•6d ago•71 comments

Windows 2 for the Apricot PC/Xi

https://www.ninakalinina.com/notes/win2apri/
152•todsacerdoti•23h ago•36 comments