Zum Inhalt springen

Deciphering Coroutines: A Visual Approach

Foto von Andreas Weis
Hosted By
Andreas W. und 3 weitere
Deciphering Coroutines: A Visual Approach

Details

On November 21st we have the great pleasure to welcome Andreas Weis to our user group. Andreas has been writing C++ code in many different domains, from real-time graphics, to distributed applications, to embedded systems. As a library writer by nature, he enjoys writing portable code and exposing complex functionalities through simple, richly-typed interfaces. Both of which C++ allows him to do extensively. Andreas is also one of the co-organizers of the Munich C++ User Group, which allows him to share this passion with others on a regular basis.

***
Abstract
Coroutines are a powerful addition to C++20, allowing developers to drastically simplify code for certain kinds of problems and be adapted to a wide range of different use cases. But anyone trying to familiarize themselves with them will quickly notice that this flexibility comes at a price: In their current state, C++ coroutines are notoriously difficult to learn and their tight integration with the compiler gives them a feel quite unlike any other feature in the language.

The goal of this talk is to give a sustainable introduction on how to read and reason about coroutine code. We will learn how all the different elements of the mechanism fit together and to distinguish the parts of the code that follow the new rules of coroutines from those that still follow the well known conventional rules of C++. We will approach this through the construction of a coroutine cheat sheet, a collection of diagrams that serve as visual maps for navigating the complexities of the feature. Special care is taken to provide visual cues that are easily recognizable later on, to compensate for the fact that learners tend to forget the numerous details of the mechanism very fast if they don't use it in their everyday coding.

To account for the complexity of the topic, this talk focuses exclusively on providing a comprehensive introduction to the coroutine syntax, without discussing any advanced use cases. However, with the knowledge obtained from this talk, attendees will be able to easily follow more advanced presentations of coroutines later on without getting lost in the technical details of its peculiar syntax.

***
Lightning Talk: The C++ range adaptor pipe operator is associative
Speaker: Jonas Greitemann

Abstract: At the last meetup, Tina Ulbrich showed us "How to rangify your code". In my lightning talk, I'll dig deeper into one of her examples, exploring how it can be generalized using ranges to arrive at an API that is both generic and hard to misuse, and I'll show how the associative property of the pipe operator for range adaptors makes this trivially easy for composite algorithms.

Bio: Jonas works at MVTec, an industrial machine vision company, building solutions for the integration of vision systems into automation processes using, among other things, ZeroMQ, MQTT, and OPC UA. In a former life, he studied physics and did some research in computational solid-state physics, where he fell in love with C++ and never looked back. Aside from modern C++, he's also interested in Rust.

***
Schedule:
19:00 (CET) -- Begin of the videostream
19:05 (CET) -- Lightning Talk by Jonas Greitemann
~19:20 (CET) -- Main talk by Andreas Weis

Photo of MUC++ group
MUC++
Mehr Events anzeigen
Online-Event
Dieses Event ist verstrichen