~/talk

How to write a JIT compiler in 30 minutes

Talkat EuroPython 2019 · 2019-07-08..07-14· [compilers-and-language-design, python]
slides:none on file

Claims a working x86_64 JIT for a float-only subset of Python is written from scratch during the demo and actually runs. Uses an assembly encoder library, allocates executable memory with mmap + ctypes.CFUNCTYPE, and emits machine bytes; parses Python with ast visitor + stack evaluation, implements a trivial register allocator (one register per variable), supports constants, names, binary ops, assignments, comparisons, if/while and a @compiled decorator. The produced JIT sometimes needs debugging but runs a Pi-digit benchmark several times faster than CPython.

AI-written summary · about

  1. 0:00Introduction and scope
  2. 1:04Understanding machine code
  3. 2:26Executing code from Python
  4. 4:11Creating a JIT test framework
  5. 5:51Implementing register allocator
  6. 8:50AST parsing and code generation
  7. 16:53Handling constants and returns
  8. 20:23Compiling function arguments
  9. 22:19Binary operations and assignment
  10. 26:43Control flow with If statements
  11. 32:40Function decorator implementation
  12. 33:58Benchmarking and conclusion
  13. 36:11Q&A session
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.