“Modules” are a frequently requested and long-awaited feature by C++ programmers. In a nutshell, the idea is to have a direct language support for (a) expressing the boundaries and dependencies of a program component; (b) isolating source codes from macro vagaries; (c) scaling compile time, especially for large projects, given the ubiquity of “headers-only” template libraries; (d) spur innovation and deployment of semantics-aware developer tools.
This presentation will focus on three major points: (1) the design of the module proposal currently being considered by the C++ standards committee (design goals, properties, constraints); (2) implementations currently under way; and (3) early user experience and migration.
Modules directly address a problem (scalability) listed as one of the three major areas where C++17 is expected to significantly improve daily experience of the working C++ programmer. Naturally, this feature is also on the top ten list of C++17 functionalities Bjarne Stroustrup put forward in his “Thought on C++17.”The BBC micro:bit is a small micro-computer that will be handed out to a million kids in the UK to teach them programming. The students program the device using TouchDevelop, a web-based programming portal, featuring TouchDevelop-the-language, a statically-typed, JavaScript-inspired scripting language. The blessed toolchain for ARM Cortex-M0s, however, is C++. This talk will describe how we compile TouchDevelop to C++; more specifically, how we use C++11's features to make sure we do as little work as possible and let the C++ compiler handle most of it!
Transducers allow to express transformations on sequential inputs (like std::transform, std::filter, most of boost::range::adators [4] and more) in a way that is independent of the input source. They are simple high order functions agnostic of the notion of iterator or collection and can be combined by simple function composition. They can later be applied eagerly or lazily over iterators, but most interestingly, also to other kinds of "reactive" sources, like networked streams, inter-process channels or reactive observables (e.g. RxCpp [3]). Not only they provide an elegant decoupling between the "what" and the "how" and higher level of reuse, their implementation is often simpler and and more performant than similar boost::range adaptors.
Transducers were introduced in Clojure by Rich Hickey [2]. At Ableton we implemented them in C++ and released them as part of our Open Source modern C++ toolkit: Atria [1]. Our implementation introduces innovations of its own, like implementing state-full transducers without mutation, enabling further safety and reusability. We also use Eric Niebler's technique [5] to describe and check its concepts in standard compliant C++11.
In this session we will introduce the concept of transducers and how they can be implemented in modern C++. We will also cover some of the most interesting use-cases.
[1] https://github.com/AbletonAG/atria
[2] http://clojure.org/transducers
[3] https://github.com/Reactive-Extensions/RxCpp
[4] http://www.boost.org/doc/libs/1_58_0/libs/range/doc/html/range/reference/adaptors.html
[5] http://ericniebler.com/2013/11/23/concept-checking-in-c11/
One of the three major areas that C++17 is expected to address is “improving support for large-scale dependable software.” A general understanding of ‘dependable software’ is the notion that the product should reliably perform the task it was designed for, and when given erroneous inputs the program should not be allowed to blindly continue execution, thereby possibly causing serious harms. In another words, an abrupt program termination is preferable to an exploited program vulnerability.
“Contracts” are a language feature being considered by the ISO C++ standards committee for C++17. They offer a basic mitigation measure, and early containment mechanism, by allowing a C++ programmer express more formally (instead of just comments) in code the requirements of a function interface. They offer a complement to conventional static type checking, and move comments closer to mechanized scrutiny. This presentation will explore the design space, previous efforts, the importance of analysis tools (both static and dynamic), and how contracts provide greater integration and support.