Friday 3:15 p.m.–4 p.m.
Getting Hy on Python: How to implement a Lisp front-end to Python
- Audience level:
- Python Internals
This talk will cover the internals of Python, such AST, Import hooks, creating a console, and a very brief overview of Python internal formats (such as pyc files), by way of looking over the implementation of a Lisp called "Hy". No Lisp knowledge is required.
This talk will spend time walking through a Lisp front-end called "Hy" that compiles down to Python bytecode by way of Python AST. The process of importing, compiling and running Hy in a way that is transparent to Python helps to demonstrate how you can use these tools to target the Python runtime in ways that folks don't generally take advantage of. !(https://1.gravatar.com/avatar/9c309ae1c493de7e828a5a299f02b6b9) (cuddles, the cuttlefish, our mascot) The talk will focus on some lesser-known parts of Python internals, such as: * AST, such as why it's a good tool to have, when to use it, and how Hy uses AST to create Python code to be run. * Brief overview of some of the changes between Python 2.x AST and Python 3.x AST * How we can trick the Python debugger to debug Hy by correctly annotating the AST * PEP 302 import hooks, how we can use these to allow custom code to be run in a transparent way to Python * Look over core Python formats, such as the `.pyc`, and how we can create a `.pyc` file from Hy code. The goal of this talk is to motivate people to learn more about Python, and start to think of Python in a more sophisticated and nuanced runtime, not unlike the JVM.