Message Handling with Boolean Algebra

Message reception and dispatch is something common to many codebases. And deep down, we know that Boolean algebra underlies everything we do. But we seldom give it a second thought, or if we do, we probably dismiss it as trivial; something we learned in college and quickly outgrew.

This talk shows the unreasonable effectiveness of going back to basics and really understanding and unlocking the power of Boolean algebra in the design of a message handling library. We'll talk about separating message layout and semantics, how to match against messages for dispatch, and particularly how to compose and simplify constraints at compile time, in order to do the least at runtime. We'll also introduce Boolean implication and see a non-obvious application which is key to a generic approach. Finally we'll see how message matchers can be generically transformed using compile-time information, allowing complete flexibility of expression and maximum runtime performance.

Image

Ben Deane

Ben has been programming in C++ for this whole millennium. He spent just over 20 years in the games industry working for companies like EA and Blizzard; many of the games he worked on used to be fondly remembered but now he's accepted that they are probably mostly forgotten. After getting more interested in modern C++, in the teens he started giving internal company talks and then talks at various conferences, spreading ideas about types, algorithms and declarative and functional techniques.

In 2018 he left the games industry and worked in finance for a short spell, writing high-frequency trading platforms using the most modern C++ that compilers could support. Now he is a Principal Engineer at Intel where he puts monads inside your CPU.

When

July 21-24, 2024

LinkedIn

CppNorth Group