From Macros to DSLs: The Evolution of Racket

Authors Ryan Culpepper, Matthias Felleisen, Matthew Flatt, Shriram Krishnamurthi



PDF
Thumbnail PDF

File

LIPIcs.SNAPL.2019.5.pdf
  • Filesize: 446 kB
  • 19 pages

Document Identifiers

Author Details

Ryan Culpepper
  • PLT
Matthias Felleisen
  • PLT
Matthew Flatt
  • PLT
Shriram Krishnamurthi
  • PLT

Acknowledgements

The authors thank Michael Ballantyne, Eli Barzilay, Stephen Chang, Robby Findler, Alex Knauth, Alexis King, and Sam Tobin-Hochstadt for contributing at various stages to the evolution of Racket’s macro system and how it supports LOP. They also gratefully acknowledge the suggestions of the anonymous SNAPL '19 reviewers, Sam Caldwell, Will Clinger, Ben Greenman and Mitch Wand for improving the presentation.

Cite As Get BibTex

Ryan Culpepper, Matthias Felleisen, Matthew Flatt, and Shriram Krishnamurthi. From Macros to DSLs: The Evolution of Racket. In 3rd Summit on Advances in Programming Languages (SNAPL 2019). Leibniz International Proceedings in Informatics (LIPIcs), Volume 136, pp. 5:1-5:19, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2019) https://doi.org/10.4230/LIPIcs.SNAPL.2019.5

Abstract

The Racket language promotes a language-oriented style of programming. Developers create many domain-specific languages, write programs in them, and compose these programs via Racket code. This style of programming can work only if creating and composing little languages is simple and effective. While Racket’s Lisp heritage might suggest that macros suffice, its design team discovered significant shortcomings and had to improve them in many ways. This paper presents the evolution of Racket’s macro system, including a false start, and assesses its current state.

Subject Classification

ACM Subject Classification
  • Software and its engineering → Semantics
Keywords
  • design principles
  • macros systems
  • domain-specific languages

Metrics

  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    0
    PDF Downloads

References

  1. H. Abelson, R.K. Dybvig, C.T. Haynes, G.J. Rozas, N.I. Adams, D.P. Friedman, E. Kohlbecker, G.L. Steele, D.H. Bartley, R. Halstead, D. Oxley, G.J. Sussman, G. Brooks, C. Hanson, K.M. Pitman, and M. Wand. Revised⁵ Report on the Algorithmic Language Scheme. Higher-Order and Symbolic Computation, 11(1):7-105, August 1998. Google Scholar
  2. Alan Bawden and Jonathan Rees. Syntactic Closures. In Symposium on Lisp and Functional Programming, pages 86-95, 1988. Google Scholar
  3. Matthias Blume. Refining Hygienic Macros for Modules and Separate Compilation. Technical report tr-h-171, ATR Human Information Processing Research Laboratories, Kyoto, Japan, 1995. URL: https://people.cs.uchicago.edu/~blume/papers/hygmac.pdf.
  4. Matthew Butterick. Beautiful Racket, 2013. URL: https://beautifulracket.com/.
  5. Cadence Research Systems. Chezcheme Reference Manual, 1994. Google Scholar
  6. Stephen Chang, Alex Knauth, and Ben Greenman. Type Systems as Macros. In Symposium on Principles of Programming Languages, pages 694-705, 2017. Google Scholar
  7. Stephen Chang, Alex Knauth, and Emina Torlak. Symbolic Types for Lenient Symbolic Execution. In Symposium on Principles of Programming Languages, pages 40:1-40:29, 2018. Google Scholar
  8. William Clinger and Jonathan Rees. Macros That Work. In Symposium on Principles of Programming Languages, pages 155-162, 1991. Google Scholar
  9. Ryan Culpepper. Refining Syntactic Sugar: Tools for Supporting Macro Development. PhD thesis, Northeastern University, 2010. Google Scholar
  10. Ryan Culpepper. Fortifying macros. Journal of Functional Programming, 22(4-5):439-476, 2012. Google Scholar
  11. Ryan Culpepper and Matthias Felleisen. Taming Macros. In Generative Programming and Component Engineering, pages 225-243, 2004. Google Scholar
  12. Ryan Culpepper and Matthias Felleisen. Fortifying Macros. In International Conference on Functional Programming, pages 235-246, 2010. Google Scholar
  13. Sergey Dmitriev. Language-oriented Programming: the Next Programming Paradigm, 2004. Google Scholar
  14. R. Kent Dybvig, Daniel P. Friedman, and Christopher T. Haynes. Expansion-Passing Style: A General Macro Mechanism. Lisp and Symbolic Computation, 1(1):53-75, January 1988. Google Scholar
  15. R. Kent Dybvig, Robert Hieb, and Carl Bruggeman. Syntactic abstraction in Scheme. Lisp and Symbolic Computation, 5(4):295-326, December 1993. Google Scholar
  16. Matthias Felleisen, Forrest Bice, Rose DeMaio, Spencer Florence, Feng-Yun Mimi Lin, Scott Lindeman, Nicole Nussbaum, Eric Peterson, Ryan Plessner, David Van Horn, and Conrad Barski. Realm of Racket. No Starch Press, 2013. URL: http://www.realmofracket.com/.
  17. Matthias Felleisen, Robert Bruce Findler, and Matthew Flatt. Semantics Engineering with PLT Redex. MIT Press, 2009. Google Scholar
  18. Matthias Felleisen, Robert Bruce Findler, Matthew Flatt, and Shriram Krishnamurthi. How to Design Programs. Second Edition. MIT Press, 2001-2018. URL: http://www.htdp.org/.
  19. Matthias Felleisen, Robert Bruce Findler, Matthew Flatt, and Shriram Krishnamurthi. The Structure and Interpretation of the Computer Science Curriculum. Journal of Functional Programming, 14(4):365-378, 2004. Google Scholar
  20. Matthias Felleisen, Robert Bruce Findler, Matthew Flatt, Shriram Krishnamurthi, Eli Barzilay, Jay McCarthy, and Sam Tobin-Hochstadt. The Racket Manifesto. In First Summit on Advances in Programming Languages, pages 113-128, 2015. Google Scholar
  21. Matthias Felleisen, Robert Bruce Findler, Matthew Flatt, Shriram Krishnamurthi, Eli Barzilay, Jay McCarthy, and Sam Tobin-Hochstadt. A Programmable Programming Language. Communications of the ACM, 61(3):62-71, February 2018. Google Scholar
  22. R. Findler and M. Felleisen. Contracts for higher-order functions. In International Conference on Functional Programming, pages 48-59, 2002. Google Scholar
  23. Robert Bruce Findler, John Clements, Cormac Flanagan, Matthew Flatt, Shriram Krishnamurthi, Paul Steckler, and Matthias Felleisen. DrScheme: A programming environment for Scheme. Journal of Functional Programming, 12(2):159-182, 2002. Google Scholar
  24. Cormac Flanagan, Matthew Flatt, Shriram Krishnamurthi, Stephanie Weirich, and Matthias Felleisen. Catching bugs in the web of program invariants. In Conference on Programming Language Design and Implementation, pages 23-32, 1996. Google Scholar
  25. Matthew Flatt. Composable and Compilable Macros: You Want it When? In International Conference on Functional Programming, pages 72-83, 2002. Google Scholar
  26. Matthew Flatt. Submodules in Racket: you want it when, again? In Generative Programming and Component Engineering, pages 13-22, 2013. Google Scholar
  27. Matthew Flatt. Binding As Sets of Scopes. In Symposium on Principles of Programming Languages, pages 705-717, 2016. Google Scholar
  28. Matthew Flatt, Ryan Culpepper, David Darais, and Robert Bruce Findler. Macros that Work Together: Compile-time bindings, partial expansion, and definition contexts. Journal of Functional Programming, 22(2):181-216, March 2012. Google Scholar
  29. Matthew Flatt and Matthias Felleisen. Cool Modules for HOT Languages. In Conference on Programming Language Design and Implementation, pages 236-248, 1998. Google Scholar
  30. Matthew Flatt, Robert Bruce Findler, Shriram Krishnamurthi, and Matthias Felleisen. Programming Languages as Operating Systems (or, Revenge of the Son of the Lisp Machine). In International Conference on Functional Programming, pages 138-147, September 1999. Google Scholar
  31. Matthew Flatt, Shriram Krishnamurthi, and Matthias Felleisen. Classes and Mixins. In Symposium on Principles of Programming Languages, pages 171-183, 1998. Google Scholar
  32. Timothy P. Hart. MACROS for LISP. Technical Report 57, MIT Artificial Intelligence Laboratory, 1963. Google Scholar
  33. Paul Hudak. Modular Domain Specific Languages and Tools. In Fifth International Conference on Software Reuse, pages 134-142, 1998. Google Scholar
  34. Richard Kelsey and Jonathan Rees. A Tractable Scheme Implementation. Lisp and Symbolic Computation, 5(4):315-335, 1994. Google Scholar
  35. Eugene E. Kohlbecker. Syntactic Extensions in the Programming Language Lisp. PhD thesis, Indiana University, 1986. Google Scholar
  36. Eugene E. Kohlbecker, Daniel P. Friedman, Matthias Felleisen, and Bruce F. Duba. Hygienic Macro Expansion. In Symposium on Lisp and Functional Programming, pages 151-161, 1986. Google Scholar
  37. Eugene E. Kohlbecker and Mitchell Wand. Macros-by-Example: Deriving Syntactic Transformations from their Specifications. In Symposium on Principles of Programming Languages, pages 77-84, 1987. Google Scholar
  38. Shriram Krishnamurthi. Linguistic Reuse. PhD thesis, Rice University, 2001. Google Scholar
  39. Shriram Krishnamurthi, Matthias Felleisen, and Bruce F. Duba. From Macros to Reusable Generative Programming. In International Symposium on Generative and Component-Based Software Engineering, pages 105-120, 1999. Google Scholar
  40. Jacob Matthews, Robert Bruce Findler, Matthew Flatt, and Matthias Felleisen. A Visual Environment for Developing Context-Sensitive Term Rewriting Systems. In Rewriting Techniques and Applications, pages 2-16, 2004. Google Scholar
  41. Daniel Patterson and Amal Ahmed. Linking Types for Multi-Language Software: Have Your Cake and Eat It Too. In Summit on Advances in Programming Languages, pages 12:1-12:15, 2017. Google Scholar
  42. Guy Lewis Steele Jr. Common Lisp - The Language. Digital Press, 1984. Google Scholar
  43. Gerald L. Sussman and Guy Lewis Steele Jr. Scheme: An interpreter for extended lambda calculus. Technical Report 349, MIT Artificial Intelligence Laboratory, 1975. Google Scholar
  44. Sam Tobin-Hochstadt and Matthias Felleisen. The design and implementation of Typed Scheme. In Symposium on Principles of Programming Languages, pages 395-406, 2008. Google Scholar
  45. Martin P. Ward. Language Oriented Programming. Software Concepts and Tools, 15:147-161, April 1994. Google Scholar
Questions / Remarks / Feedback
X

Feedback for Dagstuhl Publishing


Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail