ACM Home Page
Please provide us with feedback. Feedback
Tagless staged interpreters for typed languages
Full text PdfPdf (204 KB)
Source International Conference on Functional Programming archive
Proceedings of the seventh ACM SIGPLAN international conference on Functional programming table of contents
Pittsburgh, PA, USA
Pages: 218 - 229  
Year of Publication: 2002
ISBN:1-58113-487-8
Also published in ...
Authors
Emir PašaliΕ  Oregon Health & Science University
Walid Taha  Rice University
Tim Sheard  Oregon Health & Science University
Sponsors
SIGPLAN: ACM Special Interest Group on Programming Languages
ACM: Association for Computing Machinery
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 3,   Downloads (12 Months): 36,   Citation Count: 13
Additional Information:

abstract   references   cited by   index terms   collaborative colleagues  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/581478.581499
What is a DOI?

ABSTRACT

Multi-stage programming languages provide a convenient notation for explicitly staging programs. Staging a definitional interpreter for a domain specific language is one way of deriving an implementation that is both readable and efficient. In an untyped setting, staging an interpreter "removes a complete layer of interpretive overhead", just like partial evaluation. In a typed setting however, Hindley-Milner type systems do not allow us to exploit typing information in the language being interpreted. In practice, this can mean a slowdown cost by a factor of three or mor.Previously, both type specialization and tag elimination were applied to this problem. In this paper we propose an alternative approach, namely, expressing the definitional interpreter in a dependently typed programming language. We report on our experience with the issues that arise in writing such an interpreter and in designing such a language. .To demonstrate the soundness of combining staging and dependent types in a general sense, we formalize our language (called Meta-D) and prove its type safety. To formalize Meta-D, we extend Shao, Saha, Trifonov and Papaspyrou's λH language to a multi-level setting. Building on λH allows us to demonstrate type safety in a setting where the type language contains all the calculus of inductive constructions, but without having to repeat the work needed for establishing the soundness of that system.


REFERENCES

Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.

 
1
Lennart Augustsson. Cayenne -- a language with dependent types. Available from http://www.cs.chalmers.se/~augustss/cayenne.
 
2
Lennart Augustsson and Magnus Carlsson. An exercise in dependent types: A well-typed interpreter. In Workshop on Dependent Types in Programming, Gothenburg, 1999. Available online from www.cs.chalmers.se/~augustss/cayenne/interp.ps.
 
3
Henk P. Barendregt. Lambda calculi with types. In S. Abramsky, D. M. Gabbay, and T. S. E. Maibaum, editors, Handbook of Logic in Computer Science. Oxford University Press, Oxford, 1991.
4
 
5
Luca Cardelli. Phase distinctions in type theory. Unpublished manuscript available online from author's homepage, 1988.
 
6
Thierry Coquand, Bengt Nordström, Jan~M. Smith, and Bjorne von Sydow. Type theory and programming. Bulletin of the European Association for Theoretical Computer Science, 52:203--228, February 1994. Columns: Logic in Computer Science.
7
8
9
10
 
11
Peter Dybjer. Inductively defined sets in Martin-Löf's set theory. In A. Avron, R. Harper, F. Honsell, I. Mason, and G. Plotkin, editors, Workshop on General Logic, February 1987.
 
12
Peter Dybjer. Inductive sets and families in Martin-Löf's type theory and their set-theoretic semantics. In G. Huet and G. Plotkin, editors, Preliminary Proc. of 1st Int. Workshop on Logical Frameworks, Antibes, France, 7--11 May 1990, pages 213--230. 1990. ftp://ftp.inria.fr/INRIA/Projects/coq/types/Proceedings/\\book90.ps.Z.
 
13
 
14
Peter Dybjer. Inductive families. Formal Aspects of Computing, 6(4):440--465, 1994.
 
15
Peter Dybjer. A general formulation of simultaneous inductive-recursive definitions in type theory. Journal of Symbolic Logic, 65(2):525--549, 2000.
 
16
Peter Dybjer and Anton Setzer. Finite axiomatizations of inductive and inductive-recursive definitions. In R. Backhouse and T. Sheard, editors, Informal Proc. of Workshop on Generic Programming, WGP'98, Marstrand, Sweden, 18 June 1998. Dept. of Computing Science, Chalmers Univ. of Techn., and Göteborg Univ., June 1998. Electronic version available at http://wsinwp01.win.tue.nl:1234/WGPProceedings/.
 
17
Eduardo Giménez. A tutorial on recursive types in Coq. Technical Report TR-0221, INRIA Rocquencourt, May 1998.
 
18
 
19
Robert Harper, Furio Honsell, and Gordon Plotkin. A framework for defining logics. In Proceedings Symposium on Logic in Computer Science, pages 194--204, Washington, 1987. IEEE Computer Society Press. The conference was held at Cornell University, Ithaca, New York.
20
 
21
Liwen Huang and Walid Taha. A practical implementation of tag elimination. In preperation.
22
 
23
24
 
25
 
26
 
27
Meta-D: A dependently typed multi-stage language. Available online from http://www.cse.ogi.edu/~pasalic/metad/, 2002.
 
28
MetaOCaml: A compiled, type-safe multi-stage programming language. Available online from http://cs-www.cs.yale.edu/homes/taha/MetaOCaml/, 2001.
 
29
 
30
31
 
32
Bengt Nordström, Kent Peterson, and Jan M. Smith. Programming in Martin-Lof's Type Theory, volume 7 of International Series of Monographs on Computer Science. Oxford University Press, New York, NY, 1990. Currently available online from first authors homepage.
 
33
Oregon Graduate Institute Technical Reports. P.O. Box 91000, Portland, OR 97291-1000,USA. Available online from ftp://cse.ogi.edu/pub/tech-reports/README.html.
 
34
Christine Paulin-Mohring. Inductive definitions in the system Coq: Rules and properties. Research report RR 92-49, Laboratoire de l'Informatique du Parallélisme, Ecole normale supérieure de Lyon, December 1992.
 
35
 
36
Emir Pašalic, Walid Taha, and Tim Sheard. Tagless staged interpreters for typed languages (formal development). Technical Report 02-006, OGI, 2002. Available from {33}.
 
37
 
38
 
39
 
40
Calton Pu, Andrew Black, Crispin Cowan, and Jonathan Walpole. Microlanguages for operating system specialization. In Proceedings of the Workshop on Domain-Specific Languages, Paris, 1997.
41
42
43
44
45
46
 
47
Yannis Smaragdakis and Don Batory. DiSTiL: A transformation library for data structures. In USENIX Conference on Domain-Specific Languages, October 1997.
 
48
 
49
50
 
51
 
52
 
53
Walid Taha and Henning Makholm. Tag elimination -- or -- type specialisation is a type-indexed effect. In Subtyping and Dependent Types in Programming, APPSEM Workshop. INRIA technical report, 2000.
 
54
55
 
56
57
 
58
59
60

CITED BY  13

Collaborative Colleagues:
Emir PašaliΕ: colleagues
Walid Taha: colleagues
Tim Sheard: colleagues