The CERES compiler generator at DIKU (1982-84) - PowerPoint PPT Presentation

1 / 9
About This Presentation
Title:

The CERES compiler generator at DIKU (1982-84)

Description:

We use the notation L-programs to mean Dom(L). Defn. Let L, M and N be programming languages. ... called a compiler generator if Dom(T(cocom))= LangDef and d ... – PowerPoint PPT presentation

Number of Views:31
Avg rating:3.0/5.0
Slides: 10
Provided by: madst
Category:

less

Transcript and Presenter's Notes

Title: The CERES compiler generator at DIKU (1982-84)


1
The CERES compiler generator at DIKU (1982-84)
  • Neil Fest, Aug. 2007

2
Languages and compilers
  • Defn. A programming language L is a partial
    function L A (A A). We use the
    notation L-programs to mean Dom(L).
  • Defn. Let L, M and N be programming languages.
    Then ?n ?N-programs? L M ? (N(n))?.

L p i M (N n p) i
3
Compiler generation
  • Assume a set LangDef ? A of so-called language
    definitions and a function which maps every d
    ?LangDef to Ld, the language defined by d.
  • Compiler generation problem how do we transform
    d into a compiler
  • comp ? ?

4
Compiler generator
  • Definition A T-program cocom is called a compiler
    generator if Dom(T(cocom)) LangDef and ? d ?
    LangDef, T cocom d ?

5
Every compiler generator is a compiler
  • Definition A programming language ? with
    ?-programs LangDef is said to be an implicit
    compiler defining language (i.c.d.l.) if ? d ?
    LangDef, d ? .
  • Theorem Let cocom be a compiler generator. Then
    there exits at least one i.c.d.l. ? which
    satisfies cocom ?
    .
  • Note that compiler generation is then just
    compilation

Proof hint ? T o (T cocom)
d
comp
cocom
6
Defining ? in itself
  • Let us say that an i.c.d.l. ? is consistent, if
    there exists a definition ? such that L? ?.
  • If such a ? exists, then
  • ? ?
  • and one can generate at compiler generator by

cocom
?
7
Small and beautiful
  • ? 2400 bytes (itself generated)
  • cocom 6166 bytes (generated)

8
The connection to partial evaluation
  • Let ? be defined by
  • ?(d, p, x1,,xn) Ld p (x1,,xn)
  • Lemma (JonesTofte 83/84?,unpublished)? ? ?
    ?-programs ? is a autoprojector for (?, T) iff
    ? implicit compiler defining language ?
  • for (?,T) with
    ? ?

9
The connection to partial evaluation
  • Let ? be defined by
  • ?(d, p, x1,,xn) Ld p (x1,,xn)
  • Lemma (JonesTofte 83/84?,unpublished)? mix ?
    ?-programs mix is a partial evaluator for (?,
    T) iff ? metacompiling language ?
  • for (?,T) with
    mix ?
Write a Comment
User Comments (0)
About PowerShow.com