Category: Science & Technology

Static Analysis and Program Safety in C++: Making it Real – Sunny Chatterjee – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
In this talk, I will explore how to leverage language rules and static analysis principles to provide safety guarantees in C++ at compile time, without compromising on its performance and memory efficiency. Modern analysis tools have come a long way since their inception and are much more powerful than traditional Lint-style checks. They use several techniques from theorem solvers to simple heuristics mimicking developer’s reasoning and can find deep semantic errors in programs. Furthermore, modern analysis tools take advantage of information available in types and type extensions in the language to bridge the gap across function boundaries, without incurring performance penalties of running global analyses. This makes them an indispensable part of the “shift left” experience to drive program safety. Throughout the talk, I will share my experience in developing and running these tools on large production codebases over the last decade and how they evolved over time. All the checks in the demo will be available for free in the community edition of Visual Studio and as security actions in GitHub.

---
Sunny Chatterjee

Sunny leads a team responsible for developing the core C++ static analysis engines in Visual Studio productivity experience as well as the traditional security tooling scenarios used widely within Microsoft. He has many years of experience in static analysis and enjoys delivering new productivity benefits to customers. His current focus is to lead efforts towards making C++ a safer systems programming language.

---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

Composable C++: Principles and Patterns – Ben Deane – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Programming consists of two activities:

1. Breaking down a problem in parts small enough to understand and implement.
2. Composing the parts to build up functionality and solve the original problem.

That second step is where complexity has an unfortunate tendency to show up,
time and time again.

In this talk, I will highlight some recipes and principles for crafting code that can be more beautifully composed. We'll see how to build on composition-friendly types and patterns and leverage them to achieve simpler code, and in turn how this allows us to use those composable pieces to solve not just the original problem but sibling problems.

I'll show useful techniques in crafting composable interfaces: at the function level, considering types; at the object level, considering patterns; at the larger structural level, considering hierarchies, traversal and execution choices. These techniques are equally applicable to "traditional" run-time polymorphic code and to code that uses compile-time polymorphism.

---
Ben Deane

Ben was a game programmer for over 20 years, working in C++ since the late 90s, for companies like EA and Blizzard. In 2018 he left the games industry to join Quantlab, an automated trading firm, where he writes modern, well-performing C++. He likes to play with algorithms, and to make the type system work for him, and he’s always looking for useful new techniques. Ben is the presenter of several previous C++Now and CppCon talks.

---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

Bringing Existing Code to CUDA Using constexpr and std::pmr – Bowie Owens – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
The options pricing library I work on at CSIRO is both computationally intensive and highly mathematical – a perfect fit for improving performance by moving calculations to the GPU. In this talk I will discuss my experience adjusting our existing code to use CUDA and some lessons learned along the way.

Adjusting existing code to use CUDA is not yet as simple as recompiling with the Nvidia compiler. There are two primary constraints that working with the GPU imposes. First, the GPU cannot access just any memory address. Second, the GPU cannot execute just any function in your program. These constraints can make it difficult to use code that was not designed with the GPU in mind with CUDA.

In this talk I will first address the constraints on memory layout that working with the GPU imposes. I will then show how I adjusted data-structures and used std::pmr to place data within GPU accessible memory. Next, I will discuss the constraints created by only being able to call on the GPU functions annotated with __device__. I will then show how the CUDA feature for treating constexpr functions as __device__ functions makes it easier to get code running on the GPU and debugging it once it is there. Lastly, I will compare the performance of calculations done on the CPU vs CUDA.

If you are considering porting existing code to CUDA, by the end of the talk you should have a better idea of the impediments to running that code on the GPU and high level details of the strategy I used to overcome those impediments.

---
Bowie Owens

Bowie Owens is a software developer working at Data61, a part of the Australian government funded research organisation CSIRO. The team he works in develops complex mathematical models for pricing financial options. The software developed at Data61 is integrated into a larger trading and risk management system that is used by hundreds of financial institutions around the world.

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

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

The Preprocessor: Everything You Need to Know and More! – Brian Ruth – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---

As much as we try to make it go away, the preprocessor is still here. It is used by many libraries and extensively throughout legacy code. And, in some cases, it is still the best tool to get the job done. In this talk, we will review the C and C++ preprocessor directives, where the abilities of the preprocessor differ between the two languages, and the modern C++ attempts to replace those directives. When this talk is completed, you should be more comfortable both debugging and modernizing preprocessor usage in your code.
---
Brian Ruth

Brian has been programming in C++ for 20+ years; working for both small and large companies on a wide variety of projects and technologies. For over a decade he worked with neuroscience researchers and created high speed acquisition, analysis and visualization software. He is currently a senior software engineer at Garmin, developing embedded devices and migrating legacy modules to C++. When he isn’t knee deep in code, he is enjoying a home brewed beer or building some furniture. He has been a volunteer at CppCon since 2015.

---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

C++ to the RISCue! A Practical Guide for Embedded C++20 – Kris Jusiak – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Embedded developers don't have to settle/suffer anymore due to ancient toolchains' support!

There are tools available that let you use C++20 in embedded systems to gain real performance benefits.

Moreover, these tools are available ONLINE and include hardware simulators,
which makes it very easy to get started without spending a lot of money or time to gear up.

In this case study, we will take a look into a full Software Development (including testing/simulation) for Embedded devices with C++20.

And we will do it fully using only ONLINE tools with reusable source code for popular microcontrollers.

Let's get ready for ARMing developers with C++20 at CppCon-2021!

---
Kris Jusiak

Kris is a Software Architect passionate about programming and who has worked in different industries over the years including telecommunications, games and most recently finance for Quantlab Financial, LLC. He has an interest in modern C++ development with a focus on performance and quality. He is an open-source enthusiast with multiple open-source libraries where he uses template meta-programming techniques to support the C++ rule - "Don't pay for what you don't use" whilst trying to be as declarative as possible with a help of domain-specific languages. Kris is also a keen advocate of extreme programming techniques, Test/Behavior Driven Development and truly believes that 'the only way to go fast is to go well!'.

---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

Back to Basics: Templates (part 2 of 2) – Bob Steagall – CppCon 2021

  • Lobby
  • Science & Technology

Part 1: https://youtu.be/q2gDZgp8B9o
https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Generic programming is powerful idiom for building reusable software components whose behavior can be tailored (parametrized) at compile time. The C++ language supports generic programming with templates, which are at the heart of the Standard C++ Library and the basis of many popular libraries like Eigen, JUCE, POCO C++, and Boost.

This two-part series begins with a brief overview of generic programming and why it is so important and useful in modern C++. We'll look at how C++ templates support generic programming, and provide some examples of the kinds of templates most likely to be encountered: function templates, class templates, alias templates, and variable templates. We'll then provide some practical tips for using templates, debugging template code, and structuring code that contains your own templates.

After that, we'll define and discuss the most important aspects of templates, such as parameters and arguments, substitution and instantiation, specialization, qualification, two-phase translation, non-type parameters, the one-definition rule, linkage, and more. Finally, we'll take a look at some slightly more advanced topics like variadic templates, type traits, tag dispatch, and the new lambda template feature in C++20.

These sessions are for C++ programmers seeking a tutorial or refresher on template fundamentals. If you've avoided templates in the past, or felt a little intimidated by them, or want to gain a better understanding of how templates work and how to use them on a daily basis, then this series is for you. Attendees will leave with a basic understanding of what C++ templates are, how they support perform generic programming, the most common kinds of C++ templates and their uses, the fundamental concepts underlying templates, important template terminology, and how to use and write basic templates in everyday code.

---
Bob Steagall
Program Chair, KEWB Computing

---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

Back to Basics: Templates (part 1 of 2) – Bob Steagall – CppCon 2021

  • Lobby
  • Science & Technology

Watch Part 2: https://youtu.be/FfI6Lov1O9M
https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Generic programming is powerful idiom for building reusable software components whose behavior can be tailored (parametrized) at compile time. The C++ language supports generic programming with templates, which are at the heart of the Standard C++ Library and the basis of many popular libraries like Eigen, JUCE, POCO C++, and Boost.

This two-part series begins with a brief overview of generic programming and why it is so important and useful in modern C++. We'll look at how C++ templates support generic programming, and provide some examples of the kinds of templates most likely to be encountered: function templates, class templates, alias templates, and variable templates. We'll then provide some practical tips for using templates, debugging template code, and structuring code that contains your own templates.

After that, we'll define and discuss the most important aspects of templates, such as parameters and arguments, substitution and instantiation, specialization, qualification, two-phase translation, non-type parameters, the one-definition rule, linkage, and more. Finally, we'll take a look at some slightly more advanced topics like variadic templates, type traits, tag dispatch, and the new lambda template feature in C++20.

These sessions are for C++ programmers seeking a tutorial or refresher on template fundamentals. If you've avoided templates in the past, or felt a little intimidated by them, or want to gain a better understanding of how templates work and how to use them on a daily basis, then this series is for you. Attendees will leave with a basic understanding of what C++ templates are, how they support perform generic programming, the most common kinds of C++ templates and their uses, the fundamental concepts underlying templates, important template terminology, and how to use and write basic templates in everyday code.

---
Bob Steagall
Program Chair, KEWB Computing

---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

Embracing User Defined Literals Safely for Types that Behave as though Built-in – Pablo Halpern

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
A fundamental design goal of C++ is to minimize the expressive differences between built-in types and user-defined types (UDTs). Just as we can overload `operator+` for our UDT, we can also specify a syntax for creating a value of that type; think `123_bigint` or `"[a-z]*"_regexp`. But just because we *can* overload an operator or create a user-defined literal (UDL), doesn't mean that we *should* do so. In this talk, we will cover the benefits of UDLS, several ways of defining them (each more powerful and complex than the one before), some best practices, and -- most importantly -- the pitfalls of defining one's own UDLs and when *not* to.

---
Pablo Halpern

Pablo Halpern has been programming in C++ since 1989 and has been a member of the C++ Standards Committee since 2007. His major contributions to the standard have been in the areas of parallel and vector programming constructs as well as on improvements to the usability of memory allocators. Pablo is a major contributor to the upcoming book, Embracing Modern C++ Safely by John Lakos and Vittorio Romeo (2021) and is the author of The C++ Standard Library from Scratch (2000). His current development focus is in moving the API of the open-source BDE library in the direction of the C++17 PMR allocator model. He lives with his partner in Boston, MA. When not working on books and allocators, he enjoys model rocketry, hiking, skiing, snowboarding, and watching opera.

---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

Beyond struct: Meta-programming a struct Replacement in C++20 – John Bandela – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
The humble struct. We all use it. We all bump up against its limitations, especially when trying to manipulate it at compile time.

What if I told you that C++20 has enough features that we can meta-program a struct replacement?

Want to have static, compile-time introspection?

Want to add and remove members with compile-time programming?

Want to have type deduction for members?

Want to easily convert from array of structures to structure of arrays (SOA) to optimize cache-friendly traversal?

C++20 allows us to do all these things and more!

No preprocessors, no macros, just standard C++.

Come join me as we explore the magic unleashed by C++20!

---
John Bandela

I first started programming in C++ at age 14 in 1994 when I cajoled my parents into buying me Visual C++ 1.0 for my birthday. It took a while, but as I learned the language, I decided I really liked C++. I attended the University of Florida and obtained my undergraduate degree in Computer and Information Science. During my undergraduate time, I created and submitted Boost.Tokenizer. I went on to medical school and neurosurgery residency, but decided to do something with a little less scary undefined behavior and returned to programming 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

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

Design Patterns: Facts and Misconceptions – Klaus Iglberger – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Design Patterns have proven to be useful over several decades and knowledge about them is still very important to design robust, decoupled systems. However, in recent decades a lot of misconceptions have piled up, many based on misunderstandings about software design in general and Design Patterns in particular.

This purpose of this talk is to help to separate facts from misconceptions. It explains what software design is, how Design Patterns fit in, and what an idiom is. Also, it addresses the following misconceptions about Design Patterns:

- Design Patterns are outdated and have become irrelevant;
- The GoF Design Patterns are nothing but idioms;
- The GoF Design Patterns are limited to object-oriented programming;
- ‘std::make_unique’ is a Design Pattern and helps to adhere to SRP;

After this talk, attendees will have a much deeper understanding of the art of software design and about the purpose of Design Patterns.

---
Klaus Iglberger

Klaus Iglberger is a freelancing C++ trainer and consultant. He has finished his PhD in computer science in 2010 and since then is focused on large-scale C++ software design. He shares his experience in popular advanced C++ courses around the world (mainly in Germany, but also the EU and US). Additionally, he is the initiator and lead designer of the Blaze C++ math library (https://bitbucket.org/blaze-lib/blaze/src/master/) and one of the organizers of the Munich C++ user group (https://www.meetup.com/MUCplusplus/).

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

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology