Toying with Python ByteCode - Hands-on session

Jan Chwiejczak | Friday 10:30 | Room J

Ever wondered what happens when you execute your Python programs? Would you like to gain insights into writing performance-oriented code or be able to explain why Python is an interpreted or compiled language? 

If so, then please drop in. I will take you on a walk in the forest of abstract syntax trees grown by lexers and parsers where compilers generate streams of bits understood and run by interpreters. Together, we will examine the "intermediate language" responsible for expressing your code as machine instructions, and look at the ways in which we can understand it, for fun and profit, through an application of the dis module. 

Using these learnings, we will pair up and optimise some problematic Python code in the second part of this session. We will also reflect on how this code appears from the perspective of the Interpreter.

This is a beginner level talk and the only prerequisites are a curious mind, basic Python knowledge and a laptop with Jupyter Notebook installed running Python 3.x. If you don't have the latter, rest assured there will be enough people with one around.