www.cppnow.org
/ cppnow
---
The Challenges of Implementing the C Standard Library in C++ - Siva Chandra Reddy - CppNow 2023
Slides: github.com/boostcon
---
We kicked-off LLVM's libc project (libc.llvm.org) over three years ago with certain grand goals of making all of it instrumentable with sanitizers, employ modern software development practices while keeping it as modular and configurable as possible. One very interesting decision we took was to implement the libc, a C standard library, in the C++ language. We did not mean or intend to stick to a small C like subset of the C++ language. In fact, the only restriction we imposed was to not use virtual functions. This talk is a demonstration of how we have successfully implemented a C library in pure C++ using modern C++ idioms, constructs and language features. We will show how we have successfully avoided the use of assembly language to implement the startup subsystem of the libc in pure C++. We will show how we have implemented memory routines in C++ while still matching or bettering the performance of hand-crafted assembly implementations of other C standard library implementations. Some of our techniques in the early stages were hacky but have evolved over the years to be more principled. We will show how we were able to eliminate the early hacky solutions and replace them with more maintainable and scalable practices. We will also demonstrate how we use modern C++ idioms for tasks like memory allocations, memory de-allocations etc.
To use C++ to implement a C library was a challenge that we posed to ourselves and pulled it off. With this talk, we intend to share what we have learn't while demonstrating the practical utility of modern C++ constructs in implementing simple, maintainable, and production ready code.
---
Siva Chandra Reddy
Siva Chandra Reddy is a software engineer at Google working on the C++ compiler toolchain team. For most of his professional career, he has worked on various open source and proprietary compiler toolchain systems. He has contributed to GCC, GDB and various LLVM projects with LLVM's libc being his primary focus in the last three years. He holds a master's degree in computer science and a bachelor's degree in electrical engineering.
---
Video Sponsors: think-cell and Bloomberg Engineering
Audience Audio Sponsors: Innoplex and Maryland Research Institute
---
Videos Filmed & Edited By Bash Films: bashfilms.com/
RU-vid Channel Managed & Optimized By Digital Medium Ltd: events.digital-medium.co.uk
---
CppNow 2024
www.cppnow.org
/ cppnow
---
#boost #cpp #softwaredevelopment
6 июл 2023