Loading…
CppCon 2019 has ended
Thursday, September 19 • 15:15 - 15:45
The Art of Breaking Things: a new tool for fighting against Hyrum’s law in the new world of concept-driven design

Log in to save this to your schedule and see who's attending!

The oft-cited Hyrum's law states that "with a sufficient number of users of an API, it does not matter what you promise in the contract: all observable behaviors of your system will be depended on by somebody." With the introduction of concepts as a language feature in C++20, generic programming is expected to make its way into more layers of software stacks than ever before. Employing concept-driven design across multiple layers of a software stack affords a number of new and innovative approaches to battling Hyrum's law. As more and more libraries are tested and deployed with contracts expressed through generic concepts, a new art of providing models of those concepts that stress the boundaries of the contracts they represent is emerging. Put simply, it's more important than ever to break things early and often.

Unlike interfaces based on concrete types and abstractions, where a single interface is generally tied to a single implementation (thus leading to leaking of implementation details into an implicit interface), concept-driven interface designs can more naturally provide multiple implementations that model a concept, and thus constrain the implicit interface to the overlap of those implementations. Designing and implementing sets of types that minimize this intersection is a crucial skill that should be in every advanced developer's toolbox, and yet it is rare to hear this "art of breaking things" addressed explicitly.

In this talk, we will examine the implementation of several common interfaces that can be expressed with concept-driven design, including ranges, futures, strings, spans, and executors. Within a typical set of contracts for these concept interfaces, we will work through the design and implementation of models for these concepts focused on breaking user code that unsafely widens these contracts. We will further motivate these examples with some real-world scenarios and weigh the importance of breaking things against other factors in generic library design. Finally, we will discuss how the ability to break things should feed back into the concept design process itself, leading to more robust and less implicit interfaces throughout your software stack.

Speakers
avatar for David Hollman

David Hollman

Senior Member of Technical Staff, Sandia National Labs
Dr. David S. Hollman has been involved in the ISO-C++ standard committee since 2016. He has been a part of a number of different papers in that time, including `mdspan`, `atomic_ref`, and—most prominently—executors and futures. Since finishing his Ph.D. in computational quantum... Read More →


Thursday September 19, 2019 15:15 - 15:45
Summit 8/9

Attendees (179)




Twitter Feed