It’s a surprising fact that C++ and Python are often and effectively used together. They are different and tend to be used, on their own, in very different ways. Why should they be associated more than most pairs of languages?
The answer is history. The originator of Python, Guido van Rossum, was making his name at the time when C++ was the new cool language. C++ was the tool with which most people implemented object-oriented software designs. You can see the influence in the similarities between the OO aspects of the two languages (classes, multiple inheritances, etc.). However, initially, most people saw Python as just "a better Perl" (which is why we still call Python programs “scripts”).
Fast forward 10 - 15 years and everyone’s using Python - including C++ programmers. Due to its ease of development, there are now many more libraries for Python than for C++. But: some of these are too slow in pure Python. Library writers have needed to cross the language divide from the beginning. Thus, packages like ctypes, SWIG, Boost.Python and PyBind11 (amongst others) have been developed.
At the same time, in a large system with many types of users and developers, the availability of C++ to Python projects is very convenient. Processing-intensive functionality can be written in efficient C++ and then exposed to Python. This has, in fact, yielded many real-world use cases. In finance, for example, complex quant libraries can be provided for rapid experimentation in Python by structures and others.
The vast array of Python packages has also led to the reverse arrangement. By embedding a Python interpreter in C++ code, you get access to all that functionality. This is useful, for instance, for regular expression parsing. In another use, Python can be used as a scripting language within a C++ application and executed by the embedded interpreter on the fly.
In our webinar, Antony Peacock, a professional financial programmer and a voting member of the International ISO C++ Committee, will discuss some of the ways Python is used with C++ in practice. He will talk through some ways large trading houses and investment banks where he’s worked combine these languages.
Rainer Grimm himself will present specific Python/C++ uses and techniques. He will look at both C++ incorporated into Python and with the Python interpreter embedded in C++.
Finally, Richard Hickling will show us the code. He will step through the exposure of a simple C++ financial use case in Python and demo it for us.
Here are the details: