Core C++ 2021 :: Implementing C++ Semantics in Python
Channel: CoreCppIL
Date: 2021-09-29

By Tamir Bahar, presented at Core C++ 2021 conference.

Coding in Python, I often find myself reaching for C++ features and techniques.

Deterministic destructors and RAII, for example, are wonderful C++ constructs with no true equivalent in Python (or most any Garbage Collected language, for that matter).

The semantics around object lifetimes are just too different.

But what if we could bring C++’s destructors into Python? What if we could bring more semantics?

In this talk I will present a library that does exactly that. We will bring destructors, function overloading, member access specifiers, and more into Python. You will see the implementation of each feature, and all the dirty tricks used to make them work.

By replicating parts of C++ in Python, we will also gain a better understanding of C++’s semantics and the interactions between different language features.

Existing Python knowledge is not required; we will cover all the relevant syntax and semantics during the talk.

=====

Tamir is a software engineer and reverse engineer. He likes playing around with software and finding simple solutions for complex problems, and complex solutions for simple problems.

Tamir is an Advanced Technologies Team Leader at JFrog, and a member of the Israeli ISO C++ National Body Discussion Group.