From type checking by recursive descent to type checking with an abstract machine

  • Authors:
  • Ilya Sergey;Dave Clarke

  • Affiliations:
  • Katholieke Universiteit Leuven, Belgium;Katholieke Universiteit Leuven, Belgium

  • Venue:
  • Proceedings of the Eleventh Workshop on Language Descriptions, Tools and Applications
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

Abstract

Modern type systems for programming languages usually incorporate additional information useful for program analysis, e.g., effects, control flow, non-interference, strictness etc. When designing a typing predicate for such systems, a form of logical derivation rules is normally taken. Despite the expressivity of this approach, the straightforward implementation of an appropriate type checker is usually inefficient in terms of stack consumption and further optimisations. This leads to a significant gap between an analysis and program implementing the analysis. In this paper we demonstrate an application of techniques investigated by Danvy et al. to derive an abstract machine for typing from the traditional recursive descent approach. All used techniques are off-the-shelf and no appropriate correspondence theorems between an initial type system and the derived abstract machine needs to be proven: they are instead corollaries of the correctness of inter-derivation and of the initial specification. Whereas a recursive descent is something straightforward to implement based on declarative typing rules, the derived abstract machine exposes behaviour similar to Landin's SECD machine and gives a solid basis for further optimizations using abstract interpretation.