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.

Haiku

https://www.haiku-os.org
95•tosh•1h ago•36 comments

Setting up a free *.city.state.us locality domain

https://fredchan.org/blog/locality-domains-guide/
253•speckx•3h ago•72 comments

Open Source Resistance: keep OSS alive on company time

https://ossresistance.com/
112•mikemcquaid•2h ago•43 comments

A History of IDEs at Google

https://laurent.le-brun.eu/blog/a-history-of-ides-at-google
50•laurentlb•4d ago•12 comments

Launch HN: Ardent (YC P26) – Postgres sandboxes in seconds with zero migration

https://www.tryardent.com/
20•vc289•52m ago•7 comments

S-100 Virtual Workbench

https://grantmestrength.github.io/S100/
46•rbanffy•1h ago•7 comments

Xs of Y – roguelike that names itself every run. Written in 4kLoC

https://github.com/nooga/xsofy
60•andsoitis•3d ago•17 comments

Reverting the incremental GC in Python 3.14 and 3.15

https://discuss.python.org/t/reverting-the-incremental-gc-in-python-3-14-and-3-15/107014
129•curiousgal•3d ago•39 comments

Leaving GitHub for Forgejo

https://jorijn.com/en/blog/leaving-github-for-forgejo/
391•jorijn•4h ago•210 comments

Heritability of human life span is ~50% when heritability is redefined

https://dynomight.net/lifespan/
42•surprisetalk•1d ago•19 comments

The US is winning the AI race where it matters most: commercialization

https://avkcode.github.io/blog/us-winning-ai-race.html
57•akrylov•3h ago•139 comments

An idiot's guide to lead optimisation for proteins

https://magnusross.github.io/posts/protein-lead-optimisation-1/
92•magni121•2d ago•7 comments

New stainless steel can survive conditions for hydrogen production in seawater

https://www.sciencedaily.com/releases/2026/05/260510030950.htm
238•HardwareLust•2d ago•104 comments

Preserving Fisher-Price Pixter

https://dmitry.gr/?r=05.Projects&proj=37.%20Pixter
162•dmitrygr•2d ago•36 comments

I moved my digital stack to Europe

https://monokai.com/articles/how-i-moved-my-digital-stack-to-europe/
674•monokai_nl•6h ago•456 comments

Restore full BambuNetwork support for Bambu Lab printers

https://github.com/FULU-Foundation/OrcaSlicer-bambulab
612•Murfalo•19h ago•274 comments

Googlebook

https://googlebook.google/
889•tambourine_man•1d ago•1474 comments

Substrate (YC S24) Is Hiring a Technical Success Manager

https://www.ycombinator.com/companies/substrate/jobs/T2fMBhD-technical-success-manager
1•kunle•5h ago

Show HN: Needle: We Distilled Gemini Tool Calling into a 26M Model

https://github.com/cactus-compute/needle
582•HenryNdubuaku•23h ago•168 comments

Deterministic Fully-Static Whole-Binary Translation Without Heuristics

https://arxiv.org/abs/2605.08419
271•matt_d•13h ago•64 comments

Kickstarter is forced to ban adult content by payment processors

https://kotaku.com/kickstarter-is-the-latest-platform-seemingly-forced-to-ban-adult-content-by-pa...
206•stalfosknight•2h ago•152 comments

50K Tahoe residents need power as utility eyes redirecting lines to data centers

https://fortune.com/2026/05/12/lake-tahoe-data-center-49000-residents-power-source/
77•cdrnsf•2h ago•68 comments

Web Server on a Nintendo Wii

http://wii.sjmulder.nl/
79•adunk•3d ago•25 comments

Using OR-Tools CP-SAT for Scheduling Problems

https://atalaykutlay.com/or-tools-cp-sat-for-scheduling-problems.html
58•akutlay•6h ago•22 comments

Nailing jelly to a wall: is it possible? (2005)

https://greem.co.uk/otherbits/jelly.html
43•microsoftedging•4d ago•14 comments

Why senior developers fail to communicate their expertise

https://www.nair.sh/guides-and-opinions/communicating-your-expertise/why-senior-developers-fail-t...
743•nilirl•1d ago•314 comments

How to make your text look futuristic (2016)

https://typesetinthefuture.com/2016/02/18/futuristic/
456•_vaporwave_•21h ago•57 comments

Cost of enum-to-string: C++26 reflection vs. the old ways

https://vittorioromeo.com/index/blog/refl_enum_to_string.html
41•sagacity•9h ago•52 comments

CERT is releasing six CVEs for serious security vulnerabilities in dnsmasq

https://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2026q2/018471.html
358•chizhik-pyzhik•23h ago•198 comments

Fragnesia Made Public as Latest Linux Local Privilege Escalation Vulnerability

https://www.phoronix.com/news/Linux-Fragnesia
20•mikece•1h ago•9 comments