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.

Linux Sandboxes and Fil-C

https://fil-c.org/seccomp
31•pizlonator•1h ago•2 comments

Why Twilio Segment moved from microservices back to a monolith

https://www.twilio.com/en-us/blog/developers/best-practices/goodbye-microservices
113•birdculture•3h ago•80 comments

Closures as Win32 Window Procedures

https://nullprogram.com/blog/2025/12/12/
7•ibobev•21m ago•0 comments

Recovering Anthony Bourdain's (really) lost Li.st's

https://sandyuraz.com/blogs/bourdain/
63•thecsw•2h ago•16 comments

VPN location claims don't match real traffic exits

https://ipinfo.io/blog/vpn-location-mismatch-report
197•mmaia•4h ago•118 comments

I fed 24 years of my blog posts to a Markov model

https://susam.net/fed-24-years-of-posts-to-markov-model.html
65•zdw•3h ago•20 comments

I tried Gleam for Advent of Code

https://blog.tymscar.com/posts/gleamaoc2025/
220•tymscar•7h ago•122 comments

The Rise of Computer Games, Part I: Adventure

https://technicshistory.com/2025/12/13/the-rise-of-computer-games-part-i-adventure/
33•cfmcdonald•3h ago•4 comments

Cat Gap

https://en.wikipedia.org/wiki/Cat_gap
7•Petiver•3d ago•0 comments

Want to sway an election? Here’s how much fake online accounts cost

https://www.science.org/content/article/want-sway-election-here-s-how-much-fake-online-accounts-cost
100•rbanffy•3h ago•54 comments

Flat-pack washing machine spins a fairer future

https://www.positive.news/society/flat-pack-washing-machine-spins-a-fairer-future/
33•ohjeez•1h ago•8 comments

Useful patterns for building HTML tools

https://simonwillison.net/2025/Dec/10/html-tools/
220•simonw•3d ago•68 comments

Ask HN: How can I get better at using AI for programming?

174•lemonlime227•8h ago•216 comments

Cryptids

https://wiki.bbchallenge.org/wiki/Cryptids
83•frozenseven•1w ago•13 comments

Go Proposal: Secret Mode

https://antonz.org/accepted/runtime-secret/
148•enz•4d ago•61 comments

TigerBeetle as a File Storage

https://aivarsk.com/2025/12/07/tigerbeetle-blob-storage/
14•aivarsk•6d ago•1 comments

EasyPost (YC S13) Is Hiring

https://www.easypost.com/careers
1•jstreebin•6h ago

From Azure Functions to FreeBSD

https://jmmv.dev/2025/12/from-azure-functions-to-freebsd.html
58•todsacerdoti•5d ago•4 comments

Are we stuck with the same Desktop UX forever? [video]

https://www.youtube.com/watch?v=1fZTOjd_bOQ
88•joelkesler•5h ago•99 comments

What is the nicest thing a stranger has ever done for you?

https://louplummer.lol/nice-stranger/
273•speckx•2d ago•212 comments

Researchers seeking better measures of cognitive fatigue

https://www.nature.com/articles/d41586-025-03974-w
97•bikenaga•3d ago•27 comments

A Giant Ball Will Help This Man Survive a Year on an Iceberg

https://www.outsideonline.com/outdoor-adventure/exploration-survival/how-giant-ball-will-help-man...
29•areoform•8h ago•29 comments

Photographer built a medium-format rangefinder

https://petapixel.com/2025/12/06/this-photographer-built-an-awesome-medium-format-rangefinder-and...
158•shinryuu•1w ago•36 comments

Purdue University Approves New AI Requirement for All Undergrads

https://www.forbes.com/sites/michaeltnietzel/2025/12/13/purdue-university-approves-new-ai-require...
40•rmason•3h ago•29 comments

Using Python for Scripting

https://hypirion.com/musings/use-python-for-scripting
80•birdculture•5d ago•69 comments

GNU Unifont

https://unifoundry.com/unifont/index.html
321•remywang•1d ago•72 comments

A Lisp Interpreter Implemented in Conway's Game of Life (2021)

https://woodrush.github.io/blog/posts/2022-01-12-lisp-in-life.html
84•pabs3•20h ago•3 comments

Pig Video Arcades Critique Life in the Pen (1997)

https://www.wired.com/1997/06/pig-video-arcades-critique-life-in-the-pen/
7•naryJane•5d ago•2 comments

A 'toaster with a lens': The story behind the first handheld digital camera

https://www.bbc.com/future/article/20251205-how-the-handheld-digital-camera-was-born
76•selvan•5d ago•43 comments

Show HN: I made a spreadsheet where formulas also update backwards

https://victorpoughon.github.io/bidicalc/
231•fouronnes3•2d ago•108 comments