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

Comments

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

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

Multiprocessing all the way!

emmelaich•6mo ago
(2021)

Good article!

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

Show HN: Boing

https://boing.greg.technology/
158•gregsadetsky•3h ago•29 comments

Zigbook Is Plagiarizing the Zigtools Playground

https://zigtools.org/blog/zigbook-plagiarizing-playground/
98•todsacerdoti•3h ago•13 comments

Bazzite: The next generation of Linux gaming

https://bazzite.gg/
344•doener•8h ago•219 comments

Meshtastic

https://meshtastic.org/
105•debo_•5h ago•23 comments

All it takes is for one to work out

https://alearningaday.blog/2025/11/28/all-it-takes-is-for-one-to-work-out-2/
458•herbertl•10h ago•227 comments

Jiga (YC W21) Is Hiring Product Designer

https://www.ycombinator.com/companies/jiga/jobs/Cco7vyK-product-designer-remote-europe
1•grmmph•4m ago

Landlock-Ing Linux

https://blog.prizrak.me/post/landlock/
169•razighter777•9h ago•59 comments

Learning Feynman's Trick for Integrals

https://zackyzz.github.io/feynman.html
167•Zen1th•11h ago•19 comments

The HTTP Query Method

https://www.ietf.org/archive/id/draft-ietf-httpbis-safe-method-w-body-14.html
120•Ivoah•3d ago•55 comments

Americans no longer see four-year college degrees as worth the cost

https://www.nbcnews.com/politics/politics-news/poll-dramatic-shift-americans-no-longer-see-four-y...
191•jnord•8h ago•267 comments

Blender facial animation tool. What else should it do?

https://github.com/shun126/livelinkface_arkit_receiver/wiki
65•happy-game-dev•2d ago•12 comments

Scala

https://www.huygens-fokker.org/scala/
53•onestay42•7h ago•10 comments

A new Little Prince museum has opened its doors in Switzerland

https://www.lepetitprince.com/en/events-around-the-world/a-new-little-prince-museum-has-opened-it...
41•gnabgib•6h ago•14 comments

Datacenters in space aren't going to work

https://taranis.ie/datacenters-in-space-are-a-terrible-horrible-no-good-idea/
231•mindracer•16h ago•200 comments

Show HN: Nano PDF – A CLI Tool to Edit PDFs with Gemini's Nano Banana

https://github.com/gavrielc/Nano-PDF
122•GavCo•10h ago•28 comments

Matrix Core Programming on AMD CDNA Architecture

https://rocm.blogs.amd.com/software-tools-optimization/matrix-cores-cdna/README.html
16•salykova•4d ago•2 comments

Be Like Clippy

https://be-clippy.com/
260•Aloha•11h ago•167 comments

Rare X-ray images of a 4.5-ton satellite that returned intact from space

https://www.empa.ch/web/s604/eureca-satellit-mit-roentgenmethoden-untersucht
78•giuliomagnifico•3d ago•12 comments

Leak confirms OpenAI is preparing ads on ChatGPT for public roll out

https://www.bleepingcomputer.com/news/artificial-intelligence/leak-confirms-openai-is-preparing-a...
612•fleahunter•19h ago•557 comments

Our Phosphorescent World

https://aeon.co/essays/the-cycling-of-phosphorus-is-the-basis-for-all-life-on-earth
7•the-mitr•5d ago•0 comments

Testing shows automotive glassbreakers can't break modern automotive glass

https://www.core77.com/posts/138925/Testing-Shows-Automotive-Glassbreakers-Cant-Break-Modern-Auto...
108•surprisetalk•15h ago•117 comments

An update on the Farphone's battery

https://far.computer/battery-update/
77•louismerlin•1d ago•52 comments

The Origins of Scala (2009)

https://www.artima.com/articles/the-origins-of-scala
66•todsacerdoti•11h ago•37 comments

Show HN: Network Monitor – a GUI to spot anomalous connections on your Linux

110•grigio•5d ago•42 comments

Anthony Bourdain's Lost Li.st's

https://bourdain.greg.technology/
262•gregsadetsky•4d ago•82 comments

Hardening the C++ Standard Library at scale

https://queue.acm.org/detail.cfm?id=3773097
140•ndesaulniers•1w ago•61 comments

Zero knowlege proof of compositeness

https://www.johndcook.com/blog/2025/11/29/zkp-composite/
101•ColinWright•13h ago•32 comments

A new myth appeared during the presidential campaign of Andrew Jackson

https://www.historynewsnetwork.org/article/self-made
30•Petiver•4d ago•63 comments

Stopping bad guys from using my open source project (feedback wanted)

https://evanhahn.com/stopping-bad-guys-from-using-my-open-source-project/
63•emschwartz•5h ago•102 comments

Student perceptions of AI coding assistants in learning

https://arxiv.org/abs/2507.22900
76•victorbuilds•12h ago•99 comments