Run-time Code Generation and Modal-ML

Abstract

This paper presents early experience with a typed programming language and compiler for runtime code generation. The language is an extension of the SML language with modal operators, based on the lambda(square) language of Davies and Pfenning. It allows programmers to specify precisely, through types, the stages of computation in a program. The compiler generates target code that makes use of runtime code generation in order to exploit the staging information. The target machine is currently a version of the Categorial Abstract Machine, called the CCAM, which we have extended with facilities for runtime code generation. Using this approach, the programmer is able to express the staging that he wants to the compiler directly. It also provides a typed framework in which to verify the correctness of his staging intentions, and to discuss his staging decisions with other programmers. Finally, it supports in a natural way multiple stages of runtime specialization, so that dynamically generated code can be used to generate yet further specialized code. This paper presents an overview of the language, with several examples of programs that illustrate key concepts and programming techniques. Then, it discusses the CCAM and the compilation of lambda(square) programs into CCAM code. Finally, the results of some experiments are shown, to demonstrate the benefits of this style of runtime code generation for some applications.

Open PDF

Document Details

Document Type
Technical Report
Publication Date
Jan 01, 1998
Accession Number
ADA339112

Entities

People

  • Frank Pfenning
  • Peter P Lee
  • Philip Wickline

Organizations

  • Carnegie Mellon University

Tags

Communities of Interest

  • Energy and Power Technologies

DTIC Thesaurus Topics

  • Application Software
  • Compilers
  • Computations
  • Computer Programming
  • Computer Programs
  • Computer Science
  • Computers
  • Demographic Cohorts
  • Environment
  • Generators
  • Instructions
  • Language
  • Machine Languages
  • Notation
  • Optimization
  • Programming Languages
  • Translations

Fields of Study

  • Computer science
  • Engineering

Readers

  • Computational Linguistics
  • Computer Programming and Software Development.