Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/1289971.1289994acmconferencesArticle/Chapter ViewAbstractPublication PagesgpceConference Proceedingsconference-collections
Article

Debugging macros

Published: 01 October 2007 Publication History

Abstract

Over the past two decades, Scheme macros have evolved into a powerful API for the compiler front-end. Like Lisp macros, their predecessors, Scheme macros expand source programs into a small core language; unlike Lisp systems, Scheme macro expanders preserve many desirable properties, including lexical scope and source location. Using such macros, Scheme programmers now routinely develop the ultimate abstraction: embedded domain-specific programming languages.
Unfortunately, Scheme programming environments provide little support for macro development. This lack makes it difficult for programmers to debug their macros and for novices to study the behavior of macros. In response, we have developed a stepping debugger specialized to the concerns of macro expansion. It presents the macro expansion process as a linear rewriting sequence of annotated terms; it graphically illustrates the binding structure of the program as expansion reveals it; and it adapts to the programmer's level of abstraction, hiding details of syntactic forms that the programmer considers built-in.

References

[1]
Eli Barzilay. Swindle. http://www.barzilay.org/Swindle.
[2]
John Clements, Matthew Flatt, and Matthias Felleisen. Modeling an algebraic stepper. In Proc. 10th European Symposium on Programming Languages and Systems, pages 320--334, 2001.
[3]
William Clinger and Jonathan Rees. Macros that work. In ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 155--162, 1991.
[4]
Ryan Culpepper and Matthias Felleisen. Debugging macros. Technical Report NU-CCIS-07-05, Northeastern University, July 2007.
[5]
Ryan Culpepper, Scott Owens, and Matthew Flatt. Syntactic abstraction in component interfaces. In Proc. Fourth International Conference on Generative Programming and Component Engineering, pages 373--388, 2005.
[6]
R. Kent Dybvig, Robert Hieb, and Carl Bruggeman. Syntactic abstraction in Scheme. Lisp and Symbolic Computation, 5(4):295--326, December 1993.
[7]
Sebastian Egner. Eager comprehensions in Scheme: The design of SRFI-42. In Proc. Sixth Workshop on Scheme and Functional Programming, September 2005.
[8]
Matthias Felleisen. Transliterating Prolog into Scheme. Technical Report 182, Indiana University, 1985.
[9]
Matthias Felleisen. On the expressive power of programming languages. Science of Computer Programming, 17:35--75, 1991.
[10]
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.
[11]
Robert Bruce Findler and Matthias Felleisen. Contracts for higher-order functions. In ACM SIGPLAN International Conference on Functional Programming, 2002.
[12]
Matthew Flatt. Composable and compilable macros: you want it when? In Proc. Seventh ACM SIGPLAN International Conference on Functional Programming, pages 72--83, 2002.
[13]
Matthew Flatt. PLT MzScheme: Language manual. Technical Report PLT-TR2006-1-v352, PLT Scheme Inc., 2006.http://www.plt-scheme.org/techreports/.
[14]
Matthew Flatt and Matthias Felleisen. Units: Cool modules for HOT languages. In Proc. ACM SIGPLAN 1998 Conference on Programming Language Design and Implementation, pages 236--248, 1998.
[15]
Matthew Flatt, Robert Bruce Findler, and Matthias Felleisen. Scheme with classes, mixins, and traits. In Asian Symposium on Programming Languages and Systems (APLAS) 2006, pages 270--289, November 2006.
[16]
Matthew Flatt, Shriram Krishnamurthi, and Matthias Felleisen. A programmer's reduction semantics for classes and mixins. Formal Syntax and Semantics of Java, 1523:241--269, 1999. Preliminary version appeared in proceedings of Principles of Programming Languages, 1998. Revised version is Rice University TR 97-293, June 1999.
[17]
Daniel Friedman. Object-oriented style. In International LISP Conference, October 2003. Invited talk.
[18]
Daniel P. Friedman, William E. Byrd, and Oleg Kiselyov. The Reasoned Schemer. The MIT Press, July 2005.
[19]
Carl A. Gunter and Didier Rémy. A proof-theoretic assessment of runtime type errors. Technical Report 11261-921230-43TM, 600 Mountain Ave, Murray Hill, NJ 07974-2070, 1993.
[20]
David Herman and Philippe Meunier. Improving the static analysis of embedded languages via partial evaluation. In Proc. Ninth ACM SIGPLAN International Conference on Functional Programming, pages 16--27, 2004.
[21]
Paul Hudak. Building domain-specific embedded languages. ACM Comput. Surv., 28(4es):196, 1996.
[22]
Richard Kelsey, William Clinger, and Jonathan Rees (Editors). Revised5 report of the algorithmic language Scheme. ACM SIGPLAN Notices, 33(9):26--76, 1998.
[23]
Oleg Kiselyov. A declarative applicative logic programming system, 2004-2006. http://kanren.sourceforge.net.
[24]
Eugene Kohlbecker, Daniel P. Friedman, Matthias Felleisen, and Bruce Duba. Hygienic macro expansion. In Proc. 1986 ACM Conference on LISP and Functional Programming, pages 151--161, 1986.
[25]
Henry Lieberman. Steps toward better debugging tools for LISP. In Proc. 1984 ACM Symposium on LISP and Functional Programming, pages 247--255, 1984.
[26]
Scott Owens, Matthew Flatt, Olin Shivers, and Benjamin McMullan. Lexer and parser generators in Scheme. In Proc. Fifth Workshop on Scheme and Functional Programming, pages 41--52, September 2004.
[27]
PLT. PLT MzLib: Libraries manual. Technical Report PLT-TR2006-4-v352, PLT Scheme Inc., 2006. http://www.plt-scheme.org/techreports/.
[28]
Dipanwita Sarkar, Oscar Waddell, and R. Kent Dybvig. A nanopass framework for compiler education. Journal of Functional Programming, 15(5), September 2005. Educational Pearl.
[29]
Olin Shivers. The anatomy of a loop: a story of scope and control. In Proc. Tenth ACM SIGPLAN International Conference on Functional Programming, pages 2--14, 2005.
[30]
Dorai Sitaram. Programming in schelog. http://www.ccs.neu.edu/home/dorai/schelog/schelog.html.
[31]
Michael Sperber, William Clinger, R. Kent Dybvig, Matthew Flatt, Anton van Straaten, Richard Kelsey, and Jonathan Rees (Editors). Revised5.91 report of the algorithmic language Scheme, 2006. Draft. Available at http://www.r6rs.org.
[32]
Guy L. Steele, Jr. Common LISP: the language (2nd ed.). Digital Press, 1990.
[33]
Andrew P. Tolmach and Andrew W. Appel. A debugger for Standard ML. Journal of Functional Programming, 5(2):155--200, 1995.
[34]
Oscar Waddell and R. Kent Dybvig. Extending the scope of syntactic abstraction. In Proc. 26th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 203--215, 1999.
[35]
Mitchell Wand. The theory of fexprs is trivial. Lisp and Symbolic Computation, 10(3):189--199, 1998.
[36]
Andrew Wright and Bruce Duba. Pattern matching for Scheme, 1995. Unpublished manuscript.

Cited By

View all
  • (2024)DSLs in Racket: You Want It How, Now?Proceedings of the 17th ACM SIGPLAN International Conference on Software Language Engineering10.1145/3687997.3695645(84-103)Online publication date: 17-Oct-2024
  • (2015)Extensible Debugger Framework for Extensible LanguagesReliable Software Technologies – Ada-Europe 201510.1007/978-3-319-19584-1_3(33-49)Online publication date: 9-Jun-2015
  • (2011)Multilingual component programming in racketACM SIGPLAN Notices10.1145/2189751.204786447:3(1-2)Online publication date: 22-Oct-2011

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
GPCE '07: Proceedings of the 6th international conference on Generative programming and component engineering
October 2007
206 pages
ISBN:9781595938558
DOI:10.1145/1289971
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 October 2007

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Article

Conference

GPCE '07

Acceptance Rates

Overall Acceptance Rate 56 of 180 submissions, 31%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)6
  • Downloads (Last 6 weeks)2
Reflects downloads up to 24 Dec 2024

Other Metrics

Citations

Cited By

View all
  • (2024)DSLs in Racket: You Want It How, Now?Proceedings of the 17th ACM SIGPLAN International Conference on Software Language Engineering10.1145/3687997.3695645(84-103)Online publication date: 17-Oct-2024
  • (2015)Extensible Debugger Framework for Extensible LanguagesReliable Software Technologies – Ada-Europe 201510.1007/978-3-319-19584-1_3(33-49)Online publication date: 9-Jun-2015
  • (2011)Multilingual component programming in racketACM SIGPLAN Notices10.1145/2189751.204786447:3(1-2)Online publication date: 22-Oct-2011
  • (2011)Multilingual component programming in racketProceedings of the 10th ACM international conference on Generative programming and component engineering10.1145/2047862.2047864(1-2)Online publication date: 22-Oct-2011

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media