Cory Benfield - Building Protocol Libraries The Right Way - PyCon 2016
PyCon 20162 HN recommenders · recommended in 2 months, 2016-2024
15K views · 10 years ago · talk · evergreen
Cory Benfield's PyCon 2016 talk on building protocol libraries that can be reused widely, using the Python Hyper HTTP project as the example. He argues for separating protocol parsing from I/O.
HN points to it as the foundational argument for sans-I/O protocol library design.
1:13:53Raymond Hettinger, Keynote on Concurrency, PyBay 2017
SF Python
161K views • 9 years ago
49:54The Clean Architecture in Python
Next Day Video
114K views • 12 years ago
56:55Q&A with Guido van Rossum, Inventor of Python
Microsoft Reactor
28K views • 5 years ago
1:14:32Building Your Own Dynamic Language
Stanford
21K views • 18 years ago
32:17Nathaniel J. Smith - Trio: Async concurrency for mere mortals - PyCon 2018
PyCon 2018
30K views • 8 years ago
38:43Scalability at YouTube
Next Day Video
51K views • 14 years ago
2:12:42Build Your Own Async
David Beazley
60K views • 7 years ago
45:55Ruby Conf 12 - Boundaries by Gary Bernhardt
Confreaks
58K views • 13 years ago
27:29Stop Writing Classes
Next Day Video
962K views • 14 years ago
51:27Google I/O 2012 - Go Concurrency Patterns
Google for Developers
894K views • 14 years ago
44:38Joe Armstrong & Jeremy Ruston - Intertwingling the Tiddlywiki with Erlang | Code Mesh LDN 18
Code Sync
11K views • 7 years ago
42:44Armin Ronacher - A Python for Future Generations
EuroPython Conference
6K views • 9 years ago
1:07:41Modern Dictionaries by Raymond Hettinger
SF Python
150K views • 9 years ago
2:03:12Co-dfns Live Stream: Compiler Design and Architecture
Aaron Hsu (arcfide)
21K views • 9 years ago
57:05Keynote: Begin...End?
David Beazley
9K views • 5 years ago
41:06"Unison: a new distributed programming language" by Paul Chiusano
Strange Loop Conference
45K views • 7 years ago
4:57Rich Hickey rants about HttpServletRequest in 1080p: Death By Specificity from Clojure Made Simple
Fred Overflow
43K views • 6 years ago
46:10Understanding the Python GIL
David Beazley
127K views • 14 years ago
1:02:44DjangoCon 2008 Keynote: Cal Henderson
Google for Developers
125K views • 18 years ago
28:06MountainWest RubyConf 2014 - But Really, You Should Learn Smalltalk
Confreaks
27K views • 12 years ago
3 comments from Hacker News
The above sans-io page links to this PyCon 2016 talk: Cory Benfield - Building Protocol Libraries The Right Way ▶ this video
In some cases it is very practical, even in other (non functional) programming languages. For example, link (and its accompanying talk ▶ this video ) give some really great brainfood about the way currently all kinds of network protocols are implemented, and the benefits of separating the protocol (Logic) from the actual implementation (IO). You might also want to query Google or DDG for "Free monads" if you want to implement a similar layered approach in a functional language such as Scala or Haskell.
Cory Benfield's PyCon talk last week, "Building Protocol Libraries the Right Way" ( ▶ this video ), makes the argument that a large number of problems can be traced to not cleanly separating responsibilities of actually physically doing I/O and making semantic sense of the bytes. His primary worry was about reimplementing things like HTTP many times, once for each I/O framework (why do Twisted, Tornado, and asyncio all have their own HTTP implementation?). But it seems the same problem can be seen here: every single part of the code thinks it knows how to actually retrieve data from the network, so it interacts with the network on its own, causing nested polling and similar awkwardness. If every part of the event-processing code thinks it knows how to do network I/O, you have many more opportunities for getting network I/O wrong. If xterm were designed so that e.g. xevents() had only the responsibility of fetching bytes from the X socket and do_xevents() and everything else had only the responsibility of handling bytes from an buffer, there would be no temptation to poll in two different functions. Only one function would even know that the byte source is a socket; the rest just know about the buffer.