Author: digitalmedium1

Building an Extensible Type Serialization System Using Partial Template Specialization – CppCon 2021

  • Lobby
  • Author Archives: digitalmedium1

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
As software engineers, we all prefer using performant libraries with user-friendly interfaces. But designing a template-free interface can be challenging for some C++ libraries, like serialization libraries, that need to support generic values but handle them differently based on their type.

This talk shows how we can leverage partial template specialization to implement a generic user-friendly API that can be extended to support custom user-defined types. As a proof of concept, I will showcase an extensible type serialization system, that is built on top of the FlatBuffers serialization library, and enables users to register custom serializers for their user-defined types to support their automatic serialization at runtime.

Template programming is generally known to be associated with long type names and indecipherable compile-time errors. This presentation includes examples and recommendations that help C++ engineers to create more expressive and easy-to-understand implementations. Finally, the talk describes how C++20 features like Concepts can further simplify those implementations and facilitate designing elegant user-friendly programming interfaces.

---
Pejman Ghorbanzade

Pejman Ghorbanzade is the Founder and CEO of Touca, helping software engineers understand the true impact of their code changes on the behavior and performance of their software. Before Touca, Pejman was a senior software engineer at Canon Medical Informatics building software for advanced visualization of medical images. Before that, he worked at VMware Carbon Black building and maintaining the macOS endpoint for the Cb Defense product. Pejman is interested in problems related to the design and maintenance of software at scale and over time. He is passionate about solutions to improve stability and maintainability of products with large ever-changing codebases. Over the years, his code changes have caused more than his fair share of issues in those products.

---
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:
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

Data Orientation For The Win! – Eduardo Madrid – CppCon 2021

  • Lobby
  • Author Archives: digitalmedium1

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
C++ conferences have had presentations showing the important performance benefits of data-oriented design principles; however, the principles seem to require lots of "manual" effort and "code uglification"; these make the principles less practical, and there haven't been clear recommendations about how to deal with runtime-polymorphic types.

In this talk we will recapitulate on data orientation principles and their benefits showing their application through production-strength Generic Programming components made to support them.

Specific examples include:
1. Structures of arrays instead of arrays of complex structures (a.k.a. "scattering")
2. Support for data oriented designs for runtime-polymorphism without inheritance+virtual (the equivalent of using std::variant or std::function, but generalized as allowed by the Zoo type-erasure framework)
----1. Hybrid buffers: the equivalent of the virtual table pointer is scattered out of the objects solving the "Goldilocks problem" of how big the local buffer should be, objects occupy the available space optimally
----2. Easy (de)serialization through very easy relocatability
----3. Voiding the need for pointers in favor of indices into arrays

---
Eduardo Madrid

Eduardo has been working for many years on financial technologies, automated trading in particular, and other areas where performance challenges can be solved in C++. He contributes to open source projects and teaches advanced courses on Software Engineering with emphasis in Generic Programming

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

Why You Should Write Code That You Should Never Write – Daisy Hollman – CppCon 2021

  • Lobby
  • Author Archives: digitalmedium1

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
During the COVID-19 global pandemic, as we all searched for ways to stay connected to the C++ community, I innocently started posting short, 25-line or less C++ snippets of counterintuitive C++ code that I called my "Cute C++ trick of the day." I was floored by the amount of attention these tweets received, with some being viewed more than 30,000 times and liked or retweeted hundreds of times. I received repeated requests to collect these tricks into a library or talk, and this is that talk.

In this presentation, I will dissect a few of my most popular "Cute C++ tricks" to a level of detail not possible on social media platforms like Twitter. I'll talk about how and why these tricks work the way they do, talk about the dark corners of C++ they touch upon, and talk about what you should actually do if you need to produce the same effect in production code. While not targeted at beginners, these tricks span the gauntlet from features that most intermediate programmers are aware of (but never thought to use in a particular way) to dark corners of the language that many of my C++ committee colleagues were surprised to learn about. Throughout it all runs a common thread: learning how to exploit your own curiosity to expand your toolbox, gain a better grasp of the fundamentals of C++, and ultimately, become a better programmer.

---
Daisy Hollman

Dr. Daisy S. Hollman has been a member of the C++ standards committee since 2016, where she has made contributions to a wide range of library and language features, including proposals related to executors, atomics, generic programming, futures, and multidimensional arrays. Since receiving her Ph.D. in Quantum Chemistry in 2013, her research has focussed primarily on parallel and concurrent programming models, though a broader focus on general accessibility of complex abstractions has become her focus in more recent years. She currently works on C++ language and library design at Google, where she continues to focus on providing broad accessibility of programming models and abstractions, with a particular focus on design for diversity and inclusivity.

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

Evolving a Nice Trick – Patrice Roy – CppCon 2021

  • Lobby
  • Author Archives: digitalmedium1

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
We will start with a "simple" problem, and put ourselves in a situation where only C++98 is available to us, with no other library that the C++ standard library. We will solve that problem with the tools at hand, and (hopefully) be satisfied with what we did in that context.

We will then fast-forward to C++11, and revisit the same problem, solving it better with the tools at hand. We will do the same again with C++14, then with C++17, and finally with C++20. At each step, we will examine the ways in which the language makes our solution better, more efficient, simpler.

This will lead us to reflect on what C++ is becoming, and where it is leading us. And hopefully, this will make us smile!

---
Patrice Roy

Patrice Roy has been playing with C++, either professionally, for pleasure or (most of the time) both for over 25 years. After a few years doing R&D and working on military flight simulators, he moved on to academics and has been teaching computer science since 1998. Since 2005, he’s been involved more specifically in helping graduate students and professionals from the fields of real-time systems and game programming develop the skills they need to face today’s challenges. The rapid evolution of C++ in recent years has made his job even more enjoyable. He’s been a participating member in the ISO C++ Standards Committee since late 2014 and has been involved with the ISO Programming Language Vulnerabilities Committee since late 2015. He has five kids, and his wife ensures their house is home to a continuously changing number of cats, dogs and other animals.

---
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 Unit Tests Strike Back: Testing the Hard Parts – Dave Steffen – CppCon 2021

  • Lobby
  • Author Archives: digitalmedium1

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Unit tests are now considered to be one of the foundational practices in modern software development. There are excellent talks and resources for getting started, and no end of good advice on how to write unit tests and what ideal tests should look like. Unit tests should be correct, complete, readable, resilient, and so forth.

But in real life, it's rarely possible to meet all these goals at the same time, and some situations make writing unit tests difficult or impossible. Existing or legacy code may not have been written with testing in mind; or "correct" results may not be well defined; or the code under test may rely on external services of hardware.

This talk reviews some of the most common "Plan B" techniques for tackling the more challenging unit testing situations. Topics covered will include

* White box testing: how to white box, when to white box test, and how to recover afterwards
* Abstract classes don't exist but we have to test them anyway.
* You can't test it without refactoring it, but you can't refactor without tests: cutting the legacy code gordian knot.
* It's probably right but we can't prove it, now what?
* It just failed: was it the code, the test, or some other part of reality?

Most techniques will first throw away some of the good advice we already have.

---
Dave Steffen

Dave Steffen completed his Ph.D. in theoretical physics at Colorado State University in 2003, and promptly changed course for a career in software engineering. He has worked primarily in defence and aerospace, and is currently a technical lead at SciTec Inc.'s Boulder office. For reasons unknown, he has turned out to be the expert, champion, and occasional street-corner evangelist for unit testing at most of the companies he has ever worked at.

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

Units Libraries and Autonomous Vehicles: Lessons from the Trenches – Chip Hogg – CppCon 2021

  • Lobby
  • Author Archives: digitalmedium1

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Units libraries have an enticing value proposition: they can catch mistakes in physical units at compile time, with zero runtime cost. The most famous such error is the unit mismatch that brought down the Mars Climate Orbiter in 1999. This multi-hundred-million dollar disaster has since become the poster child for units libraries everywhere, leaving the impression that their primary function is to produce compiler errors. But does prolonged, real-world experience bear that out?

This talk distills lessons learned from three years of units library usage in the Autonomous Vehicle industry, across two companies (Uber ATG and Aurora). While these libraries do work as advertised to prevent unit mismatches, we find that this is not their primary value. Such errors are extremely rare in practice---but only because developers do significant manual work to both create and maintain unit correctness. The main value of the units library is to robustly automate this work, letting developers redeploy this mental energy more profitably elsewhere.

The degree to which users actually obtain this benefit is primarily driven by the quality of the library's interfaces. Broadly, this means striking a balance where we minimize friction as much as possible, while anticipating and preventing pitfalls and traps. It also means adhering to a principle we call "unit safety", which reduces cognitive load by keeping our reasoning about units as local as possible. Finally, it means playing nicely with other libraries: using the Eigen library as an example, we'll discuss the tradeoffs involved in two separate integration strategies. By the end of the talk, users should have a realistic picture of the suite of benefits offered by units libraries, and be well equipped to use one effectively.

---
Chip Hogg

Chip Hogg is a Senior Software Engineer with Aurora Innovation, on the Motion Planning Team. After obtaining his PhD in Physics from Carnegie Mellon in 2010, he was a postdoctoral researcher and then staff scientist at the National Institute of Standards and Technology (NIST), doing Bayesian data analysis. He joined Google in 2012 as a software engineer, leaving in 2016 to work on autonomous vehicles at Uber's Advanced Technologies Group, where he stayed until their acquisition by Aurora in 2021.

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

How Can Package Managers Handle ABI (In)compatibility in C++? – Todd Gamblin – CppCon 2021

  • Lobby
  • Author Archives: digitalmedium1

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Package managers are crucial in many software ecosystems for reusing libraries, and several major package manages (Conan, vcpkg, and, at least in the HPC world, Spack) have started to grow a large user base within the community. One of the central issues to reusing packages in C++ is ABI, or Application Binary Interface. ABI is fundamental to package compatibility -- it affects how binary artifacts can be reused and composed, and ABI incompatibilities can mean that you need to rebuild an entire stack from source -- which may not be possible, depending on your deployment environment and your user base.

This presentation will look at how ABI can be managed at the *ecosystem* level. We'll look at how the major C++ package managers guarantee ABI compatibility (or not), and how that compares to major build systems (Bazel, Buck, etc.) that manage monorepos. We'll look at the ramifications of ABI on your CI system -- if you reuse a dependency form one project, or if you change a header in one library, when do you need to rebuild the other libraries? What metadata is needed if we want to do better than rebuilding everything from source all the time? We'll finally look at some early (and novel) attempts to do deeper ABI analysis in Spack, and how they could be implemented at scale.

We hope you'll come away from this presentation with the tools to understand how binary compatibility fits into a larger C++ package ecosystem, and what tradeoffs there are from the perspective of the user and the package manager developer. Recent talks at CppCon about ABI have been pessimistic, and we hope this sparks more exchange of ideas around ABI management and how we can make reliable and *fast* package managers for C++ users, without rebuilding the world.

---
Todd Gamblin

Todd Gamblin is a computer scientist in the Center for Applied Scientific Computing at Lawrence Livermore National Laboratory. His research focuses on scalable tools for measuring, analyzing, and visualizing parallel performance data. In addition to his research, Todd leads LLNL's DevRAMP (Reproducibility, Analysis, Monitoring, and Performance) team. He is the creator of Spack, a popular HPC package management tool, and he leads the Software Packaging Technologies area in the U.S. Exascale Computing Project. Todd has been at LLNL since 2008.

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

Zen and the Art of Code Lifecycle Maintenance – Phil Nash – CppCon 2021

  • Lobby
  • Author Archives: digitalmedium1

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Robert Pirsig’s 1974 bestselling classic, “Zen and the Art of Motorcycle Maintenance” was not about Zen - or Motorcycles - although both made an appearance. The subtitle gives you more of an idea: “An Inquiry into Values” - but it was only later that the main concepts in the book, along with the sequel, “Lila” came to form part of “A Metaphysics of Quality”.

Quality, it turns out, is very hard to define. Software Quality is no different. When someone talks about software quality, what do they really mean? How do we measure it? How can we improve it? How do we know when we have it?

We have no shortage of incomplete candidates for these definitions. But over the years I’ve been working to establish what I think are the most important aspects of software quality, how they work together (and sometimes against each other) and how we need all of them (even if they sometimes come as a set).

In Pirsig’s semi-autobiographical novel, we are taken on a motorcycle journey from the east to west coasts of the USA. Our journey will take us through the territories of tests, types and static and dynamic static analysis - all with no mention of east or west const.

---
Phil Nash

Developer Advocate at SonarSource, author of Catch/Catch2, co-host of cpp.chat and No Diagnostic Required, host of C++ London, chair and organiser of C++ on Sea.

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

Finding Bugs Using Path-Sensitive Static Analysis – Gabor Horvath – CppCon 2021

  • Lobby
  • Author Archives: digitalmedium1

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Path-sensitive static analysis simulates the runtime behavior of the program code and uses the analysis state to evaluate which branches can be taken. It is an effective tool to find non-trivial bugs in code at compile time. While checks based on such analysis can take longer time to run, they have a sophisticated understanding of the code that helps them uncover semantic issues. First, I will discuss how can you turn these checks on and how to make sense of the warning messages they produce. Furthermore, I will do a deep dive on what makes path-sensitive analysis an effective tool to reason about code and how MSVC is leveraging this power to find bugs. In particular, I will explain how modern tools like constraint solvers can help increase the precision of the analysis. Throughout the talk, I will not only feature already released checks but also give a glimpse of the upcoming ones that we are actively working on. All the checks in the demo will be available for free in the community edition of Visual Studio and as security actions in GitHub.

---
Gabor Horvath

Gabor started a Ph.D. in 2016. He is a contributor to research projects related to static analysis since 2012. He is a clang contributor, participated in Google Summer of Code twice as a student and many times as a mentor, interned for Apple, Microsoft and Google. He taught C++ and compiler construction to undergrads at Eotvos Lorand University. Currently, he is working at Microsoft's C++ Static Analysis team to improve MSVC's static analysis capabilities.

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

Up to Code – David Sankel – CppCon 2021

  • Lobby
  • Author Archives: digitalmedium1

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Many engineering disciplines require alterations or improvements of existing systems to be "up to code," whether that be the installation of railings on a staircase or upgrades to electrical work. In this talk, we'll apply this concept to Software Engineering and, in particular, C++-based systems. Using one real-world example, we'll cover best practices including: contracts, type-driven architecture, hierarchical design, and difficult testing scenarios as they apply to "old work."

While many of these topics are covered elsewhere, they are usually presented as if all code is being written from scratch. Application to an existing system is an entirely different matter. That is the subject of this talk.

---
David Sankel

David Sankel is a Software Engineering Manager/TL at Bloomberg and an active member of the C++ Standardization Committee. His experience spans microservice architectures, CAD/CAM, computer graphics, visual programming languages, web applications, computer vision, and cryptography. He is a frequent speaker at C++ conferences and specializes in large-scale software engineering and advanced C++ topics. David’s interests include dependently typed languages, semantic domains, EDSLs, and functional reactive programming. He is the project editor of the C++ Reflection TS, a member of the Boost steering committee, and an author of serveral C++ proposals including pattern matching and language variants.

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