Supporting compile-time debugging and precise error reporting in meta-programs

  • Authors:
  • Yannis Lilis;Anthony Savidis

  • Affiliations:
  • Institute of Computer Science, FORTH, Greece;Institute of Computer Science, FORTH, Greece,Department of Computer Science, University of Crete, Greece

  • Venue:
  • TOOLS'12 Proceedings of the 50th international conference on Objects, Models, Components, Patterns
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

Compile-time meta-programming is an advanced language feature enabling to mix programs with definitions that are executed at compile-time and may generate source code to be put in their place. Such definitions are called meta-programs and their actual evaluation constitutes a compilation stage. As meta-programs are also programs, programmers should be supported in handling compile-time and runtime errors, something introducing challenges to the entire tool chain along two lines. Firstly, the source point of a compile error may well be the outcome of a series of compilation stages, thus never appearing within the original program. Effectively, the latter requires a compiler to track down the error chain across all involved stages so as to provide a meaningful, descriptive and precise error report. Secondly, every compilation stage is instantiated by the execution of the respective staged program. Thus, typical full-fledged source-level debugging for any particular stage should be facilitated during the compilation process. Existing implementations suffer in both terms, overall providing poor error messages, while lacking the required support to debug meta-programs of any staging depth. In this paper we firstly outline an implementation of a meta-programming system offering all mentioned facilities. Then, we detail the required amendments to the compilation process. Finally, we discuss the necessary interoperation points between the compiler and the tool-chain (IDE).