News for hackers. Stuff that matters.

mariusaeriksen

Re:Systems Programming at Twitter on Friday November 23, 2012 @10:26PM (#4824439)
> As for us, we've stopped using futures and promises for asynchronous > operations as we've found faster way to manage operations (our system > is written in C++11). The best is to design your system in a way that > you never have to wait/synchronize at all.

I think you've perhaps misunderstood: the futures described in the presentation are not at all like, say for instance std::future or java.util.concurrent.Future - that's why I called them "composable futures". `flatMap` is the key to great power.

Our systems, using this variant of a "future", do not wait or synchronize at all, as you describe.

Another thing that I highlight a lot in the presentation itself, but does not come through in the slides is that this doesn't really have anything to do with asynchronous IO at all, it has to do with composing your operations from smaller operations. It's possible to use asynchronous IO (as we do—with asynchronous operations throughout, and with no waiting), but that is not necessary. The important bit is this: composing larger operations from smaller ones leads to inherently modular code; code that composes well within the context of larger systems. That's the important bit. That it is also easy to implement a performant execution system for this is gravy.

Re:Systems Programming at Twitter on Thursday November 22, 2012 @10:51PM (#4820915)
Hello from the author. Indeed the vernacular has changed, and “systems programming” refers also to the distributed systems server software.

Composable futures and promises are still fairly new in use; I would wager our systems are some of the largest using the techniques described therein.

While this talk focused on composable IO and services, there is much more to it. Finagle (https://github.com/twitter/finagle) is where the rubber meets the road. Its interfaces are described in these terms and it makes great use of their power.

Also, as with any talk, it is difficult to convey the message using only the slides.