Skip to content
0:00 / 0:00

#sans-io#hyper#http

Cory Benfield - Building Protocol Libraries The Right Way - PyCon 2016

PyCon 2016

15K subscribers • 8 videos on Hallway

YouTube
  • Recommended by 2 people: 2 on Hacker News.
  • Presented by Cory Benfield
  • Linked in the descriptionPyCon/2016-slides
  • An opinion. It argues one side of a question engineers disagree on.

Intermediate. Assumes working knowledge.

14K views10 years ago2 recommendations

Software designProgramming languagesAPI designSoftware architecturePython

Cory Benfield argues for separating protocol parsing from I/O to build highly reusable and framework-agnostic network libraries in Python.

Speaker: Cory Benfield One of the great strengths of the Python ecosystem is the enormous collection of powerful, flexible libraries. However, these libraries tend to suffer from one extremely common design flaw that mean that the work done is not easily re-usable or transferable. In this talk, we talk about how to build libraries that can be used as widely as possible, through the lens of the Python Hyper HTTP project. Slides can be found at: speakerdeck.com/pycon2016 and github.com/PyCon/2016-slides

Why it's here

2 people recommend this

What people say. Highly recommended for its explanation of the sans-I/O design pattern and separating protocol logic from I/O.

geoffton Hacker News • Recommends

On “Accidentally nonblocking”

Cory Benfield's PyCon talk last week, "Building Protocol Libraries the Right Way" ( link to 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…

mindcrashon Hacker News • Recommends

On “Ask HN: Separate Logic from IO”

In some cases it is very practical, even in other (non functional) programming languages. For example, link (and its accompanying talk link to 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.

u/ducdetronquitoin r/Zig • Mentions

On “I/O free HTTP/1.1 implementation for Zig 🦎”

Hi everyone ! It's been a month that I am working on *h11*, which is an I/O free HTTP/1.1 implementation for Zig. My intention is to pretty much port the original implementation made in Python by the people of python-hyper. If you are not familiar with I/O free implementation, I am just gonna directly quote the original authors: > h11 is a "bring-your-own-I/O" library; h11 contains no IO code whatsoever. This means you can hook h11 up to your favorite network API, and that could be anything you want: synchronous, threaded, asynchronous, or your own implementation of RFC 6214 -- h11 won't judge you.1 As of yet, the implementation is very far from being feature complete or spec complie…

dlosson Hacker News • Mentions

On “WinBtrfs – an open-source btrfs driver for Windows”

The above sans-io page links to this PyCon 2016 talk: Cory Benfield - Building Protocol Libraries The Right Way link to this video