Tag: Cpp17

Lightning Talk: Modernizing SFML in Cpp – Chris Thrasher – CppCon 2022

https://cppcon.org/
---

Lightning Talk: Modernizing SFML in Cpp - Chris Thrasher - CppCon 2022
https://github.com/CppCon/CppCon2022

Modernizing SFML, a game development library, from C++03 to C++17
---

Chris Thrasher
---

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

Filed under: UncategorizedTagged with: , , , , ,

C++ Class Template Argument Deduction – History, Uses, & Enabling it for Classes – Marshall Clow

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

C++ Class Template Argument Deduction - History, How to Use it, and How to Enable it for Your Classes - Marshall Clow - CppCon 2022
https://github.com/CppCon/CppCon2022

In C++17, a new feature "Class Template Argument Deduction" (CTAD for short) was added to the language.

In this talk, I will show the rationale for this feature, how you can use it in your code, explain how it works and give examples of how to enable it for your classes.
I'll answer questions like:
* Why did the committee add this feature to the language?
* Why "class template argument deduction"? Why not just "template argument deduction"?
* What is a deduction guide?
* What can be done in a deduction guide?
* How do I write my own deduction guides?
* What tools are there for debugging deduction guides?

I will also talk about enhancements since C++17, and possible future directions.
---

Marshall Clow

Marshall has been coding for 40+ years; he was the lead developer on libc++ for 10 years, and the chairman of the Library working group of the C++ standards committee for 5 years. These days, he spends his time looking at "interesting problems"
---

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

Using C++14 in an Embedded “SuperLoop” Firmware – Erik Rainey – CppCon 2022

https://cppcon.org/
---

Using C++14 in an Embedded “SuperLoop” Firmware - Erik Rainey - CppCon 2022
https://github.com/CppCon/CppCon2022

This presentation covers what the execution environment of an embedded "superloop" firmware is in order to describe later why certain C++14 language and library features are used and others are not. This environment lacks many basic features and capabilities that traditional C++ programmers may think are common place but is able to be programmed in C++14 (and later) with a specific design paradigms and guidelines. Programmers with deeply embedded C experience will be familiar with some of the limitations of the environment but may find the C++ solutions quite refreshing! The talk will conclude with some comments on C++17 / C++20 features which will be quite valuable to embedded environments of all types.
---

Erik Rainey

Erik is a Senior Software Engineer at Amazon working in the Prime Air on low-level/embedded firmware written in C++ for drones. He has got more than 20 years of professional experience making 21st century technologies on embedded devices which can blink LEDs. He's also been a contributor to Khronos's OpenVX 1.0 specification.
---

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

Filed under: UncategorizedTagged with: , , , , ,

Personal Log – Where No Init Has Gone Before in C++ – Andrei Zissu – CppCon 2022

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

Personal Log - Where No Init Has Gone Before in C++ - Andrei Zissu - CppCon 2022
https://github.com/CppCon/CppCon2022

Can your code have logging entries whose sensitive messages don't show up in the shipped binaries? And can the following code snippet ever work?

static bool initially_false = false;
void no_one_calls_me() { DO_ON_INIT(initially_false = true); }
int main() {assert(initially_false == true); return 0;}

Well yes, this is actual working C++17 code! And yes, we can use this tool to produce a logger with vanishing strings!

As part of this talk we will go behind the scenes of the DO_ON_INIT utility, the process involved in developing the idea and its surprisingly simple implementation details (under 20 lines of C++17 code, and even less in C++20).

We shall also see how this utility is instrumental in making possible the no-strings-attached logger and its associated automatically-generated decoding facility. We will implement a simple obfuscation technique which replaces logged strings with hashes at compile-time, to avoid shipping binaries containing sensitive textual giveaways. To decode such logs (in a separate decoder utility) we shall use DO_ON_INIT to automatically collect and register all the logged strings system-wide, along with their hashes, without requiring any additional tool (such as an in-house pre-processor).

This is yet another example of emergent behavior in C++, consisting of unrelated language features being put to use together in a novel and unexpected way. Could your idea be next?
---

Andrei Zissu

Andrei Zissu is an experienced cross-industry C++ developer, notably having worked on low-level reverse engineering systems employing API hooking, DLL injection and other advanced techniques. In early 2022 he joined the WG21 standards committee as a member of the Israeli NB, and is planning to explore the exciting realm of reflection.

Andrei is currently employed at Binah.ai, an Israeli startup developing ground breaking AI-based remote health monitoring technology. The feature presented in this talk has been developed by him in recent months for the Binah.ai C++17 codebase, and is being gradually staged into production code.

Andrei loves the occasional opportunity to explore the rough edges of C++. The latest such opportunity along with its discoveries will be presented in this talk.
---

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

High Speed Query Execution with Accelerators and C++ – Alex Dathskovsky – CppCon 2022

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

High Speed Query Execution with Accelerators and C++ - Alex Dathskovsky - CppCon 2022
https://github.com/CppCon/CppCon2022

Large-scale analytics of structures and semi-structured data has become a pivotal workload in many computing domains, from science, through finance, to social networks. Big data analytics has proven to be highly CPU-bound and requires immense compute resources. Yet unlike the deep learning domain that has gone through a couple of hardware acceleration cycles, big data analytics is still running on stock CPUs. A fundamental reason for this lack of hardware acceleration is that big data analytics is much more computational diverse than deep learning. As a result, a hardware accelerator for big data analytics requires careful balancing of dedicated hardware acceleration with a programmable and flexible fabric. Here at Speedata we are developing the first hardware accelerator for big data analytics. Our SoC relies on a novel massively parallel, non-von Neumann processor coupled with dedicated hardware accelerators. But what good is a hardware accelerator without an optimized software stack? This talk will discuss how we combine C++ and Python to dynamically generate custom query code and compile it for our massively parallel processor. We will discuss are aggressive metacppcon.digital-medium.co.uk/tag/programming/">programming framework that stretches C++ boundaries to the cutting edge. We will further discuss how our code is created, some of the tricks that we use to generate our accelerated code, and why C++17 and C++20 is one of the most important aspects for our development.
---

Alex Dathskovsky

Alex has over 16 years of software development experience, working on systems, low-level generic tools and high-level applications. Alex has worked as an integration/software developer at Elbit, senior software developer at Rafael, technical leader at Axxana, Software manager at Abbott Israel and now a group manager a technical manager at Speedata.io an Exciting startup the will change Big Data and analytics as we know it .On His current Job Alex is developing a new CPU/APU system working with C++20, Massive metacppcon.digital-medium.co.uk/tag/programming/">programming and development of LLVM to create the next Big thing for Big Data.

Alex is a C++ expert with a strong experience in template meta-cppcon.digital-medium.co.uk/tag/programming/">programming. Alex also teaches a course about the new features of modern C++, trying to motivate companies to move to the latest standards.
__

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

Help! My Codebase has 5 JSON Libraries – How Generic Programming Rescued Me – Christopher McArthur

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

Help! My Codebase has 5 JSON Libraries - How Generic Programming Rescued Me - Christopher McArthur - CppCon 2022
https://github.com/CppCon/CppCon2022

In 2019 working on a RESTful cloud oriented C++ application, everything was JSON. Inbound communication was handled with an ASIO based web server, RESTinio, and used RapidJSON to handle the API payload. Outbound was handled by CPPRESTSDK which had its own JSON implementation. To handle authorization, we picked the best C++ JSON Web Token (JWT) library but that was written on top of PicoJSON, a small minimalistic unmainted library. We then had 3 different JSON libraries to work with and mix together.

How do we make this work together? “Why don’t you template out the logic and metaprogram a traits implementation?” Geeze, Thanks Gareth! So that’s what I did.

Generic cppcon.digital-medium.co.uk/tag/programming/">programming is writing algorithms in such a way that the type can be specified later. Using templates the algorithm can operate on different types if they satisfy certain traits (or implement a certain concept). JSON Web Tokens should follow the same algorithm regardless of the JSON implementation - this seemed like a useful case for applying generic cppcon.digital-medium.co.uk/tag/programming/">programming.

Six months and a lot of learning later, I had opened a pull request against the JWT-CPP library.
Using templates, SFINAE, and static assertions I was able to abstract the “JSON” out of the JSON Web Token (JWT) logic. I am able to answer questions like: How can the compiler know…
What is the signature of a function? Does it match a known signature? Is it close enough?
If a type has a member function? What is the return type of the method? Can it differentiate between static and member functions?
Yes. The compiler is really that well informed and the tools and techniques exist to programmatically answer them at compile time.

Templating the JSON “value and types” played in favor with the existing design of a C++ single file header only library. Being an Open-source project it was important to maintain the existing compiler requirements, this bound the implementation to C++11 however there are C++17 features (i.e. `std::void_t`) and experimental features (i.e. `std::experimental::is_detected`) which are back-ported.

A JSON Traits needs to declare a generic value type, and concert basic types which match the JWT’s family of RFC defined claims (which are JSON keys) such as object, string, or double. All the types were substituted into templates to check for concepts, for instance, `object_type` needs to be iterable, so a `constexpr` value is set if begin and end methods are present. Some traits are optional and substitution failure is not an error.

With several of the most popular JSON libraries like Niel Lohamn’s and Boost’s supported, this approach can work for any project looking to decouple the application logic from a library specific container. There are some drawbacks, such as complexity and mind melting error messages. Recent compilers with support for Concepts makes future possibilities very exciting.
---

Christopher McArthur

Chris has been giving back to the open source community with exploit database containers, C++/ CMake build system maintenance, and other OSS projects for nearly ten years. He began his career as a C++ developer and has since then added other languages including Golang and Typescript to his skill set. Prior to joining the Conan team at JFrog, Chris previously worked in the video broadcast and mobile advertising industries on a variety of projects. His diverse experiences include Blockchain, low-level hardware networking, distributed systems security, and cloud-native DevOps. As a developer advocate for JFrog, Chris deals with Conan, Chris shares his deep to the knowledge of DevOps and Package Management to the C++ Community globally.
__

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

C++ in Constrained Environments – Bjarne Stroustrup – CppCon 2022

https://cppcon.org/
---

C++ in Constrained Environments - Bjarne Stroustrup - CppCon 2022
https://github.com/CppCon/CppCon2022

C++ is widely used in constrained and/or critical applications and infrastructure components. How do we manage to use a large multi-purpose language in such environments? How can we better use facilities and techniques from modern C++ (C++11, C++14, C++17, C++20, and beyond)? The best answer is not “use only facilities available in C and C++ in 1985.”

This talk focuses on a top-down approach to achieve simplicity, maintainability, performance, and various forms of safety. It touches upon the C++ Core Guidelines, compile-time computation, type-and-resource safety, type deduction, the span and chrono standard libraries, and error handling.
---

Bjarne Stroustrup

Bjarne Stroustrup is the designer and original implementer of C++ as well as the author of The C++ Programming Language (4th Edition) and A Tour of C++ (2nd edition), Programming: Principles and Practice using C++ (2nd Edition), and many popular and academic publications. He is a professor of Computer Science in Columbia University in New York City. Dr. Stroustrup is a member of the US National Academy of Engineering, and an IEEE, ACM, and CHM fellow. He received the 2018 Charles Stark Draper Prize, the IEEE Computer Society's 2018 Computer Pioneer Award, and the 2017 IET Faraday Medal. He did much of his most important work in Bell Labs. His research interests include distributed systems, design, programming techniques, software development tools, and programming languages. To make C++ a stable and up-to-date base for real-world software development, he has been a leading figure with the ISO C++ standards effort for more than 30 years. He holds a master’s in Mathematics from Aarhus University, where he is an honorary professor in the Computer Science Department, and a PhD in Computer Science from Cambridge University, where he is an honorary fellow of Churchill College. www.stroustrup.com
---

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

Filed under: UncategorizedTagged with: , , , , , , , , , ,