Category: Science & Technology

Typescripten: Generating Type-safe JavaScript Bindings for emscripten – Sebastian Theophil

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
WebAssembly has become a very popular target platform for C++ developers. Thanks to emscripten, porting native applications to WebAssembly is easy — as long as the application only uses the browser as a display and input device. However, emscripten does not provide type-safe wrappers to the standard JavaScript APIs such as the DOM manipulation API, let alone any other JavaScript API provided by existing web applications.

Our open source tool “typescripten” has been built on top of three powerful technologies to close this gap. It uses TypeScript interface definition files and the TypeScript compiler API to create type-safe C++ wrappers based on emscripten. TypeScript already has interface definition files for over 7000 JavaScript libraries that you can now use safely from C++.

We strive to design our C++ wrappers such that the C++ code using them looks similar to the equivalent TypeScript or JavaScript code. However, the peculiar semantics of prototype-based Javascript and Typescript are often difficult to translate into a type-based language such as C++. I will discuss the challenges we faced and choices we made when designing this framework.

---
Sebastian Theophil

Sebastian studied Computer Science in Berlin and Toulouse, France, and holds a Ph.D. in Computer Science from the Humboldt University of Berlin. He has been working at think-cell Software since its founding in 2002. Over the years, Sebastian has worked on a lot of things at think-cell. In recent years, he was the Lead Developer porting think-cell to the Mac.

He was invited as speaker at RWTH Aachen, ETH Zürich, Freie Universität Berlin, Humboldt Universität zu Berlin, and he is also speaking in various international C++ conferences and gatherings.

---
Videos Recorded & 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

SIMD in C++20: EVE of a new Era – Joel Falcou & Denis Yaroshevskiy – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
EVE is a new library that exposes SIMD in a uniform way across both ARM (neon) and x86 (from sse2 to avx-512).

It's main advantages over similar libraries include:
* STL like algorithm support, including zip to operate on multiple ranges .
* ARM support (many libraries only support x86)
* A very comprehensive math library.

It is liberally licensed and intended to be production quality. But let's just be direct: vectorized find for x86 and arm on godbolt: https://godbolt.org/z/n6Pds78s6

This talk will include a collection of demos for different library features and benchmarks, how C++20 helped us construct a proper design as well as practical advice on using EVE in your projects.

---
Joel Falcou
Joel is an associate professor at the University Paris-Saclay and Researcher at the Laboratoire de Recherche d’Informatique in Orsay, France. His research focuses on studying generative programming idioms and techniques to design tools for parallel software development.

The main parts of his work are:
• the exploration of Embedded Domain Specific Language design for parallel computing on various architectures;
• the definition of a formal framework for reasoning about meta-programs.

Joel is the co-host of the C++FRUG Meetup, president of the C++FRUG Association, co-organizes the CPPP Conference, and is part entrepreneur, being one of the co-founder of CODE RECKONS, a company focused on bringing people and company up to date to the best and newest C++.

Denis Yaroshevskiy
Denis is a semi-active member of the C++ community. He is mostly interested in algorithms and has done a few things in that area such as: research and implementation of Chromium’s flat_set, a couple of tiny contributions to libc++ algorithm library, a few algorithm related talks and one sole paper to the C++ standard that didn’t get consensus. For the last couple of years in his free time Denis is implementing STL algorithms portably using SIMD.
Denis currently works at Bloomberg.

---
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 Foundation of C++ Atomics: The Knowledge You Need to Correctly Use C++ Atomics – Filipe Mulonde

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
This talk covers all the knowledge you need about atomics to give you a good understanding of how they work under the hood and make sure your code is correct.

C++11 introduced std::atomic template class which supports six memory orderings, writing correct concurrent programs which use the atomic classes can be challenging. It requires understanding the complexity of how std::atomic works under the hood. The goal of this talk is to encourage programmers to use the atomic classes when appropriate and give them the knowledge to do so correctly.

This talk will help you confidently use atomics correctly by bringing knowledge of some of the main components that make parallelism possible in modern computer systems, the relationship between these components, and the individual contribution of each of these components in making atomic difficult to use correctly.

This talk will be aimed at programmers who are new to std::atomic as well as those who have been using these classes. I will show some aspects of atomics which may not be commonly known.

Topics Covered in the first session :
• A brief overview of atomics in C++.
• Multi-core processors.
• Operating system context switching.
• Memory Consistency and Cache Coherence.
• Memory Barriers.
• The C++ memory model (part 1).
• Static & Dynamic Instruction Scheduling.

Topics Covered in the second and third session:
• The C++ memory model (part 2).
• Optimizations Allowed by the memory model.
• The Cost of Sequentially Consistent Atomics.
• Semantics of Data Races.
• Compiler and Hardware introduced Data Races.
• The compiler and hardware cooperation to respect the memory model.
• The relationships and tradeoffs among atomics and fences/barriers.
• How atomic map to their expected machine-instruction implementations on x86 architecture . My wish is to be able to do the 1st session this year and do the 2nd and 3rd session next year.

---
Filipe Mulonde

Software Engineer passionate about programming,holds a bachelor's degree in software engineering from Peter the Great St. Petersburg Polytechnic University and is now a final year Master's student in Artificial Intelligence at this same university. worked as a software engineer intern at JSC NIIAS-Research and Design Institute of Informatization, Automation , and Communication in Railway Transport of the Russian Federation. Doing code review and increase the performance of an autonomous car using parallelism with C++. I am co-founder of APA(Association of Angolan Programmers) a non-profit organization, helping to build a technological bridge between Africa (Angola) and the rest of the world. https://twitter.com/angolan_of/status/1326848737558335488 . I have interests in x86 assembly, Parallel programming, C++,Digital Design, Microarchitecture and Computer Architecture, Computer Organization, OS, memory models, Digital computer Electronics and design of computing devices, compilers, Machine learning, robotics etc. Former mobile and web developer.

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

3D Graphics for Dummies – Chris Ryan – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Three-dimensional graphics are much simpler than you would think. I will present the rudimentary techniques for the designs of a simple C++ Matrix library and operator methodologies, through an introduction to 3D Graphics: Points, Vectors, Coordinate Spaces, Matrix Math, Depth Buffer and Rasterization.

We will explore the blood and guts of a C++ Matrix library and 3D graphics. Rather than using off-the-shelf libraries like Unity and OpenGL, we will examine a simple library I wrote to teach myself about the subject. Includes demo of the graphics library/app.

---
Chris Ryan

Chris Ryan was classically trained in both software and hardware engineering. He is well experienced in Modern C++ & Classic ‘C’, on extremely large/complex problem spaces and on Embedded/Firmware devices (large & small). Chris has no interest in C#/.,Net, Java, js or any web-ish tech.

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

Value in a Procedural World – Lisa Lippincott – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
This talk is the Software Design Track Keynote.

What is a value? The most common conception is that values are inhabitants of a platonic mathematical world, too far away to be examined or subjected to experiment. As a basis for understanding computer programs, this conception is awkwardly non-local and disturbingly mystical.

In this lecture, I will present a functionalist conception of value, situated locally within the realm of procedural programming. I will show how values in this conception relate directly to program execution, and examine how events within program execution are related through the stability, substitutability, and repeatability of values.

---
Lisa Lippincott

Lisa Lippincott designed the software architectures of Tanium and BigFix, two systems for managing large fleets of computers. She's also a language nerd, and has contributed to arcane parts of the C++ standard. In her spare time, she studies mathematical logic, and wants to make computer-checked proofs of correctness a routine part of programming.

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

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

Filed under: Science & Technology

Using C Libraries in your Modern C++ Embedded Project – Michael Caisse – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Projects have goals, timelines, and deliverables which should shape our solution space and approach. A recent project incorporating EtherCAT had other technical challenges and a fixed timeline which resulted in a basic integration approach.

After the project was complete I continued developing Ciere's capabilities to handle EtherCAT based communication. In all, three different levels of integration were developed.

This talk will briefly introduce the real-time suitable communication technology called EtherCAT and then review the progression of integration approaches. We will explore the techniques and language features employed and extract some rules of thumb about layered architectures. We will look at the technical, timeline, and risk trade-offs for each approach as we make observations about the value provided.

While this talk focuses on integrating C-libraries and facilities within a Modern C++ embedded target, the lessons learned and insights are applicable to Modern C++ projects of all sized targets. Attendees will walk away with a set of patterns for dealing with C library integration, some guidelines about value trade-offs, and one person's experience with implementations.

---
Michael Caisse

Michael Caisse started using C++ with embedded systems over 30 years ago. He continues to be passionate about combining his degree in Electrical Engineering with elegant software solutions and is always excited to share his discoveries with others.

Michael works for Ciere Consulting where he provides software consulting and contracting, C++ training and mentoring, and electronic design.

When he isn't fighting with compilers or robots, he enjoys fencing with a sabre.

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

In-memory and Persistent Representations of C++ – Gabriel Dos Reis – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
C++ Modules are a tooling opportunity. For example, a common implementation strategy for compilers is to save on disk the abstract semantics graph (ASG) obtained from elaborating a module interface (exported), to be reused later when that module is consumed (imported). That ASG, an intermediate representation, saves the compiler from repeated work in common scenarios, therefore helps achieve substantial reduction in compilation time. In essence, ISO C++ compilers are practically compelled to acknowledge representations of C++ program fragments other than character streams stored in source files. It is all too tempting to view these ASGs as mere build artifact curiosities. If N compilers, on a given platform, decide to use N different on-disk ASG representation formats then we face a severe problem of developer tools fragmentation. I present, in this talk, how the C++ community can avoid that problem: the desiggn and implementation of formal, compiler-neutral in-memory and persistent representations of C++ programs. These alternative representations allow tools to process C++ programs without needing to master or to replicate the dark art of C++ compiler construction. These representations are available either as open specification, or as C++ libraries. The application opportunities range from automated generation of bindings ("foreign function/data interface") to Just-In-Time compilation of interpreted C++ scripts, and beyond.

---
Gabriel Dos Reis

Gabriel Dos Reis is a Principal Software Engineer at Microsoft, where he works in the area of large scale software construction, tools, and techniques. He is also a researcher, and a longtime member of the C++ community, author and co-author of numerous extensions to support large scale programming, compile-time and generic programming. His research interests include programming tools for dependable software. Prior to joining Microsoft, he was Assistant Professor at Texas A&M University. Dr. Dos Reis was a recipient of the 2012 National Science Foundation CAREER award for his research in compilers for dependable computational mathematics and educational activities.

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

The Upcoming Concurrency TS Version 2 for Low-Latency and Lockless Synchronization – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
The June 2021 ISO C++ virtual plenary approved Concurrency TS Version 2. This new TS has been in the works for 6+ years and will move us towards supporting highly intensive, low latency lockless synchronization mechanisms. This talk will be given by the Editing team for Concurrency TS2, as well as some of the specific authors.The initial approved content will be hazard pointers (HP) and read-copy update (RCU).

Hazard pointers is a deferred reclamation technique. It is used for fast and scalable protection of access to shared objects that may be removed concurrently. It allows indefinite protection, which makes it suitable for cases of object protection while blocking or while executing arbitrary user code. It also guarantees bounding of unreclaimed objects that are eligible for reclamation.

RCU is another deferred-reclamation technique that is most frequently used to replace reader-writer locking for linked data structures in a number of operating system kernels and concurrent applications. In the most aggressive implementations, RCU readers might use exactly the same sequence of instructions that would be used in the same traversal of a read-only data structure, which means that RCU can provide excellent read-side performance and scalability. The C++ RCU proposal features RAII RCU readers, both intrusive and non-intrusive retire functions, and full compatibility with the C++ type system.

This talk will describe the final approved form of hazard pointers and RCU, and also what we hope to learn from the TS process. This talk will also cover in-the-wild advances in hazard pointers and RCU during the multi-year process leading up to this TS. We will draw examples from the Folly library, where both hazard pointers and RCU are used, and from the various forms of RCU within the Linux kernel. We expect that the TS will be a good vehicle for feedback, and the in-the-wild advances will also help shape entry into IS.

We will also give a high-level overview of other contents that we expect to be added to the TS such as Snapshot and Asymmetric fences. We hope to describe these in a future talk after they have passed LWG review. We believe that in about a year, Concurrency TS2 will be completed and released for public review.

We will also describe the new chapters that we hope will enter the C++ standard in C++23 or C++26.

---
Maged Michael

Maged Michael is a software engineer at Facebook. He is the inventor of hazard pointers, lock-free malloc and several algorithms for concurrent data structures. He received a Ph.D. in computer science from the University of Rochester. He is an ACM Distinguished Scientist. He is an elected member of the Connecticut Academy of Science and Engineering. He received the 2014 ACM SIGPLAN Most Influential PLDI Paper Award for his paper on Scalable Lock-Free Dynamic Memory Allocation.

Michael Wong

Michael Wong is Distinguished Engineer/VP of R&D at Codeplay Software. He is a current Director and VP of ISOCPP , and a senior member of the C++ Standards Committee with more then 15 years of experience. He chairs the WG21 SG5 Transactional Memory and SG14 Games Development/Low Latency/Financials C++ groups and is the co-author of a number C++/OpenMP/Transactional memory features including generalized attributes, user-defined literals, inheriting constructors, weakly ordered memory models, and explicit conversion operators. He has published numerous research papers and is the author of a book on C++11. He has been an invited speaker and keynote at numerous conferences. He is currently the editor of SG1 Concurrency TS and SG5 Transactional Memory TS. He is also the Chair of the SYCL standard and all Programming Languages for Standards Council of Canada.

Paul E. McKenney

Paul E. McKenney has been coding for almost four decades, more than half of that on parallel hardware, where his work has earned him a reputation among some as a flaming heretic. Paul maintains the RCU implementation within the Linux kernel, where the variety of workloads present highly entertaining performance, scalability, real-time response, and energy-efficiency challenges. Paul was previously an IBM Distinguished Engineer at the IBM Linux Technology Center. Prior to that, he worked on the DYNIX/ptx kernel at Sequent, and prior to that on packet-radio and Internet protocols (but long before it was polite to mention Internet at cocktail parties), system administration, business applications, and real-time systems. His hobbies include what passes for running at his age along with the usual house-wife-and-kids habit.

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

Software Architecture Lessons from Multidimensional Spaces Explorations – Vincent Reverdy – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Designing software can be fun, but designing good, clean, reliable, and rock-solid libraries can be of incredible complexity. In this talk we will explore what lessons can be learned on software architecture and domain specific languages design from an exploration around multidimensional arrays and linear algebra. The goal will be to review some guiding principles for good software design in C++20 and discuss programming strategies to attack the problem of compositionality. This talk will aim at shedding a new light on issues that go far beyond the sole scope of multidimensional arrays and will provide insights about the difficulty of achieving simplicity in software design.

We will start from the problem of making multidimensional arrays finally available in C++ and quickly describe the current state of affairs with std::mdspan. We will then try to understand what fundamentally makes the problem so much more complicated in C++ than in many other programming languages that have been equipped with such abstractions for decades. This will let us introduce the so-called GPE principle "Genericity, Performance, and Expressivity" as a way to frame software architecture problems. We will illustrate how this principle can be used as a guide to improve the current design of std::mdspan once combined with new C++20 capabilities ranging from generic Non-Type Template Parameters (NTTPs) to concepts and including generic lambdas in unevaluated contexts. This example will help us understand when and how advanced programming techniques can be used to implement generic, expressive, and performance-oriented abstractions. We will then extend the reflection to the design of Embedded Domain Specific Languages (EDSLs). We will see why shifting the focus from the functionality and implementation to the user perspective can be a particularly relevant strategy for the design of embedded mini-languages. We will illustrate how this principle can be translated in practice in C++20, especially in the context of generic NTTPs that allow template classes to be literally used as mini-compilers. Regarding our specific example, we will see how advanced C++20 constructs can be leveraged to allow library users to manipulate multidimensional arrays through a natural, concise, and expressive syntax. This will finally bring us to upcoming C++ features such as reflection that we will discuss from the perspective of questions about the nature of complexity in programming languages.

In short, beyond multidimensional arrays, Embedded Domain Specific Languages, and advanced implementation strategies, this talk will try to provide an interesting perspective on modern software architecture principles as well as a discussion on complexity, simplicity, and compositionality in the context of C++20.

---
Vincent Reverdy

Vincent has been working as a post-doctoral researcher at the University of Illinois at Urbana-Champaign (USA) since he obtained his PhD at the Paris observatory (France) in november 2014. His main scientific interests are related to cosmology and general relativity. He his particularly interested in the study of relativistic effects at cosmological scales using high performance simulations run on supercomputers. Because these simulations rely on tree data structures, he started investigating ways to optimize them. He now leads a research team working on tree data structures with main applications in simulations, machine learning, and data science. He also participates into the C++ standardization process and regularly submits proposals to improve the C++ language.

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

Spooky Action at a Distance – Victor Ciura – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
I hate the term “Design Patterns”. It implies there are universally applicable solutions to some common code scenarios. Just codifying existing practice into some rules and blindly following them is a comfortable path, but not the optimal one. It turns out it’s not as easy as following recipes. Each situation and best associated solution is unique.

However there is value in having uniform code structure throughout a project. So this topic is not to be discarded just yet, rather it needs more careful examination.

In terms of inspectable properties of objects, what have we learned from years of OO influence from other languages and frameworks? How can we leverage these borrowed techniques in a value-oriented context? Does C++ benefit from special considerations?

I think it’s time to revisit our old friend, the Observer pattern - from “theory” to practice. I’m not going to offer The Solution, rather we’re going to examine tradeoffs for several possible implementations, in various usage scenarios from a real project.

---
Victor Ciura

Victor Ciura is a Principal Engineer at CAPHYON, Technical Lead on the Advanced Installer team and a Microsoft MVP (Developer Technologies).

He’s a regular guest at Computer Science Department of his Alma Mater, University of Craiova, where he gives student lectures & workshops on using C++ STL Algorithms.

Since 2005, he has been designing and implementing several core components and libraries of Advanced Installer. Currently, he spends most of his time working with his team on improving and extending the repackaging and virtualization technologies in Advanced Installer IDE, helping clients migrate their traditional desktop apps to the modern Windows application format: MSIX.

One of his “hobbies” is tidying-up and modernizing (C++20) the aging codebase of Advanced Installer and has been known to build tools that help this process: Clang Power Tools

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