Skip to content

"Agent based class design" and "Zero-allocation continuations"

Photo of Phil Nash
Hosted By
Phil N. and 3 others
"Agent based class design" and "Zero-allocation continuations"

Details

This month we are privileged to welcome another overseas visitor: Odin Holmes. We also welcome back C++::London regular, Vittorio Romeo.

****

As ever, please also register on the SkillsMatter page

****

Agenda:

18:30 Pre-session networking/ drinks and getting that good seat at the front

19:00 Phil Nash << "Hello, World";

Brief intro and JetBrains license raffle."

19:10 Vittorio Romeo << "Zero-allocation continuations";

This talk shows an alternative design for future-like continuations that doesn't require any dynamic allocation or type-erasure, while still enabling users to build chains of parallel computations with intuitive constructs such as `.then(...)` and `when_all(...)`. The idea is to encode every step of the computation chain in the type of a final object, resulting in a very long type that represent the whole tree.

19:40 co_return;

A brief break while we change over speakers.

19:50 Odin Holmes << "Agent based class design, C++ with a robot glue gun";

Abstracting a set of functionalities into a class which provides a higher level interface often requires tough design decisions. Users who do not have the exact requirements for which the abstraction is optimized will suffer a syntactic or run time overhead as a result. Alexandrescu's famous "policy-based design" provides a mechanism to allow the user to extend and customize an existing abstraction in order to fine-tune its functionality for many different use cases. This is however limited to use cases where each policy more or less represents a compile time strategy pattern.

Alas, not everything is a strategy pattern. In this talk I will explore the viability of a more agent-pattern-like paradigm where each policy knows its requirements and publishes its capabilities. In this paradigm, glue code connecting any valid set of policies is automatically generated using template metaprogramming. This allows much more powerful customizations while maintaining static linkage.

---

About the speakers:

Vittorio is a C++ enthusiast from a young age, now with a BS in Computer Science from the "Università degli Studi di Messina". While following the evolution of the C++ standard and embracing the newest features, he worked on several open-source projects, including modern general-purpose libraries and free cross-platform indie games. Vittorio is an active member of the C++ community, speaking at many conferences and events. He currently maintains a YouTube channel featuring well-received modern C++11 and C++14 tutorials. When he's not writing code, Vittorio enjoys weightlifting and fitness-related activities, competitive/challenging computer gaming and good sci-fi movies/TV-series.

Odin spent much of his career doing electronic engineering work including programming micro controllers. At one point he got fed up with popular design practices and the technology stack in the embedded domain and decided to try to fix it. As it turns out that rabbit hole is deep and it leads to C++ template metaprogramming.
He is the founder of the kvasir.io (http://kvasir.io/) organization, a collection of libraries targeting modern C++ development on microcontrollers. He is a contributor to the brigand library and has spoken at many conferences.

Photo of C++ London group
C++ London
See more events
Skills Matter | Code Node
10 South Place EC2M 2RB · London