EuroPython 2016

Wrestling Python into LLVM Intermediate Representation

Speaker(s) Anna Herlihy

What is LLVM-IR?

The LLVM Compiler Infrastructure Project provides a transportable intermediate representation (LLVM-IR) that can be compiled and linked into multiple types of assembly code. What is great about LLVM-IR is that you can take any language and distill it into a form that can be run on many different machines. Once the code gets into IR it doesn’t matter what platform it was originally written on, and it doesn’t matter that Python can be slow. It doesn’t matter if you have weird CPUs - if they’re supported by LLVM it will run.

What is Tupleware?

TupleWare is an analytical framework built at Brown University that allows users to compile functions into distributed programs that are automatically deployed. TupleWare is unique because it uses LLVM-IR to be language and platform independent.

What is PyLLVM?

This is the heart of the talk. PyLLVM is a simple, easy to extend, one-pass static compiler that takes in the subset of Python most likely to be used by Tupleware. PyLLVM is based on an existing project called py2llvm that was abandoned around 2011.

This talk will go through some basic compiler design and talk about how some LLVM-IR features make our lives easier, and some much harder. It will cover types, scoping, memory management, and other implementation details. To conclude, it will compare PyLLVM to Numba, a Python-to-LLVM compiler from Continuum Analytics and touch on what the future has in store for PyLLVM.

in on Friday 22 July at 12:00 See schedule


  1. Gravatar
    The link for the original Py2LLVM is Wasn't included in the original because I had issues submitting.
    — Anna Herlihy,
  2. Gravatar
    It's very interesting but how can you deliver it in 30 minutes? I suggest switching to 60m.
    — Roberto Polli,
  3. Gravatar
    Hi there.
    Very nice proposal, but I indeed have the some concerns that Roberto pointed out. I definitely feel that you might consider the possibility to switch this talk to a 60 mins one.
    Otherwise, I'm afraid that this talk is not going to be interesting as it should (and sounds).

    my 2¢
    — Valerio Maggio,
  4. Gravatar
    Thanks for the feedback. I will definitely take your comments into consideration, and do my best to keep it simple.

    This project is a many-legged monster, but in this talk I will be focusing only on PyLLVM itself, which is a pretty small and self-contained leg. I will try my best to include the necessary background without overwhelming the audience. If I were to go into full detail, 60 minutes may not be enough, so I think it would be best to give a comprehensive summary and invite people who are especially interested to read the paper ( or talk to me after.
    — Anna Herlihy,

New comment