A walk with CPython

Sadhana Srinivasan

Playlists: 'sps23' videos starting here / audio

Did you know that Python has a compiler even though it’s an interpreted language? In this talk, we will embark on a step-by-step exploration of a simple program, unraveling the inner workings of CPython — the default reference implementation of Python. We’ll begin with the compiler, which performs the task of converting Python code into OPCODES. Next, we’ll explore the famous interpreter. We’ll uncover how it works with the generated OPCODES, executing the program line by line and talk about an example of optimisations it does along the way. We’ll explore how Python manages variables, function calls, and exceptions. Additionally, we’ll touch upon object creation and destruction. The primary aim of this talk is to provide a concise yet comprehensive overview of the components involved in executing a simple program within CPython. Through precise references to the CPython code base, attendees will be equipped to explore further on their own.

Did you know that Python has a compiler even though it’s an interpreted language? In this talk, we will embark on a step-by-step exploration of a simple program, unraveling the inner workings of CPython — the default reference implementation of Python. We’ll begin with the compiler, which performs the task of converting Python code into OPCODES. Next, we’ll explore the famous interpreter. We’ll uncover how it works with the generated OPCODES, executing the program line by line and talk about an example of optimisations it does along the way. We’ll explore how Python manages variables, function calls, and exceptions. Additionally, we’ll touch upon object creation and destruction. The primary aim of this talk is to provide a concise yet comprehensive overview of the components involved in executing a simple program within CPython. Through precise references to the CPython code base, attendees will be equipped to explore further on their own.

Download

Embed

Share:

Tags