notes: events/talks/kericonf26-d2-08-bull-keripy-async-architecture
This data as json
| path | title | type | status | classification | words | body |
|---|---|---|---|---|---|---|
| events/talks/kericonf26-d2-08-bull-keripy-async-architecture | Kent Bull: KERIpy Async Architecture (KERIConf 2026) | summary | v0.1 — 2026-10-15: drafted by Claude from the curated transcript; unread by Mark; marked partner on Mark's word 2026-10-21, paraphrase only, no quotation | partner | 796 | # Kent Bull: KERIpy Async Architecture (KERIConf 2026) **Abstract.** Kent Bull gave a developer-focused walk through the execution model of KERIpy, the Python reference implementation of KERI (Key Event Receipt Infrastructure), which runs on the HIO structured concurrency library. He explained what structured concurrency is, why it suits the code base, and how HIO's scheduler and tasks work, using KERIpy commands as examples. It is for developers who want to read, extend or contribute to KERIpy. ## Summary Bull set out to give developers a mental model of how KERIpy runs, enough to read the source, contribute, or guide an AI coding assistant. After polling the room, he defined the basic unit of structured concurrency as a cooperative, non-blocking coroutine, which HIO calls a Doer. Nothing should block: network and file input and output are handled in small chunks, and a coroutine that has to wait reschedules itself for the next cycle. He traced the idea to Edsger Dijkstra's 1968 letter on the goto statement and to Nathaniel J. Smith's essays on structured concurrency, which argue that promises, callbacks, go statements and async/await are forms of goto that break abstractions. He noted that Samuel Smith's HIO and Charles Lowell's JavaScript library Effection both cite those essays, and recommended the companion essays on timeouts, cancellation and interrupts. HIO has three main concepts: the Doist, the root scheduler; the DoDoer, which aggregates child tasks and is also a task; and the Doer, the basic task. The central guarantee is that program flow follows lexical scope: tasks started in a scope finish or are canceled before the scope returns, children cannot outlive parents, and failures, cancellations and exceptions propagate up the task tree to be handled at any level. He compared HIO with Trio, Curio and Java's approach, called HIO the most intuitive Python library of its kind though not the most polished, and argued that adding async/await to Python was a missed chance to adopt structured concurrency. He said it is unfamiliar rather than difficult. Turning to the code, he showed that the Doist keeps its own sense of elapsed time for deterministic scheduling and contains the only sleep in the system, and said an AI assistant's failure to grasp this cost him a debugging session and some tens of dollars in tokens. Starting from the KLI (KERI command-line interface) incept command, he followed the entry point to runController, which sets a cycle of one thirty-second of a second and starts the Doist. Every Doer has enter and exit methods for setting up and releasing resources, plus recur for its work; recur returns false to keep running and true when done, and a generator-based recur is driven with yield from. He used the database migration Doer as a simple example that would be cleaner with its setup in enter and its cleanup in exit. He explained why KERIpy uses doify so often: a DoDoer's recur does not accept yield from, so doify wraps a function so that steps can be written in sequence in one scope. He said he would prefer DoDoer to support this directly, while Samuel Smith favors splitting each step into its own Doer under a hierarchical state machine; Bull described trying Smith's approach in the did:webs tests and called it a trade-off. He showed Effection code in TypeScript as a comparison, including wrapping promises at the edge of an application, and briefly explained the priming yield found throughout KERIpy before time ran out. ## Key terms structured concurrency, HIO, Doist, DoDoer, Doer, lexical scope, enter, recur and exit, doify, tock, generator priming, Effection ## Claims and their evidence - In HIO, tasks started in a scope complete or are canceled before that scope returns, and errors and cancellations propagate up the task tree. [informative] - The Doist keeps its own elapsed time for deterministic scheduling and holds the only sleep in the runtime. [informative] - A Doer's recur runs until it returns true, and a generator-based recur is driven with yield from, which a DoDoer's recur does not support. [informative] - KERIpy's command-line entry point runs the root scheduler at 32 cycles a second. [informative] - An AI coding assistant misread HIO's internal time model and cost the speaker tens of dollars in tokens. [presenter-reported] ## Related HIO and KERIpy; Samuel Smith's design of HIO; Nathaniel J. Smith's essays on structured concurrency and his Trio library; David Beazley's Curio; Charles Lowell's Effection; Edsger Dijkstra's letter on the goto statement; Luciano Ramalho's Fluent Python chapter on coroutines; the did:webs repository; the speaker's KERIA wallet talk the previous day. ## Provenance Drafted by Claude on 2026-10-15 from the curated transcript (d2-08-kent-bull-keripy-async-architecture.md), all of it (about 39 minutes). The talk ran out of time before its final sections. No quotations; paraphrase only. Not yet read by Mark. |
Links from other tables
- 1 row from summary in resources