Implementing the MyFEM Embedded Domain-specifc Language
Mython, an extensible variant of the Python programming language, exposes the tools and libraries of its implementation to users. This kind of reflection allows domain-specific language implementations to reuse parts of Mython. This paper looks at the MyFEM domain-specific language, showing how MyFEM reuses the tools of Mython. MyFEM is a language for describing partial-differential equations and boundary conditions as a part of the finite element method. Using MyFEM as a high-level interface, users can generate fast, scalable scientific codes using very compact source programs. This paper also discusses plans for further automation, where MyFEM and Mython act as a seamless front end. These plans involve not just hiding the target code from the user, but also any necessary build details, including linkage and foreign function interfaces.