کد مقاله | کد نشریه | سال انتشار | مقاله انگلیسی | نسخه تمام متن |
---|---|---|---|---|
433269 | 1441669 | 2014 | 35 صفحه PDF | دانلود رایگان |
• We present a new Java-like language design coupling disciplined meta-programming features with a composition language.
• We provide an effective language support for active libraries.
• An incremental approach prevents type errors, while keeping expressiveness.
• Meta-level soundness is ensured, that is, programmers can safely use active libraries.
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'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 “meta-programming in the large” 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.
Journal: Science of Computer Programming - Volume 95, Part 2, 1 December 2014, Pages 219–253