2. Motivation
• Python is great for rapid development
and high-level thinking-in-code
• It is slow for interior loops because lack
of type information leads to a lot of
indirection and “extra” code.
3. Motivation
• NumPy users have a lot of type
information --- but only currently have
one-size fits all pre-compiled, vectorized
loops.
• Many new features envisioned will need
the ability for high-level expressions to
be compiled to machine code.
4. Goal:
rapid iteration and development
+
fast code execution
Numba should be the world’s best
array-oriented compiler.
5. NumPy + Mamba = Numba
Python Function Machine Code
LLVM-PY
LLVM Library
ISPC OpenCL OpenMP CUDA CLANG
Intel AMD Nvidia Apple ARM
6. Example
Numba
@jit(‘f8(f8)’)
def sinc(x):
if x==0.0:
return 1.0
else:
return sin(x*pi)/(pi*x)
7. Status and Future
• My early bytecode branch further developed by
Jon Riehl (Resilient Science) sponsored by
Continuum Analytics, Inc. --- interprets bytecode
directly
• Current trunk works with AST directly and
making rapid progress
- Mark Florrison (minivect)
- Siu Kwan Lam (pymothoa)
9. RoadMap
• Numba 0.2 available now
• Github trunk has many changes -- 0.3 will support
- structures
- Python code
- objects with inheritance
Check out NumbaPro
for cutting-edge features
10. Software Stack Future?
Plateaus of Code re-use + DSLs
SQL R
TDPL Matlab
Python
OBJC C
FORTRAN C++
LLVM