Build Your Own Async

David Beazley · 59K views · 2019 · 2:12:42

Open on YouTube

Python, Ruby & scripting languagesSoftware practice, open source & careerstutorial

Why Hacker News recommends it

HN people recommend it as the best way to understand what async machinery actually does under the covers.

What it is

David Beazley's workshop screencast builds asynchronous programming in Python from scratch, starting from callbacks and continuations and replacing threads to show how concurrency works underneath.

Recommended by 4 HN commenters across 3 different months, 2020 to 2023.

What Hacker News said

Strong rec devxpy · 2020-05 · on “Linux containers in a few lines of code”

Yes, something like that. Like here's David's "Build Your Own Async" [1], which I prefer over Philip's (still extremely good) "What the heck is the event loop anyway?" [2]. It's one thing to tell how something works, but to successfully show what the hell its actually doing under the covers, just conveys much more information. [1] [this video] [2] [LINK]

Strong rec migueloller · 2020-05 · on “Guide to Concurrency in Python with Asyncio”

I've found this [1] screencast on the low-level principles of async in Python an amazing resource to understand async at a deep level. [1] [this video]

Recommends neoncontrails · 2022-03 · on “Pre-Allocated Lists in Python”

I highly recommend Victor Skvortsov's exhaustive, 12-part series, "Python Behind the Scenes," a deep dive into the implementation details of just about every Python language feature one could possibly take for granted. There isn't a single one I haven't learned something from, but some of my personal favorites include: * Part 2, How the CPython compiler works: [LINK] * Part 6, How Python's object system works: [LINK] * Part 10, How Python dictionaries work: [LINK] * Part 13: The GIL and its effects on Python multithreading: [LINK] The whole series can be found here: [LINK] For a slightly higher-level (i.e., no macabre, low-level C code), but still incredibly enlightening dive into the "dark

Recommends mananaysiempre · 2023-09 · on “Philosophy of Coroutines”

> I talk about generators as if they were the coroutine system in Python, but in fact, they’re one of two: Python also has a completely different kind of thing that it actually uses the name ‘coroutine’ for, in which function definitions start with async def and suspend with await . The async and await system of coroutines in Python is in fact layered on top of the yield system, via an intermediate construct called yield from —which isn’t even technically required, it’s just that implementing it as a loop passing values through from and to the subcoroutine is exceptionally tedious if done correctly[1] and can’t be abstracted as a function call. As a first approximation, await x in Python is