General purpose languages should be metalanguages

  • Authors:
  • Jeremy G. Siek

  • Affiliations:
  • University of Colorado at Boulder, Boulder, CO, USA

  • Venue:
  • Proceedings of the 2010 ACM SIGPLAN workshop on Partial evaluation and program manipulation
  • Year:
  • 2010

Quantified Score

Hi-index 0.00

Visualization

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.