Category: Uncategorized

What Can Compiler Benchmarks Reveal About Metaprogramming Implementation Strategies – Vincent Reverdy

https://cppcon.org/
---

What Can Compiler Benchmarks Tell Us About Metaprogramming Implementation Strategies in C++ - Vincent Reverdy - CppCon 2022
https://github.com/CppCon/CppCon2022

In 2022, how do modern compilers really deal with metaprogramming code? And as a consequence what are the best metaprogramming patterns to maximize compile-time performance? Optimizing application runtime is often guided by a mix of popular knowledge, expertise, and, when required, hard cold benchmarking data. Over the years, tools have been developed to help with this process and make the most of available computing resources. But what about the few situations where the compile-time itself is critical, like in the case of metaprogramming-heavy libraries intended to be used at the core of large projects? Does the niche knowledge accumulated over the years in this regard really match the hard cold data coming from compilers? Additionally, how do compilers behave when pushed to their absolute limits? And is there a lot of discrepancy between the behaviors of different compilers?

This talk is an exploration of all these questions and what it means in practice for implementations. We will see how to build reliable portable benchmarks for compilers using advanced metaprogramming constructs both in C++20 as well as in C++17 when legacy compatibility matters. We will dive, in particular, into the internals of a metabenchmarking library that has been designed to help with the compile-time generation of such benchmarks. To better understand the real limit of modern compilers when it comes to generative programming strategies, we used supercomputers to explore the parameter space of these benchmarks. In this talk, we will dissect the results together to see if the popular knowledge is reflected in the data. This will allow us to analyze, amongst other things, the real cost of class templates, function templates, generic lambdas, value-based metaprogramming, and concepts on compile-time for various compilers and various compiler versions. And, in many cases, we will see that the results can be very counter-intuitive.

The goal of this talk is to give a clear and up-to-date picture of what really matters for compile-time today. But beyond that, the goal is also to provide guidelines on implementation strategies and metaprogramming patterns when compile-time matters. Finally, it also constitutes an invitation to compiler writers to compare their tools when facing particularly ill-behaved situations.
---

Vincent Reverdy

Vincent Reverdy is a Full Researcher in Computer Science and Astrophysics at French Center for Scientific Research (CRNS) and located at the Annecy Laboratory for Particle Physics (LAPP) in the French Alps. He also is a member of the French delegation to the C++ Standards Committee. After a PhD at the Paris Observatory in 2014 on the topic of numerical cosmology and general relativity for which he explored extensively advanced metaprogramming techniques, he joined the University of Illinois at Urbana-Champaign in the US. There, he led an interdisciplinary research group in both computer science and computational astrophysics, trying to bridge the gap between programming languages and computational sciences. In late 2019 he moved back to France to continue to work on software architecture aspects related to astrophysics, and joined CNRS in January 2022 to lead long-term research aiming at building bridges between theoretical computer science including type theory and category theory on one side, and computational sciences with a focus on numerical astrophysics on the other side. Finally, as a member of the C++ committee, he has been working extensively on low-level programming components, including bit manipulation, as well as mathematical abstractions.
__

Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

#cppcon #programming #compiler

Filed under: UncategorizedTagged with: , , , , ,

Value Semantics: Safety, Independence, Projection, & Future of Programming – Dave Abrahams – CppCon 22

https://cppcon.digital-medium.co.uk/tag/cppcon/">cppcon.org/
---

C++ Value Semantics: Safety, Independence, Projection, and the Future of Programming - Dave Abrahams - CppCon 2022
https://github.com/CppCon/CppCon2022

Support for first-class user-defined value types may be among C++'s greatest strengths—one that most recent language designs have sadly failed to emulate. That said, although value types are everywhere in C++, we don't have a commonly accepted definition of “value semantics”, and we tend to use the phrase with only an intuitive idea of what it means. This talk offers a deeper understanding of value semantics, defining it in a way that in turn reveals surprising truths about cppcon.digital-medium.co.uk/tag/programming/">programming in general. We'll expose the value semantics that underlies our mental model even when we're “forced” to use pointers or references, and discuss how a future C++ might close that expressivity gap, improving safety, performance, and programmer confidence. We'll conclude with some guidelines you can use today to improve your programs, and propose the next must-see session for value semantics lovers.

This presentation lays groundwork for another talk, “Val wants to be your friend.” If you're interested in that talk, you'll want to see this one first.
---

Dave Abrahams

Dave Abrahams is a founding contributor of the Boost C++ Libraries project and the founder of the first annual C++ conference, BoostCon/C++Now. He is a contributor to the C++ standard, and was a principal designer of the Swift cppcon.digital-medium.co.uk/tag/programming/">programming language. He recently spent seven years at Apple, culminating in the creation of the declarative SwiftUI framework, worked at Google on the Swift for TensorFlow project and, briefly, on the Carbon language, and is now a principal scientist at Adobe's Software Technology Lab.
---

Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

#cppcon.digital-medium.co.uk/tag/cppcon/">cppcon #cppcon.digital-medium.co.uk/tag/programming/">programming #cpp

Filed under: UncategorizedTagged with: , , , ,

LLVM Optimization Remarks – Ofek Shilon – CppCon 2022

https://cppcon.org/
---

LLVM Optimization Remarks - Helping the Compiler Generate Better Code - Ofek Shilon - CppCon 2022
https://github.com/CppCon/CppCon2022

Optimization remarks are Clang's logs of optimization passes, which include leads into optimization failures that might be mitigated. Deciphering raw optimization remarks seems a matter for compiler authors and select few experts, but a little-known tool called opt-viewer aims to change that - in particular with recent improvements by myself and others.

About 50% of the talk would be dedicated to real examples of missed optimizations. Most turn out to be escape-analysis and alias-analysis related, and we will devote time to discuss these in some depth.

We will also extend the discussion to other compilers and even other languages. (you really can't have a C++ presentation in Sep 2022 without at least mentioning Rust and Carbon).

If you care about performance there's an excellent chance you'd leave this talk with immediately actionable insights and surprising ways to check and improve your code in performance bottlenecks.
---

Ofek Shilon

20Y C++ developer, writer and speaker in both the Linux and MS universes. Fascinated by compilers, debuggers and pretty much anything low level. Fiercely hated by his cat for no apparent reason.
---

Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

#cppcon #programming #llvm

Filed under: UncategorizedTagged with: , , , , ,

Modern C++: C++ Patterns to Make Embedded Programming More Productive – Steve Bush – CppCon 2022

https://cppcon.org/
---

Modern C++ to Impress Your Embedded Dev Friends - C++ patterns to make embedded programming more productive - Steve Bush - CppCon 2022
https://github.com/CppCon/CppCon2022

C++ is often talked about in terms of what cannot or should not be done in the context of embedded systems. In contrast, this talk is about some of the things that modern C++ idioms allow us to do better or more expressively than comparable operations in C. We will cover several patterns that allow an embedded developer to express intent clearly, ease maintenance, and encourage re-use while avoiding overheads that are costly in resource-constrained systems. Examples include initialization structures that are self-describing and IDE-friendly, small code implementations that make available sections of the C++ Standard Library for embedded use, and tools for understanding and controlling our use of limited memory resources.
---

Steve Bush

Steve is a Research Fellow at the consumer products manufacturer Procter & Gamble. He works in upstream research and development on smart and connected products, some of which have been featured at the company's LIfe Lab at the consumer electronics show CES. Though involved in all phases of embedded product development, much of his work revolves around embedded firmware development. Steve has been an advocate in his research community of modern programming practice, including the use of modern C++ to create more expressive, reusable firmware.
---

Videos Streamed & Edited by Digital Medium: http://online.digital-medium.co.uk

#cppcon #programming #embeddedsystems

Filed under: UncategorizedTagged with: , , , ,

Fast, High-Quality Pseudo-Random Numbers for Non-Cryptographers in C++ – Roth Michaels – CppCon 2022

https://cppcon.digital-medium.co.uk/tag/cppcon/">cppcon.org/
---

Fast, High-Quality Pseudo-Random Numbers for Non-Cryptographers in C++ - Roth Michaels - CppCon 2022
https://github.com/CppCon/CppCon2022

Many C++ developers reach for std::rand() the first time they need a pseudo-random number. Later they may learn of its downsides and include <random> to use the Mersenne Twister (std::mt19937) and various distributions from the standard library. For some the journey ends here, but for others questions arise: How should I properly seed my generators? How should I approach portability? Does std::mt19937 failing some statistical tests matter to me? Am I leaving performance on the table using std::mt19937? What quality do I need for my use-case and how can I get the best deterministic performance for that quality?

After a brief introduction to generating pseudo-random numbers with the C++ standard library this talk will look at answering these questions in digital audio applications; the same learnings could be applied elsewhere such as games, graphics, or some simulations. We will examine some benchmarks and quality analysis of standard library pseudo-random number generators and modern generators outside the standard. We will close with a demonstration of ways to make runtime-performance determinism improvements with minor quality loss over using standard library distributions.
---

Roth Michaels

Roth Michaels is a Principal Software Engineer at iZotope/Soundwide, an industry leader in real-time audio software for music production and broadcast/film post-production. In his current role on the Audio Research Team at iZotope's parent company, Soundwide, he is focused on developing new fast prototyping frameworks. When he joined iZotope, Roth was the lead library designer of a new internal cross-platform "Glass", part of which is now available as open-source. More recently in his former role as Mix/Master Software Architect, Roth helped develop the reference implementation to move iZotope's products to subscription and led the team that launched the company’s first SaaS offering for music producers. Roth studied music composition at Brandeis University and continued his studies in the Dartmouth Digital Musics program. Roth began his career in software development writing software for his own compositions, and the works of other composers and artists, and teaching MaxMSP to composers and musicians; both private instruction and designing university courses. Before joining iZotope, he was working as a consultant for small startups working on mobile applications specializing in location services and Bluetooth.
---

Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

#cppcon.digital-medium.co.uk/tag/cppcon/">cppcon #cppcon.digital-medium.co.uk/tag/programming/">programming #cpp

Filed under: UncategorizedTagged with: , , , ,

What’s New in Conan 2.0 C/C++ Package Manager – Diego Rodriguez-Losada – CppCon 2022

https://cppcon.org/
---

What's New in Conan 2.0 C/C++ Package Manager - Diego Rodriguez-Losada - CppCon 2022
https://github.com/CppCon/CppCon2022

During the 4+ years since Conan 1.0 was released, we have continued to learn from the C++ ecosystem as we watched it grow; learning many lessons, challenges and trends in the industry from the feedback from tens of thousands of conversations with users and customers, including many of the largest C++ related companies in the world. This talk summarizes some of these lessons, and how they have been used to create the new major version of Conan.

For example, while many advocate for header-only or always static linkage, the usage of shared libraries and especially shared libraries that link and embed other static libraries is a very common pattern in the industry. Conan 2 implements “requirement traits” that go beyond CMake private/public usage requirements, to allow specifying complex dependency graphs, including bootstrapping, cross-building with tools, private dependencies and much more.

Many teams produce libraries, applications, SDKs or other artifacts that need to be deployed or consumed by other teams with different technologies (like Java, Node, etc) and not using Conan. Conan 2 new “deployers”, which can be user defined, allow easy extraction of artifacts, as well as automation to create Debian packages, Windows installers or any other type of derived artifact.

There are many enterprise, very large C and C++, projects that need to manage binaries (Bills of Materials), not only to reduce build times, but also for traceability, security, industry policies, etc. Creating and managing binaries at scale is still a big challenge. Conan 2 provides much simpler “lockfiles” to allow full reproducibility of the dependency graph, a new custom user defined global binary compatibility mechanism, and a more accurate computation of what package binaries need to be rebuilt when some dependency changes.

Finally, we learned that package management is yet another piece in a larger DevOps, Continuous Integration, automation, and developer experience puzzle, and many users have been building different layers of automation over Conan. So Conan 2 releases a new public Python API (around 65% of users are already using Python for automation of C and C++), and new custom defined modular commands to extend the Conan CLI.
---

Diego Rodriguez-Losada

Diego Rodriguez-Losada‘s passions are robotics and SW engineering and development. He has developed many years in C and C++ in the Industrial, Robotics and AI fields. Diego was also a University (tenure track) professor and robotics researcher for 8 years, till 2012, when he quit academia to try to build a C/C++ dependency manager and co-founded a startup. Diego is a conan.io C/C++ package manager co-creator and maintainer, now working at JFrog as Conan Lead Architect and C/C++ Advocate.
---

Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

#cppcon #programming #conan

Filed under: UncategorizedTagged with: , , , ,

Killing C++ Serialization Overhead & Complexity – Eyal Zedaka – CppCon 2022

https://cppcon.org/
---

Killing C++ Serialization Overhead & Complexity - Eyal Zedaka - CppCon 2022
https://github.com/CppCon/CppCon2022

One of the hottest topics in C++ being data serialization, which is a major enabler for inter process communication, persisting the state of the program, or storing information in convenient way. That’s why there are countless data serialization frameworks out there, even ones made for cross programming-language communication.

When considering a serialization framework we face many considerations - convenience of use, performance, size of the library, size of the data, is the library applicable for embedded, support for cross language communication, build system dependencies (for those requiring to generate code in build time), and many more.

If I got you wondering about the above, and you are looking for some modern C++20 zero overhead macro-less serialization that requires close to nothing from you as a developer, together with almost unmatched performance, freestanding/embedded support out of the box, and a fair chance to blow your mind, this session is for you, hope to see you there!
---

Eyal Zedaka

Eyal Zedaka is a technical leader and C++ instructor, with more than 10 years of experience in C++, operating systems and device security. He is currently with Microsoft as principal manager, responsible for OS application sandboxing through virtualization. In the past, Eyal was manager of device security engineering of the Magic Leap augmented reality device, where he lead security features development and security research of the device, as well as the security architecture of the device and SoC from the requirement stage. Eyal designed C++ freestanding libraries for trusted execution environments, worked closely with embedded teams regarding C++ use in lower level areas. He has spoken at CppCon 2021 about using coroutines to implement C++ exceptions in freestanding environment and embedded systems.
---

Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

#cppcon #programming #serialization

Filed under: UncategorizedTagged with: , , ,

10 Tips for Cleaner C++ 20 Code – David Sackstein – CppCon 2022

https://cppcon.org/
---

10 Tips for Cleaner C++ 20 Code - David Sackstein - CppCon 2022
https://github.com/CppCon/CppCon2022

The objective of this session is to provide guidelines and tips that will help the audience write readable, testable and extensible code with modern C++.
One of the greatest challenges we face, as programmers, is to make sure that our code can be understood and used by our colleagues - and not only by the compiler.

As the complexity of C++ increases, the compiler is able to deduce and optimize more of our code, but often at the cost of making it more obscure for our colleagues.
Code that is difficult to read is difficult to test, to maintain and to extend.

In the session I propose to help the audience understand the core problems that we introduce as our programming becomes more advanced, and how we can avoid them.
The main part of the session will discuss some fairly complex and advanced C++ code which is difficult to understand. I will then demonstrate 10 easily applicable tips to make it easier to understand and to test. The benefits will be clearly evident.

There will also be a short discussion with the audience to increase the confidence that the guidelines and the tips are readily applicable in there own diverse projects.
---

David Sackstein

David is an experienced software programmer, consultant and instructor. His passion is to write readable, extensible and testable code and to help others do the same.
David leverages his broad background with a number of programming languages to achieve this goal in C++ too.
He has spoken at ACCU and at CppCon on coroutines and fibers and demonstrated how these tools can help simplify complex programs in C++.
__

Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

#cppcon #programming #cppprogramming

Filed under: UncategorizedTagged with: , , , , ,

C++ in the World of Embedded Systems – Vladimir Vishnevskii – CppCon 2022

https://cppcon.org/
---

C++ in the World of Embedded Systems - Vladimir Vishnevskii - CppCon 2022
https://github.com/CppCon/CppCon2022

The talk offers an introduction into the concepts, variety and architectural specifics of embedded systems and reviews the application of the C++ language and the ecosystem for embedded software development. With the focus on the modern C++ features and frameworks that can be leveraged in embedded projects the presentation will explore benefits along with potential implications and limitations of the C++ language utilization. Similarities between embedded and high-performance systems will be highlighted and general availability and applicability of the C++ for the development of embedded code will be assessed. Language features and program constructs that can introduce risks in embedded environments will be reviewed. Examples of the modern C++ software design under conditions of restricted dynamic memory allocation will be presented with focus on publicly available 3-rd party libraries developed for high-performance applications that can be used in embedded projects. Metaprogramming techniques for low-level hardware abstractions will be discussed.
---

Vladimir Vishnevskii

Vladimir is a software engineer with more than 17 years of experience applying C++ for development of complex software in areas like distributed systems and networking with focus on performance and reliability. Before his recent switch to Intel he was for more than 6 years part of the effort to bring modern C++ into automotive embedded software development.
---

Videos Streamed & Edited by Digital Medium: http://online.digital-medium.co.uk

#cppcon #programming #embeddedsystems

Filed under: UncategorizedTagged with: , , , , ,

Breaking Enigma With the Power of Modern C++ – Mathieu Ropert – CppCon 2022

https://cppcon.org/
---

Breaking Enigma With the Power of Modern C++ - Mathieu Ropert - CppCon 2022
https://github.com/CppCon/CppCon2022

During the Second World War, Alan Turing and his team at Bletchley Park used a very primitive computer to crack the German Enigma machine encryption and allow the Allies to read the Axis secret communications. To achieve this feat they used every trick in the book to reduce the problem to something that could be achieved by an early 1940s electro-mechanical computer.
What if we were nowhere as smart, but got readily access to a 16 cores 2020s CPU and modern C++?

In this talk, we will show a brief history of Enigma's design and cryptoanalysis at the time, and then will try to see if we can break it using a modern machine and some C++20. How many combinations can we try per second using all our cores and with the help of some micro-benchmarking?
---

Mathieu Ropert

French C++ expert working on (somewhat) historical video games. Decided to upgrade his compiler once and has been blogging about build systems ever since. Past speaker at CppCon, Meeting C++ and ACCU. Used to run the Paris C++ User Group. Currently lives in Sweden.
---

Videos Streamed & Edited by Digital Medium: http://online.digital-medium.co.uk

#cppcon #programming #cryptography

Filed under: UncategorizedTagged with: , , , , ,