Building a common ecosystem for DSLs

14 February 2023

As we enter the era of exascale supercomputing, a major challenge is how to program these next-generation machines. We are often limited to languages designed for sequential work, which are time-consuming to employ.

Domain Specific Languages (DSLs) potentially offer a way to address this issue. Programmers can work at much higher levels of abstraction and, as a rich source of information is available to the compiler, it can effectively make the tricky, low-level decisions that commonly take time. Also, moving from one architecture to another is much easier because the compiler has more information with which to adapt the code for different hardware.

However a major drawback with DSLs is that they tend to be heavily siloed, where one DSL shares very little or no infrastructure with any other. This is disadvantageous for numerous reasons, such as the high overhead required to actually write a DSL in the first place, and a significant risk for potential users as there are then uncertainties around long-term maintenance of the stack and whether the DSL will still be around in five years time!

In the xDSL project we are looking to address this by leveraging a common ecosystem for DSLs which builds upon the ubiquitous MLIR and LLVM. MLIR, first developed by Google, is a key enabling technology as it provides composable dialects and transformations which can be shared between different compilers. Leveraging these existing building blocks to develop a compiler significantly lowers the barrier to entry, and commonly they generate LLVM-IR which feeds into LLVM. LLVM provides a rich set of backends which target many different hardware architectures and consequently enables code to run on these with minimal changes.

In xDSL we are developing a Python toolbox to lower the barrier to entry to MLIR and LLVM which, until this point, have required a fairly significant learning curve. We are also providing a variety of high  performance computing-focused dialects and transformations that DSL developers can use as the foundation for their own abstractions. We are using the popular Devito and PSyclone DSLs as demonstrators as well as working with other groups to help them integrate their technology with xDSL.

About xDSL

xDSL is a collaboration between The School of Informatics at the University of Edinburgh, Imperial College, and EPCC. It is funded by ExCALIBUR, a £45.7m UK research programme that aims to deliver the next generation of high-performance simulation software for the highest priority fields in UK research. EPCC has funding from this programme to explore a range of topics.

Find out more

We have a growing and thriving open source community around xDSL on GitHub. See our website to find out more: www.xdsl.dev

xDSL diagram

Author

Dr Nick Brown
Nick Brown