Continuum Analytics: Documentation

# Extending Numba

This chapter describes how to extend Numba to make it recognize and support additional operations, functions or types. Numba provides two categories of APIs to this end:

- The high-level APIs provide abstracted entry points which are sufficient for simple uses. They require little knowledge of Numba’s internal compilation chain.
- The low-level APIs reflect Numba’s internal compilation chain and allow flexible interaction with its various layers, but require more effort and experience with Numba internals.

It may be helpful for readers of this chapter to also read some of the documents in the developer manual, especially the architecture document.

- High-level extension API
  - Implementing functions
  - Implementing methods
  - Implementing attributes
- Low-level extension API
  - Typing
  - Lowering
    - Native operations
    - Constants
    - Boxing and unboxing
- Example: an interval type
  - Extending the typing layer
    - Creating a new Numba type
    - Type inference for Python values
    - Type inference for operations
  - Extending the lowering layer
    - Defining the data model for native intervals
    - Exposing data model attributes
    - Exposing a property
    - Implementing the constructor
    - Boxing and unboxing
  - Using it
  - Conclusion