Building a Compiler Back End
The CSDL compiler back end must
- Provide a class named
Simulator
that conforms to theSimulatorBase
API (see Developer API).- The
Simulator
class should inherit fromSimulatorBase
- The
Simulator
class constructor must have aModel
instance as an unnamed argument and call theModel.define
method. The user does not need to ever callModel.define
.
- The
- Implement the entire Standard Library, and the partial derivatives for each standard operation.
- Implement the MAUD architecture.
- Not store a
Model
object; i.e. deletion of theModel
object must be allowed after aSimulator
object is constructed, imposing no additional memory overhead whenSimulator.run
is called.
The CSDL compiler back end should
The Simulator
class can be implemented in any language, as long as
there is a Python interface available.
For example, if Simulator
is implemented in C++, the pybind11
library can expose the C++ class to Python.
The Model.sorted_nodes
attribute contains all the nodes for a given
Model
object, sorted in the reverse order of execution.
Each Operation
and Subgraph
node in Model.sorted_nodes
contains
enough information to generate executable code for the entire model
specification.