At SC15 last week I had the opportunity to present a tutorial on how to design, build, and compile your own domain-specific language using Python. I am now releasing the tutorial material under a Creative Commons license for the community to use and build on.
Specifically, the material covers:
how to define mathematically-oriented domain-specific languages ("DSLs") in Python
how to build transformations for your DSLs to take them from abstraction to implementation
how to generate highly efficient code from your domain-specific language
how to use just-in-time compilation with OpenCL from Python to execute generated code
a few existing design studies and use cases for domain-specific languages
how to use loopy to generate highly efficient code to work with array data targeting heterogeneous processor architectures (CPUs/GPUs)
A brief, generic introduction to Python and Numpy is also included for those coming from other languages.
Using Github's rendering of IPython/Jupyter notebooks, it's quite easy (and hopefully fun) to click around and browse the source repository. A virtual machine image is also available to support experimentation with the software tools being demonstrated.
I am making the material for this tutorial available under a Creative Commons license for others to use and build on.