Skip to main content Accessibility help
×
×
Home

Building language towers with Ziggurat

  • DAVID FISHER (a1) and OLIN SHIVERS (a1)
Abstract

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.

Copyright
References
Hide All
Abelson, H., Sussman, G. J. & Sussman, J. (1985) Structure and Interpretation of Computer Programs. Cambridge, MA: MIT.
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.
Baader, F. & Nipkow, T. (1998) Term Rewriting and All That. New York, NY: Cambridge University Press.
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.
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.
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.
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).
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.
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.
Church, A. (1941) The Calculi of Lambda-Conversion. Princeton, NJ: Princeton University Press.
Clinger, W. (1991) Hygienic macros through explicit renaming. LISP Point., 4 (4).
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.
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.
DeRemer, F. & Pennello, T. (1982) Efficient computation of LALR(1) look-ahead sets. ACM Trans. Program. Language Syst., 4 (4), 615649.
Dybvig, R. K. (1992) Writing Hygienic Macros in Scheme With Syntax-Case. Tech. Rept. TR 356. Computer Science Department, Indiana University.
Dybvig, R. K., Hieb, R. & Bruggeman, C. (1992) Syntactic abstraction in Scheme. LISP Symbol. Comput., 5 (4), 295326.
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.
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.
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.
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.
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.
Friedman, D. P., Byrd, W. E. & Kiselyov, O. (2005) The Reasoned Schemer. Cambridge, MA: MIT.
Grimm, R. (2006) Better extensibility through modular syntax. SIGPLAN Notices, 41 (6), 3851.
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.
ISO. (2004) VRML ISO/IEC 14772 Standard Document [Online]. Available at: http://www.web3d.org/x3d/specifications/vrml/
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.
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.
Maddox, W. (1989) Semantically-Sensitive Macroprocessing. Tech. Rept. CSD-89-545. University of California, Berkeley.
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.
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.
Morrisett, G., Walker, D., Crary, K. & Glew, N. (1999) From system F to typed assembly language. ACM Trans. Program. Language Syst., 21 (3), 527568.
Nanavati, R. A. (2000, Sept.) Extensible syntax in the presence of static analysis. M.Phil. Thesis. Cambridge, MA: Massachusetts Institute of Technology.
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.
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.
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.
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.
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.
Pottier, F. & Remy, D. (2005) The Essence of ML Type Inference. Cambridge, MA: MIT, pp. 389489.
Shalit, A. (1996) The Dylan Reference Manual. Addison-Wesley.
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.
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.
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.
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.
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.
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.
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.
Recommend this journal

Email your librarian or administrator to recommend adding this journal to your organisation's collection.

Journal of Functional Programming
  • ISSN: 0956-7968
  • EISSN: 1469-7653
  • URL: /core/journals/journal-of-functional-programming
Please enter your name
Please enter a valid email address
Who would you like to send this to? *
×

Metrics

Full text views

Total number of HTML views: 0
Total number of PDF views: 0 *
Loading metrics...

Abstract views

Total abstract views: 0 *
Loading metrics...

* Views captured on Cambridge Core between <date>. This data will be updated every 24 hours.

Usage data cannot currently be displayed

Building language towers with Ziggurat

  • DAVID FISHER (a1) and OLIN SHIVERS (a1)
Submit a response

Discussions

No Discussions have been published for this article.

×

Reply to: Submit a response


Your details


Conflicting interests

Do you have any conflicting interests? *