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

Comments

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

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

Multiprocessing all the way!

emmelaich•8mo ago
(2021)

Good article!

punnerud•8mo 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•8mo 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•8mo ago
How does the GIL come into play here?
punnerud•8mo 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: Sweep, Open-weights 1.5B model for next-edit autocomplete

https://huggingface.co/sweepai/sweep-next-edit-1.5B
94•williamzeng0•6h ago•16 comments

From stealth blackout to whitelisting: Inside the Iranian shutdown

https://www.kentik.com/blog/from-stealth-blackout-to-whitelisting-inside-the-iranian-shutdown/
38•oavioklein•5h ago•1 comments

Threat actors expand abuse of Microsoft Visual Studio Code

https://www.jamf.com/blog/threat-actors-expand-abuse-of-visual-studio-code/
106•vinnyglennon•5h ago•58 comments

Show HN: ChartGPU – WebGPU-powered charting library (1M points at 60fps)

https://github.com/ChartGPU/ChartGPU
552•huntergemmer•15h ago•159 comments

Binary fuse filters: Fast and smaller than xor filters (2022)

https://arxiv.org/abs/2201.01174
77•redbell•4d ago•4 comments

Claude's new constitution

https://www.anthropic.com/news/claude-new-constitution
386•meetpateltech•13h ago•381 comments

Show HN: TerabyteDeals – Compare storage prices by $/TB

https://terabytedeals.com
121•vektor888•8h ago•70 comments

Show HN: High speed graphics rendering research with tinygrad/tinyJIT

https://github.com/quantbagel/gtinygrad
10•quantbagel•2h ago•3 comments

Skip is now free and open source

https://skip.dev/blog/skip-is-free/
351•dayanruben•14h ago•156 comments

Lix – universal version control system for binary files

https://lix.dev/blog/introducing-lix/
26•onecommit•6h ago•8 comments

Show HN: Rails UI

https://railsui.com/
144•justalever•11h ago•83 comments

Show HN: Open-source certificate from GitHub activity

https://certificate.brendonmatos.com
22•brendonmatos•3d ago•7 comments

Letting Claude play text adventures

https://borretti.me/article/letting-claude-play-text-adventures
101•varjag•5d ago•39 comments

TrustTunnel: AdGuard VPN protocol goes open-source

https://adguard-vpn.com/en/blog/adguard-vpn-protocol-goes-open-source-meet-trusttunnel.html
100•kumrayu•12h ago•26 comments

Show HN: RatatuiRuby wraps Rust Ratatui as a RubyGem – TUIs with the joy of Ruby

https://www.ratatui-ruby.dev/
104•Kerrick•4d ago•15 comments

Tell HN: 2 years building a kids audio app as a solo dev – lessons learned

85•oliverjanssen•16h ago•35 comments

Golfing APL/K in 90 Lines of Python

https://aljamal.substack.com/p/golfing-aplk-in-90-lines-of-python
63•aburjg•5d ago•13 comments

Beowulf's opening "What" is no interjection (2013)

https://www.poetryfoundation.org/poetry-news/69208/new-research-opening-line-of-beowulf-is-not-wh...
68•gsf_emergency_6•2d ago•50 comments

Convert potentially dangerous PDFs to safe PDFs

https://github.com/freedomofpress/dangerzone
135•dp-hackernews•7h ago•43 comments

Show HN: Differentiable Quantum Chemistry

https://github.com/lowdanie/hartree-fock-solver
19•lowdanie•4d ago•4 comments

The WebRacket language is a subset of Racket that compiles to WebAssembly

https://github.com/soegaard/webracket
114•mfru•4d ago•24 comments

SIMD programming in pure Rust

https://kerkour.com/introduction-rust-simd
78•randomint64•2d ago•32 comments

Jerry (YC S17) Is Hiring

https://www.ycombinator.com/companies/jerry-inc/jobs/QaoK3rw-software-engineer-core-automation-ma...
1•linaz•8h ago

Show HN: Dotenv Mask Editor: No more embarrassing screen leaks of your .env

https://marketplace.visualstudio.com/items?itemName=xinbenlv.dotenv-mask-editor
11•xinbenlv•5h ago•12 comments

Can you slim macOS down?

https://eclecticlight.co/2026/01/21/can-you-slim-macos-down/
204•ingve•22h ago•246 comments

Waiting for dawn in search: Search index, Google rulings and impact on Kagi

https://blog.kagi.com/waiting-dawn-search
256•josephwegner•12h ago•154 comments

Nested code fences in Markdown

https://susam.net/nested-code-fences.html
214•todsacerdoti•16h ago•72 comments

Challenges in join optimization

https://www.starrocks.io/blog/inside-starrocks-why-joins-are-faster-than-youd-expect
60•HermitX•12h ago•11 comments

Internet voting is insecure and should not be used in public elections

https://blog.citp.princeton.edu/2026/01/16/internet-voting-is-insecure-and-should-not-be-used-in-...
357•WaitWaitWha•4h ago•341 comments

I'll pass on your zoom call

https://operand.online/chronicle/pass.zoom
57•c4lliope•5h ago•39 comments