Skip to main content

Building a Compiler Back End


The CSDL compiler back end must

  • Provide a class named Simulator that conforms to the SimulatorBase API (see Developer API).
    • The Simulator class should inherit from SimulatorBase
    • The Simulator class constructor must have a Model instance as an unnamed argument and call the Model.define method. The user does not need to ever call Model.define.
  • 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 the Model object must be allowed after a Simulator object is constructed, imposing no additional memory overhead when Simulator.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.