Hostname: page-component-586b7cd67f-l7hp2 Total loading time: 0 Render date: 2024-11-28T19:44:34.362Z Has data issue: false hasContentIssue false

Building language towers with Ziggurat

Published online by Cambridge University Press:  15 October 2008

DAVID FISHER
Affiliation:
Northeastern University
OLIN SHIVERS
Affiliation:
Northeastern University
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

Ziggurat is a meta-language system that permits programmers to develop Scheme-like macros for languages with nontrivial static semantics, such as C or Java (suitably encoded in an S-expression concrete syntax). Ziggurat permits language designers to construct ‘towers’ of language levels with macros; each level in the tower may have its own static semantics, such as type systems or flow analyses. Crucially, the static semantics of the languages at two adjacent levels in the tower can be connected, allowing improved reasoning power at a higher level to be reflected down to the static semantics of the language level below. We demonstrate the utility of the Ziggurat framework by implementing higher level language facilities as macros on top of an assembly language, utilizing static semantics such as termination analysis, a polymorphic type system and higher order flow analysis.

Type
Articles
Copyright
Copyright © Cambridge University Press 2008

References

Abelson, H., Sussman, G. J. & Sussman, J. (1985) Structure and Interpretation of Computer Programs. Cambridge, MA: MIT.Google Scholar
Andreae, C., Noble, J., Markstrum, S. & Millstein, T. (2006) A framework for implementing pluggable type systems. Pages 57–74 of: Proceedings of the 21st ACM SIGPLAN Conference on Object-Oriented Programing, Systems, Languages, and Applications (OOPSLA'06). ACM.CrossRefGoogle Scholar
Baader, F. & Nipkow, T. (1998) Term Rewriting and All That. New York, NY: Cambridge University Press.CrossRefGoogle Scholar
Bachrach, J. & Playford, K. (2001) The Java syntactic extender. Pages 31–42 of: Proceedings of the 16th ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA '01). ACM.CrossRefGoogle Scholar
Baker, J. & Hsieh, W. C. (2002) Maya: Multiple-dispatch syntax extension in Java. Pages 270–281 of: Proceedings of the 2002 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'02). ACM.CrossRefGoogle Scholar
Barendregt, H. (1984) The Lambda Calculus: Its Syntax and Semantics. Rev. ed. Studies in Logic and the Foundation of Mathematics, vol. 103. Amsterdam, The Netherlands, North-Holland.Google Scholar
Brabrand, C., Schwartzbach, M. I. & Vanggaard, M. (2003) The Metafront system: Extensible parsing and transformation. Electron. Notes Theor. Comput. Sci., 82 (3), 592611 (Proceedings of LDTA 2003: Third Workshop on Language Descriptions, Tools and Applications).CrossRefGoogle Scholar
Bravenboer, M. & Visser, E. (2004) Concrete syntax for objects: Domain-specific language embedding and assimilation without restrictions. Pages 365–383 of: Proceedings of the 19th Annual ACM SIGPLAN Conference on Object-Oriented Programing, Systems, Languages, and Applications (OOPSLA'04), Schmidt, D. C. (ed). ACM.CrossRefGoogle Scholar
Byrd, W. E. & Friedman, D. P. (2006, September) From variadic functions to variadic relations: A miniKanren perspective. Proceedings of the Seventh Workshop on Scheme and Functional Programming. Tech. Rept. TR-2006-06. Computer Science Department, University of Chicago.Google Scholar
Church, A. (1941) The Calculi of Lambda-Conversion. Princeton, NJ: Princeton University Press.Google Scholar
Clinger, W. (1991) Hygienic macros through explicit renaming. LISP Point., 4 (4).Google Scholar
Clinger, W. & Rees, J. (1991) Macros that work. Pages 155–162 of: Proceedings of the 18th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL '91). ACM.CrossRefGoogle Scholar
Cousot, P. & Cousot, R. (1977) Abstract interpretation: A unified lattice model for static analysis of programs by construction or approximation of fixpoints. Pages 238–252 of: Conference Record of the Fourth ACM Symposium on Principles of Programming Languages (POPL '77). ACM.CrossRefGoogle Scholar
DeRemer, F. & Pennello, T. (1982) Efficient computation of LALR(1) look-ahead sets. ACM Trans. Program. Language Syst., 4 (4), 615649.CrossRefGoogle Scholar
Dybvig, R. K. (1992) Writing Hygienic Macros in Scheme With Syntax-Case. Tech. Rept. TR 356. Computer Science Department, Indiana University.Google Scholar
Dybvig, R. K., Hieb, R. & Bruggeman, C. (1992) Syntactic abstraction in Scheme. LISP Symbol. Comput., 5 (4), 295326.CrossRefGoogle Scholar
Ekman, T. & Hedin, G. (2004) Rewritable reference attributed grammars. Pages 147–171 of: Proceedings of the 2004 European Conference on Object-Oriented Programming (ECOOP '04). Lecture Notes in Computer Science, vol. 3086. Springer-Verlag.CrossRefGoogle Scholar
Ekman, T. & Hedin, G. (2007) The JastAdd extensible Java compiler. Pages 1–18 of: Proceedings of the 22nd Annual ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA '07). ACM.CrossRefGoogle Scholar
Flatt, M. (2002) Composable and compilable macros: You want it when? Pages 72–83 of: Proceedings of the 7th ACM SIGPLAN International Conference on Functional Programming (ICFP '02). ACM.CrossRefGoogle Scholar
Flatt, M., McMullan, B., Owens, S. & Shivers, O. (2004, October) Lexer and parser generators in Scheme. Pages 41–52 of: Proceedings of the 5th Workshop on Scheme and Functional Programming (Scheme '04), Shivers, O. & Waddell, O. (eds). Tech. Rept. TR600. Computer Science Department, Indiana University.Google Scholar
Ford, B. (2002) Packrat parsing: Simple, powerful, lazy, linear time. Pages 36–47 of: Proceedings of the Seventh ACM SIGPLAN International Conference on Functional Programming (ICFP 2002). ACM.CrossRefGoogle Scholar
Friedman, D. P., Byrd, W. E. & Kiselyov, O. (2005) The Reasoned Schemer. Cambridge, MA: MIT.CrossRefGoogle Scholar
Grimm, R. (2006) Better extensibility through modular syntax. SIGPLAN Notices, 41 (6), 3851.CrossRefGoogle Scholar
Herman, D. & Wand, M. (2008) A theory of hygienic macros. Pages 48–62 of: Proceedings of the 17th European Symposium on Programming (ESOP 2008). Lecture Notes in Computer Science, vol. 4960. Springer-Verlag.Google Scholar
ISO. (2004) VRML ISO/IEC 14772 Standard Document [Online]. Available at: http://www.web3d.org/x3d/specifications/vrml/Google Scholar
Johnson, S. C. (1979) Yacc: Yet another compiler compiler. Pages 353–387 of: UNIX Programmer's Manual, vol. 2. New York, NY: Holt, Rinehart, and Winston.Google Scholar
Krishnamurthi, S., Erlich, Y.-D. & Felleisen, M. (1999) Expressing structural properties as language constructs. Pages 258–272 of: Proceedings of the 8th European Symposium on Programming Languages and Systems (ESOP '99). Lecture Notes in Computer Science, vol. 1576. Springer-Verlag.Google Scholar
Maddox, W. (1989) Semantically-Sensitive Macroprocessing. Tech. Rept. CSD-89-545. University of California, Berkeley.CrossRefGoogle Scholar
Mernik, M., Žumer, V., Lenič, M. & Avdičaušević, E. (1999) Implementation of multiple attribute grammar inheritance in the tool LISA. SIGPLAN Notices, 34 (6), 6875.CrossRefGoogle Scholar
Might, M. & Shivers, O. (2006) Improving flow analyses via ΓCFA: Abstract garbage collection and counting. Pages 13–25 of: Proceedings of the 11th ACM SIGPLAN International Conference on Functional Programming (ICFP 2006). ACM.CrossRefGoogle Scholar
Morrisett, G., Walker, D., Crary, K. & Glew, N. (1999) From system F to typed assembly language. ACM Trans. Program. Language Syst., 21 (3), 527568.CrossRefGoogle Scholar
Nanavati, R. A. (2000, Sept.) Extensible syntax in the presence of static analysis. M.Phil. Thesis. Cambridge, MA: Massachusetts Institute of Technology.Google Scholar
Nystrom, N., Qi, X. & Myers, A. C. (2006) J&: Nested intersection for scalable software composition. Pages 21–36 of: Proceedings of the 21st ACM SIGPLAN Conference on Object-Oriented Programing, Systems, Languages, and Applications (OOPSLA'06). ACM.CrossRefGoogle Scholar
Olinsky, R., Lindig, C. & Ramsey, N. (2006) Staged allocation: A compositional technique for specifying and implementing procedure calling conventions. Pages 409–421 of: Conference record of the 33rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL '06). ACM.CrossRefGoogle Scholar
Pennello, T. J. (1986) Very fast LR parsing. Pages 145–151 of: Proceedings of the 5th ACM SIGPLAN Symposium on Compiler Construction (CC '86). ACM.CrossRefGoogle Scholar
Peyton Jones, S., Eber, J.-M. & Seward, J. (2000) Composing contracts: An adventure in financial engineering (functional pearl). Pages 280–292 of: Proceedings of the 5th ACM SIGPLAN International Conference on Functional Programming (ICFP '00). ACM.CrossRefGoogle Scholar
Pottier, F. & Régis-Gianas, Y. (2005) Towards efficient, typed LR parsers. Pages 155–180 of: ACM workshop on ML. Electronic Notes in Theoretical Computer Science, vol. 148, no. 2. Elsevier.CrossRefGoogle Scholar
Pottier, F. & Remy, D. (2005) The Essence of ML Type Inference. Cambridge, MA: MIT, pp. 389489.Google Scholar
Shalit, A. (1996) The Dylan Reference Manual. Addison-Wesley.Google Scholar
Shivers, O. (1991, May) Control-Flow Analysis of Higher-Order Languages, or Taming Lambda. Ph.D. Thesis. School of Computer Science, Carnegie Mellon University, Pittsburgh, PA, Technical Report CMU-CS-91-145.Google Scholar
Shivers, O. (2005) The anatomy of a loop: A story of scope and control. Pages 2–14 of: Proceedings of the 10th ACM SIGPLAN International Conference on Functional Programming (ICFP 2005). ACM.CrossRefGoogle Scholar
Taha, W. & Sheard, T. (1997) Multi-stage programming with explicit annotations. Pages 203–217 of: Proceedings of the 1997 ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program manipulation (PEPM '97). ACM.CrossRefGoogle Scholar
Ungar, D. & Smith, R. B. (1987) Self: The power of simplicity. Pages 227–242 of: Proceedings of the 2nd ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA '87). ACM.CrossRefGoogle Scholar
van Wyk, E., de Moor, O., Backhouse, K. & Kwiatkowski, P. (2002) Forwarding in attribute grammars for modular language design. Pages 128–142 of: Proceedings of the 11th International Conference on Compiler Construction (CC '02). Lecture Notes in Computer Science, vol. 2304. Springer-Verlag.CrossRefGoogle Scholar
van Wyk, E., Krishnan, L., Brodin, D. & Schwerdfeger, A. (2007) Attribute grammar-based language extensions for Java. Pages 575–599 of: Proceedings of the 2007 European Conference on Object-Oriented Programming (ECOOP '07). Lecture Notes in Computer Science, vol. 4609. Springer-Verlag.CrossRefGoogle Scholar
Visser, E. (2004) Program Transformation With Stratego/XT: Rules, Strategies, Tools, and Systems in StrategoXT-0.9. Lecture Notes in Computer Science, vol. 3016. Spinger-Verlag, pp. 216238.Google Scholar
Submit a response

Discussions

No Discussions have been published for this article.