Here is how it would work:
- Add a module
from A import special_operation that operates on numpy arrays and implements the operation using numpy arrays
- Add custom type annotations
from A import memory_device_l1 and use it in annotating numpy arrays
- Add a plugin that implements an ASR->ASR pass that transforms all these annotations and special operations into low level C / API calls for the specific hardware API
The module A and the plugin (as an so library) will be shipped externally, not as part of LPython.
This will allow anybody to extend LPython to work for their custom hardware.