2025-09-13 –, Ballroom 3
Have you ever thought about adding a feature to the Python language itself?
If you have, or just want to learn a bit about how Python works under the hood, we will step through the story of adding a small feature to a fork of Python, learning about compilers and interpreters along the way!
In languages such as OCaml and Elixir, a pipe operator (|>
) can be used to thread the return value of a function through to the argument of the next, to reduce nesting and improve readability: it lets you turn x |> f(a, b)
into f(a, b, x)
. Frustrated by the lack of such an operator in Python, and armed with some previous experience in compilers, I started a side project to fix the problem myself!
In this talk I will step through the story of how and why I added this feature to a fork of Python I've nicknamed 'Pypethon'. We will explore some of the internal workings of the Cpython interpreter, focusing on lexing, parsing and the abstract syntax tree. We will also explore why you might want to make changes to the interpreter, the design challenges you can face when adding new language features, as well as potential tradeoffs. No experience in compilers required!
Alex is a student at ANU, currently completing her honours in computer science. She has been a long time lover of languages, both for computers and people, and is always willing to share her passion for niche programming language features.
When she isn't dreaming of syntax trees and compiler optimisations, Alex enjoys playing the organ, board games, baking and being snobby about tea ☕.