Loading…
This event has ended. Visit the official site or create your own event on Sched.
View analytic

Log in to bookmark your favorites and sync them to your phone or calendar.

•Metaprogramming and Reflection [clear filter]
Tuesday, September 26
 

4:45pm

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.

Speakers
avatar for Odin Holmes

Odin Holmes

CEO/CTO, Auto-Intern GmbH
Odin Holmes has been programming bare metal embedded systems for 15+ years and as any honest nerd admits most of that time was spent debugging his stupid mistakes. With the advent of the 100x speed up of template metaprogramming provided by C++11 his current mission began: teach... Read More →


Tuesday September 26, 2017 4:45pm - 5:45pm
Ferranti (403) Meydenbauer Center
 
Wednesday, September 27
 

2:00pm

Language support for compile-time reflection
For the past year or so, I have worked with Herb Sutter on language support for compile-time programming, reflection, metaclasses, and code injection for the C++ programming language. This talk will focus on the related language features of static reflection and projection. These features aim to help programmers work with source code as data, and in some limited ways, use that data to write software.

I plan to trace the evolution of this work from its original proposal to its current implementation in the Clang C++ compiler (two implementations, actually). In particular, I will discuss design criteria, decisions, and issues related to reflection and projection as we implemented and experimented with them. I will also discuss how our current approach is shaped by alternative proposals, community and committee feedback, and restrictions imposed by the C++ programming language itself (i.e., what can you do and what can't you do).

Speakers
AS

Andrew Sutton

Assistant Professor, The University of Akron
Andrew Sutton is an assistant professor at the University of Akron in Ohio where he teaches and conducts research at the intersection of Software Engineering and Programming Languages. Dr. Sutton helped design and implemented the Concepts Lite proposal for the C++ programming language. He is also the author of the Origin C++ Libraries, an experimental collection of generic libraries that supports ideas and research for generic programming. Dr. Sutton had previously worked as a postdoctoral researcher at Texas... Read More →


Wednesday September 27, 2017 2:00pm - 3:00pm
Colossus Theater Meydenbauer Center
 
Thursday, September 28
 

9:00am

Language Support for Metaprogramming in C++
For the past several years, I have been researching new languages to support safe and efficient network protocol processing, specifically for software-defined networking applications. The unfortunate outcome of that research is this conclusion: any language for that domain must also be a general purpose programming language. This is not an easy thing to do. Many of the language features I worked with simply generated expressions to compute packet and header lengths, read and write packet fields, and encode and decode entire packets. If we could do this in C++, I might not need an entirely new language. 

Over the past year, Herb Sutter and I have collaborated to work on language support for compile-time programming, static reflection, metaclasses, and code generation in the C++ programming language. These facilities completely eliminate the need for the external tools, metacompilers, and domain-specific languages on which we frequently rely to generate high-performance encoders and decoders in C++. 

In this talk, I will discuss how to use these evolving proposals to create facilities for encoding and decoding packets. In particular, I will discuss the background requirements of my work, the overall design of a network protocol library, and the reflection and generation facilities that implement the library.

Speakers
AS

Andrew Sutton

Assistant Professor, The University of Akron
Andrew Sutton is an assistant professor at the University of Akron in Ohio where he teaches and conducts research at the intersection of Software Engineering and Programming Languages. Dr. Sutton helped design and implemented the Concepts Lite proposal for the C++ programming language. He is also the author of the Origin C++ Libraries, an experimental collection of generic libraries that supports ideas and research for generic programming. Dr. Sutton had previously worked as a postdoctoral researcher at Texas... Read More →


Thursday September 28, 2017 9:00am - 10:00am
Atanasoff Hall Meydenbauer Center
 
Friday, September 29
 

1:30pm

Compile-time reflection, Serialization and ORM Examples
We will discuss what reflection is and how it can be implemented in Modern C++. The techniques used will include a mix of C++11/14 features (void_t, tuple, index_sequence, variadic templates, auto functions, decltype(auto), constexpr, type_traits, etc), classic C++ features, and macros.

We’ll use a couple of example libraries to show the essence and power of compile-time reflection and show how to simplify and improve their implementation with C++17 features such as inline variables, constexpr if, structure binding, fold expressions, and string_view.

The first example is a library that can serialize a struct into any of a variety of data formats, such as JSON, XML, MessagePack, or a custom format.

We’ll then apply the same techniques to implement an Object-Relational Mapping (ORM) library to serialize structs into the tables of any of a variety of databases, such as SQLite, MySQL, Postgres, etc.

We’ll discuss some of the challenges and limitations of these techniques and what features could be added to C++ to improve support for compile-time reflection.

Speakers
avatar for Yu Qi

Yu Qi

Technical Director, purecpp.org
Yu is a C++ programmer with 10 years experience who lives in Zhuhai, Guangdong province, China. He loves modern C++ and has founded an open source community ( http://www.purecpp.org/ ) to promote C++11/14 in China. His focus is distributed systems and he is the author of rest_rp... Read More →


Friday September 29, 2017 1:30pm - 2:30pm
Ferranti (403) Meydenbauer Center