A meta-circular language for active libraries

作者:Servetto Marco; Zucca Elena*
来源:Science of Computer Programming, 2014, 95: 219-253.
DOI:10.1016/j.scico.2014.05.003

摘要

We present a new Java-like language design coupling disciplined meta-programming features with a composition language. That is, programmers can write meta-expressions that combine class definitions, on top of a small set of composition operators, inspired by the seminal Bracha%26apos;s Jigsaw framework. Moreover, such operators are deep, that is, they allow manipulation (e.g., renaming or duplication) of a nested class at any level of depth. This provides an effective language support for active libraries: namely, a (library) class can provide a method returning a customized version of a class, depending, e.g., on the execution platform. Since a class can contain nested classes, a whole library can be generated in this way. That is, deep operators allow the programmer to better exploit meta-programming capabilities, leading to a %26quot;meta-programming in the large%26quot; style. We adopt a mixed typechecking technique, which provides a good compromise between meta-programming systems with extreme expressiveness and no static type checking, and those with strong type system and only limited meta-programming capability. In particular, our technique ensures an important property, called meta-level soundness, stating that typing errors never originate from already compiled (meta-)code, that is, programmers can safely use (active) libraries.

  • 出版日期2014-12-1