ABSTRACT
Self-representation -- the ability to represent programs in their own language -- has important applications in reflective languages and many other domains of programming language design. Although approaches to designing typed program representations for sublanguages of some base language have become quite popular recently, the question whether a fully metacircular typed self-representation is possible is still open. This paper makes a big step towards this aim by defining the Fω* calculus, an extension of the higher-order polymorphic lambda calculus Fω that allows typed self-representations. While the usability of these representations for metaprogramming is still limited, we believe that our approach makes a significant step towards a new generation of reflective languages that are both safe and efficient.
- T. Altenkirch and C. McBride. Generic programming within dependently typed programming. In Proceedings of the IFIP TC2/WG2.1 Working Conference on Generic Programming, pages 1--20. Kluwer, B.V., 2003. Google Scholar
Digital Library
- B. Aydemir, A. Charguéraud, B.C. Pierce, R. Pollack, and S. Weirich. Engineering formal metatheory. In POPL '08, pages 3--15, New York, NY, USA, 2008. ACM. Google Scholar
Digital Library
- H.P. Barendregt. Lambda calculi with types. In Handbook of logic in computer science (vol. 2): background: computational structures, pages 117--309. Oxford University Press, 1992. Google Scholar
Digital Library
- S. Berardi. Towards a mathematical analysis of the Coquand-Huet calculus of constructions and the other systems in Barendregt's cube. Technical report, Department of Computer Science, Carnegie-Mellon University and Dipartimento Matematica, Universita di Torino, 1988.Google Scholar
- Y. Bertot and P. Castéran. Interactive Theorem Proving and Program Development, Coq'Art:The Calculus of Inductive Constructions. Springer-Verlag, 2004. Google Scholar
Digital Library
- C. Böhm and A. Berarducci. Automatic synthesis of typed lambda-programs on term algebras. Theor. Comput. Sci., 39:135--154, 1985.Google Scholar
Cross Ref
- J. Carette, O. Kiselyov, and C. Shan. Finally tagless, partially evaluated. In APLAS'07, extended version to appear in Journal of Functional Programming, pages 222--238. Springer LNCS 4807, 2007.Google Scholar
- T. Coquand. An analysis of Girard's paradox. In Symposium on Logic in Computer Science, pages 227--236. IEEE Computer Society Press, 1986.Google Scholar
- R. Davies and F. Pfenning. A modal analysis of staged computation. J. ACM, 48(3):555--604, 2001. Google Scholar
Digital Library
- N.G. de Bruijn. Lambda calculus notation with nameless dummies. a tool for automatic formula manipulation with application to the church-rosser theorem. Indagationes Mathematicae, 34:381--392, 1972.Google Scholar
Cross Ref
- L. Fegaras and T. Sheard. Revisiting catamorphisms over datatypes with embedded functions (or, programs from outer space). In POPL '96, pages 284--294. ACM, 1996. Google Scholar
Digital Library
- J.Y. Girard. Interprétation fonctionelle et élimination des coupures de l'arithmétique d'ordre supérieur. Thése de doctorat detat, Université de Paris VII, 1972.Google Scholar
- M. Hagiya. Meta-circular interpreter for a strongly typed language. J. Symb. Comput., 8(6):651--680, 1989. Google Scholar
Digital Library
- R. Harper and G. Morrisett. Compiling polymorphism using intensional type analysis. In POPL '95, pages 130--141. ACM, 1995. Google Scholar
Digital Library
- R. Hinze, J. Jeuring, and A. Löh. Type-indexed data types. Sci. Comput. Program., 51(1--2):117--151, 2004. Google Scholar
Digital Library
- C. Hofer, K. Ostermann, T. Rendel, and A. Moors. Polymorphic embedding of DSLs. In GPCE'08. ACM, 2008. Google Scholar
Digital Library
- K. Läufer and M. Odersky. Self-interpretation and reflection in a statically typed language. In Proc. OOPSLA Workshop on Reflection and Metalevel Architectures. ACM, Oct. 1993.Google Scholar
- J. McCarthy. Recursive functions of symbolic expressions and their computation by machine, part i. Commun. ACM, 3(4):184--195, 1960. Google Scholar
Digital Library
- A. Nanevski. Meta-programming with names and necessity. In ICFP, pages 206--217, 2002. Google Scholar
Digital Library
- F. Pfenning and C. Elliot. Higher-order abstract syntax. In PLDI '88, pages 199--208. ACM, 1988. Google Scholar
Digital Library
- F. Pfenning and P. Lee. Metacircularity in the polymorphic lambda-calculus. Theoretical Computer Science, 89(1):137--159, 1991. Google Scholar
Digital Library
- F. Pfenning and C. Paulin-Mohring. Inductively defined types in the calculus of constructions. In Proceedings of the 5th International Conference on Mathematical Foundations of Programming Semantics, pages 209--228. Springer-Verlag, 1990. Google Scholar
Digital Library
- M.B. Reinhold. Typechecking is undecidable when 'type' is a type. Technical report, Massachusetts Institute of Technology, 1989. Google Scholar
Digital Library
- J.C. Reynolds. Definitional interpreters for higher-order programming languages. In ACM '72: Proceedings of the ACM annual conference, pages 717--740. ACM, 1972. Google Scholar
Digital Library
- J.M. Siskind and B.A. Pearlmutter. First-class nonstandard interpretations by opening closures. In POPL '07, pages 71--76. ACM, 2007. Google Scholar
Digital Library
- B.C. Smith. Reflection and semantics in LISP. In POPL '84, pages 23--35. ACM, 1984. Google Scholar
Digital Library
- G.L. Steele. Growing a language. Higher-Order and Symbolic Computation, 12(3):221--236, 1999. Google Scholar
Digital Library
- W. Taha, Z. Benaissa, and T. Sheard. Multi-stage programming: Axiomatization and type-safety. In In 25th International Colloquium on Automata, Languages, and Programming, pages 918--929. Springer-Verlag, 1998. Google Scholar
Digital Library
- J. Terlouw. Een nadere bewijstheoretische analyse van GSTT's. Technical report, Department of Computer Science, Catholic University, Nijmegen, The Netherlands, 1989.Google Scholar
- G. Washburn and S. Weirich. Boxes go bananas: Encoding higher-order abstract syntax with parametric polymorphism*. J. Funct. Program., 18(1):87--140, 2008. Google Scholar
Digital Library
Index Terms
Typed self-representation
Recommendations
Typed self-evaluation via intensional type functions
POPL '17: Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming LanguagesMany popular languages have a self-interpreter, that is, an interpreter for the language written in itself. So far, work on polymorphically-typed self-interpreters has concentrated on self-recognizers that merely recover a program from its ...
Typed self-representation
PLDI '09Self-representation -- the ability to represent programs in their own language -- has important applications in reflective languages and many other domains of programming language design. Although approaches to designing typed program representations ...
Typed self-evaluation via intensional type functions
POPL '17Many popular languages have a self-interpreter, that is, an interpreter for the language written in itself. So far, work on polymorphically-typed self-interpreters has concentrated on self-recognizers that merely recover a program from its ...







Comments