Under the hood : start peeking at the Python machinery
Many a Python programmer must have had the curiosity to look under the hood and understand how the code that they have just written actually comes into action. I had the same curiosity to understand and visualise the interpreter - the way I understand the C-compilation process and the generated microcode. However, we all know that this activity is much more involved than learning Python itself. While it is quite straightforward to leverage the massive amount of online resources to quickly learn Python, there are relatively fewer resources on the interpreter itself. When you add the higher complexity of the interpreter to this, the bar becomes high to even start this exercise. This talk is built upon my learnings on this journey and hopefully serves as better start point for similar minded Python enthusiasts.
After quickly getting past the basics, this talk will cover the material you need for this journey - starting with concepts like, disassembly of Python source, byte codes and an overview of the structure of the CPython interpreter. I will spend most of the time on completely dissecting a couple of toy Python programs as they are handled in CPython. We will close out with the setup to build and tweak the interpreter for your experimentation, all illustrated with examples.
Must have programmed for at least an year with Python and have a basic knowledge of C programming.
Sriram Gorti has developed code in a variety of languages, from assembly language, C, C++, Tcl/Perl and Python over two decades in the software industry. Even when my current day-job in Amazon does not require Python, I leverage it heavily for various kinds of tools and also as a stress-buster !!