ABSTRACT
In his paper, The Next 700 Programming Languages, the late Landin writes that "most programming languages are partly a way of expressing things in terms of other things and partly a basic set of given things." Landin tries to separate the general purpose aspects of a language from the problem specific aspects. Instead of hundreds of languages with ad-hoc differences, Landin proposes one general-purpose language with many different sets of primitive operations for different problem domains.
However, achieving this separation is not so easy: the domain specific parts cannot always be neatly packaged up in a set of primitives, but instead may require complex syntactic and semantics structures. In the last decade or so we made significant steps towards this vision through the development domain-specific embedded languages (DSELs). We discovered how to trick several general purpose languages into making software libraries look like domain-specific languages. As a result, we now develop DSELs that enjoy many of the benefits of a real languages: they perform domain-specific type checking, they provide custom syntactic abstractions, and they optimize themselves to achieve high efficiency. Most importantly, unlike real languages, DSELs nicely inter-operate with each other through the underlying general purpose language.
The main limitation of today's DSELs is that they leak: the underlying general purpose language peeks through at inopportune times. This is not surprising; these general purpose languages were not designed to be metalanguages for building DSELs. In this talk I argue that general purpose languages should be designed to be metalanguages and I identify some features that could help our general purpose languages become metalanguages.
Index Terms
- General purpose languages should be metalanguages
Recommendations
A Survey of Metaprogramming Languages
Metaprogramming is the process of writing computer programs that treat programs as data, enabling them to analyze or transform existing programs or generate new ones. While the concept of metaprogramming has existed for several decades, activities ...
LibDSL: a library for developing embedded domain specific languages in d via template metaprogramming
GPCE '14This paper presents a library called LibDSL that helps the implementer of an embedded domain specific language (EDSL) effectively develop it in D language. The LibDSL library accepts as input some kinds of ``specifications'' of the EDSL that the ...
LibDSL: a library for developing embedded domain specific languages in d via template metaprogramming
GPCE 2014: Proceedings of the 2014 International Conference on Generative Programming: Concepts and ExperiencesThis paper presents a library called LibDSL that helps the implementer of an embedded domain specific language (EDSL) effectively develop it in D language. The LibDSL library accepts as input some kinds of ``specifications'' of the EDSL that the ...
Comments