Writing Python Bindings for C++ Libraries: Easy-to-use Performance - Saksham Sharma - CppCon 2023

3 Просмотры
Издатель
https://cppcon.org/
---

Writing Python Bindings for C++ Libraries: Easy-to-use Performance - Saksham Sharma - CppCon 2023
https://github.com/CppCon/CppCon2023

The unix philosophy encourages writing small applications that compose well, and unix / linux / sh have provided us with nice chaining tools that let us achieve this. This works well enough, but chaining of processes makes it complicated to actually share memory space, library versions, and memory layouts of various objects. Working within a single programming language (Python for instance), we can script and keep local memory state and chain together things however we like. Think of numpy or pandas as examples.

In this talk we will discuss how we can use boost::python and friends to help us build our C++ libraries as dynamically linked libraries that can be exposed safely as python functions and objects in python programs. This will be done entirely in C++, with Python being the equivalent of a shell for us (helping us invoke our library's methods).

We will use some real-world-inspired examples of libraries as case studies to explore how to design the user facing API for such software, and what kind of nuances to think about while doing so. As a result, the attendees will learn how to go about designing python bindings for their own applications, and how to consider the performance implications of each design choice.

We will discuss, among other things, the following topics:
1. Managing memory to inter-op smoothly with Python, which is garbage collected
2. Inter-operability and conversion between C++ and python data containers
3. Handling multiple threads and background processing
4. Sharing data and pointers across modules
5. Ensuring build system consistency to avoid incompatibility across build environments
6. Some common API design ideas tried and tested in actual applications.
---

Saksham Sharma

Saksham Sharma is a Director of Quantitative Research Technology at Tower Research Capital LLC, a high frequency trading firm based out of New York. He develops low latency and high throughput trading systems and strategies used for the firm's global quantitative trading. In addition, he also helps design and improve big data research infrastructure used for trading research using a combination of C++ and Python. Thanks to an urge to optimize his daily workflow, he also owns the build systems, tooling, and package managers for C++ within his team.In the past, he has worked in the fields of program analysis research, functional programming, and systems security. He is a reformed geek (exemplified by a switch to VSCode after almost a decade with Emacs), and now enjoys driving, guitar, badminton, and snowboarding.
---

Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd: https://events.digital-medium.co.uk
---

Registration for CppCon: https://cppcon.org/registration/

#cppcon #cppprogramming #cpp #python
Категория
Язык программирования C++
Комментариев нет.