Category: Science & Technology

Design Idioms from an Alternate Universe – Ivan Čukić – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
It is common to see different design idioms and patterns in different programming paradigms as they represent /the way/ something should be implemented in a given paradigm, and each paradigm is special enough for its way to be completely different to the way taken by the other ones.

While C++ is an one of a kind multiparadigm language, people tend to use object-oriented patterns with it most of the time. Generic and functional programming are also where C++ shines, so why avoid learning and using idioms from those two paradigms? People often think that they need to stick to a single paradigm not realizing that the true power lies in skillfully combining all of them.

This talk will present several software design idioms that people usually connect with generic and functional programming disciplines, but which are highly applicable to the usual code most of the contemporary C++ developers write every day.

---
Ivan Čukić

Dr Ivan Čukić is the author of “Functional Programming in C++” published by Manning.

He is a senior software engineer at KDAB. Also, one of the core developers in KDE for more than a decade, the largest free/libre open source C++ project.

---
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 Basics of Profiling – Mathieu Ropert – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
What to do when a program is slower than what we'd like? Where to start when trying to improve throughput, latency or responsiveness?

In this beginner friendly session we will introduce the two big families of profilers (sampling and instrumentation) and two tools my team uses almost every day when working on games: Optick and vTune.
Through a few concrete cases based on past experience we will study how to troubleshoot a performance problem using a profiler and how the code was improved.

We will illustrate a few classic cases such as inefficient algorithms, unsuitable data structures, I/O waits and bad concurrency.

If time allows we will also see how profilers such as vTune can be used to delve into micro-optimizations by looking at low level metrics such as cache misses and branch prediction.

---
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

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

Filed under: Science & Technology

Sums, Products, Exponents, Monoids, Functors, Oh My! – Steve Downey – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
This talk will outline various algebraic types and structures, such as sum product and exponential types, structures such as monoids and groups, and higher order structures such as functors and monads. In particular, we'll look at why an API designer should be aware of them and supply operations that respect these structures' laws. Doing so will help you provide predictable APIs that can be reused more widely.

---
Steve Downey

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

Filed under: Science & Technology

A Crash Course in Calendars, Dates, Time, and Time Zones – Marc Gregoire – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Before C++11, the C++ Standard Library did not have much support for working with time. C++11 changed all that and introduced the chrono library as part of the Standard Library. With its introduction, C++ gained a standard way to work with durations, clocks, and time points. It allows you to perform arithmetic operations with durations and time points, to convert between different units of time, and more. The library also comes with a number of clocks, including a high-resolution clock which makes it easy to quickly time how long a piece of code executes, e.g. for benchmarking, all without needing any additional libraries.
C++20 has extended the chrono library and added support for calendars, dates, and time zones. It allows you to represent specific days of a year, even something like the 3rd Monday of July or the last day of February, and to perform arithmetic operations with dates. Time can now be expressed in specific time zones, and, of course, converting time between different time zones is supported as well.

---
Marc Gregoire

Marc Gregoireis a software architect from Belgium. He graduated from the University of Leuven, Belgium, with a degree in "Burgerlijk ingenieur in de computer wetenschappen" (equivalent to a master of science in engineering in computer science). The year after, he received an advanced master’s degree in artificial intelligence, cum laude, at the same university. After his studies, Marc started working for a software consultancy company called Ordina Belgium. As a consultant, he worked for Siemens and Nokia Siemens Networks on critical 2G and 3G software running on Solaris for telecom operators. This required working in international teams stretching from South America and the United States to Europe, the Middle East, Africa, and Asia. Now, Marc is a software architect at Nikon Metrology (www.nikonmetrology.com), a division of Nikon and a leading provider of precision optical instruments, X-ray machines, and metrology solutions for X-ray, CT, and 3-D geometric inspection.

His main expertise is C/C++, specifically Microsoft VC++ and the MFC framework. He has experience in developing C++ programs running 24/7 on Windows and Linux platforms: for example, KNX/EIB home automation software. In addition to C/C++, Marc also likes C#.

Since April 2007, he has received the annual Microsoft MVP (Most Valuable Professional) award for his Visual C++ expertise.

Marc is the founder of the Belgian C++ Users Group (www.becpp.org), author of “Professional C++” 2nd, 3rd, 4th, and 5th Editions (Wiley/Wrox), co-author of “C++ Standard Library Quick Reference” 1st and 2nd editions (Apress), a technical editor for numerous books for several publishers, and a regular speaker at the CppCon C++ conference. He maintains a blog at www.nuonsoft.com/blog/ and is passionate about traveling and gastronomic restaurants.

---
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

Testing Compile-time Constructs in a Runtime Unit Testing Framework – Igor Bogoslavskyi – CppCon 21

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
C++ is used in many different areas, including in safety-critical applications. Coming from the automotive industry, we must conform to stringent safety standards (such as ISO 26262) which nudge developers away from dynamic dispatch and towards a safer and more static flavor of C++. However, following coding guidelines is not enough to write safe code; any program is only as safe as it’s testing suite is robust, so it is critical to have a solid testing framework and a watertight testing strategy.

There are multiple well-known frameworks for testing the code at runtime, such as GoogleTest, CPPUnit or Catch2, but as more and more work is done at compile-time, we believe that there is a need for a framework that also supports testing compile-time constructs. We believe that with the increasing use of static assertions, SFINAE and, soon, contracts, these compile-time constraints become part of the user-facing API and must be rigorously tested as well. As an example, consider a function which is part of the user-facing API with a static assertion in it to ensure that it can only be called with a certain set of types. With the existing testing frameworks there is no way to test that this function would _not_ accept certain types and only the correct behavior with the expected types can be tested. Therefore it is possible that during the development of the library the static assertion gets removed or modified by mistake, allowing the function to accept more types than expected. This kind of bug can lie undetected until it leads to a failure at some later point in time. We therefore believe that testing the compile-time aspects of the code, and especially being able to test what the code should _not_ be able to do, is just as important as testing the nominal runtime behavior. However, it is challenging to test the behavior of the code at compile time as for that the code must be, well, compiled.

To address this, we present a new library that integrates seamlessly with GoogleTest to allow writing special test cases, that we call static tests, within which certain statements can be wrapped in a SHOULD_NOT_COMPILE macro. When such a test is run, the library attempts to compile the statements within these macros . If they compile without an error, the test will fail and the developer will be alerted with an appropriate failure message. In this talk, we will expand on why we believe such a library is useful with real-life examples, cover how this library can be used, and provide some details on its current implementation.

---
Igor Bogoslavskyi

Igor is a senior software engineer at Apex.AI. He has a PhD in Robotics and is working on safe and certifiable algorithms for autonomous and automated driving. Igor is passionate about C++ and, apart from working with C++ for over 10 years professionally and writing and maintaining multiple open source C++ applications, he also maintains EasyClangComplete - a C++ code completion tool for Sublime Text.

---
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

++namedtuple – Python-style Named Tuples in C++20 – Kris Jusiak – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
In this workshop, we will take a look into how Python-style named tuples can be implemented in C++20.
The goal will be to test and implement the following snippet from scratch with modern C++ features.

01 const auto tuple = namedtuple{"price"_t = 42, "size"_t = 1'000};
02 static_assert(42 == tuple["price"_t]);
03 static_assert(1'000 == tuple["size"_t]);
04 static_assert(not [](auto tuple) { return requires { tuple["quantity"_t];}(tuple))

At the end of this session, the audience will have a better understanding of C++20 features such as:
- Concepts
- User-Defined Literals
- New additions to lambdas
- std::fixed_string

Additionally, attendees will get familiar with an expressive way of writing modern C++.

Let's get ready to named all tuples at CppCon 2021!

[1] https://docs.python.org/3/library/collections.html

---
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

Interactive C++ for Data Science – Vassil Vassilev – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
C++ is used for many numerically intensive applications. A combination of performance and solid backward compatibility has led to its use for many research software codes over the past 20 years. Despite its power, C++ is often seen as difficult to learn and not well suited with rapid application development. The long edit-compile-run cycle is a large impediment to exploration and prototyping during development.

Cling has emerged as a recognized capability that enables interactivity, dynamic interoperability and rapid prototyping capabilities for C++ developers. Cling is an interactive C++ interpreter, built on top of the Clang and LLVM compiler infrastructure. The interpreter enables interactive exploration and makes the C++ language more welcoming for research. Cling supports the full C++ feature set including the use of templates, lambdas, and virtual inheritance.Cling’s field of origin is the field of high energy physics where it facilitates the processing of scientific data. The interpreter was an essential part of the software tools of the LHC experimental program and was part of the software used to detect the gravitational waves of the LIGO experiment. Interactive C++ has proven to be useful for other communities. The Cling ecosystem includes dynamic bindings tools to languages including python, D and Julia (cppyy); C++ in Jupyter Notebooks (xeus-cling); interactive CUDA; and automatic differentiation on the fly (clad).

This talk outlines key properties of interactive C++ such as execution results, entity redefinition, error recovery and code undo. It demonstrates the capability enabled by an interactive C++ platform in the context of data science. For example, the use of eval-style programming, C++ in Jupyter notebooks and CUDA C++. We talk about design and implementation challenges and go beyond just interpreting C++. We showcase template instantiation on demand, language interoperability on demand and bridging compiled and interpreted code. We show how to easily build new capabilities using the Cling infrastructure through developing an automatic differentiation plugin for C++ and CUDA.

---
Vassil Vassilev

---
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

Back To Basics: The Special Member Functions – Klaus Iglberger – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
The six special member functions. Do you know them all? Do you know when the compiler generates them for you and what they are doing? And most importantly, do you know when they don’t give you what you expect? In this talk I will explain the six special members in detail. We will take a look at the exact circumstances when a compiler would generate these functions, what they are doing by default and when we should deal with them manually. Also, among many other guidelines I’ll explain why we should strive for the Rule of 0, why the Rule of 5 is sometimes unavoidable, and why the Rule of 3 is not obsolete.

---
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

PGAS in C++: A Portable Abstraction for Distributed Data Structures – Benjamin Brock – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Writing programs that run on clusters of computers is notoriously tedious and error-prone, particularly for applications like genomics, sparse linear algebra, and graph analytics, which often require fine-grained, irregular communication.

In this talk, I'll argue that the Partitioned Global Address Space (PGAS) programming model, which allows remote access to a portion of the memory space on remote processes in a distributed program, is an effective model for implementing portable, high-level C++ data structures that automatically distribute data, while taking advantage of the high-performance RDMA network primitives available in most supercomputer and data center environments.

I'll discuss how our distributed data structures library BCL builds upon the concept of a global pointer to build a collection of high-performance, high-level data structures, including hash tables, queues, and dense and sparse matrices, that can be used across a variety of communication libraries, including MPI, OpenSHMEM, and GASNet-EX. I'll touch on the some of the important issues that arise in implementing distributed data structures, such as synchronization, remote reference objects, and support for GPUs.

---
Benjamin Brock

Ben Brock is a PhD student at UC Berkeley, where he works on building libraries, tools, and algorithms for high-performance computing. His main work focuses on building a cross-platform library of data structures for distributed applications, with a focus on sparse linear algebra and graph algorithms. Ben is also a member of the GraphBLAS Languages Committee and is involved in drafting the C++ GraphBLAS API Specification.

---
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

Deploying the Networking TS – Robert Leahy – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
The Networking TS provides a framework for writing asynchronous and network-aware applications. A framework which also promotes reusable and testable code. These platonic concerns are only part of software engineering however, and only a small part of the motivation for a framework. When all is said and done one must not merely prepare to reuse code but actually use it, not just test it but deploy it.

How is an actual, deployed application using the Networking TS structured? How do the principles of reusable, testable Networking TS code compose as one writes an actual application rather than a test suite? How can one integrate components which exist outside the Networking TS’s ecosystem into an application based on the Networking TS?

This talk will take the listener on a guided tour of a deployed application written using the Networking TS, the techniques employed to maintain the promises of the Networking TS while fulfilling the needs of an actual application, and how this lays the foundation not only to maintain the current application but also to author additional applications going forward as the deployment and maintenance cycle continues.

---
Robert Leahy

Robert is a graduate of the University of Victoria where he specialized in graphics, gaming, and digital geometry processing. After 4.5 years in full stack web development he switched to financial infrastructure software development in early 2017. He’s since become involved in the ISO C++ committee while delivering high quality, process-driven code to meet the rigorous performance standards for which finance is so well known.

---
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