Composable Sequence Macros for Fast Iteration

Anna Bolotina, Ryan Culpepper

Research output: Chapter in Book/Report/Conference proceeding/Legal commentaryConference contributionpeer-review

Abstract

Racket provides for loops with macro-extensible sequence expressions. Sequence macros offer better performance than dynamic sequence implementations, but they are complicated to define and Racket offers little support for creating new sequence macros by combining existing ones. In this paper, we develop such support in the form of sequence combinator macros and a general comprehension form. These utilities are implemented by manipulating compile-time records that contain binders and expressions; the binding relationships between the components are not trivial. We discuss how to diagnose and solve type and scoping problems in our implementation.
Original languageEnglish
Title of host publicationComposable Sequence Macros for Fast Iteration
Pages59-71
Number of pages13
Publication statusPublished - 1 Dec 2022
Externally publishedYes

Keywords

  • macros
  • metaprogramming
  • syntactic abstraction
  • extensible languages
  • sequences

Fields of Science and Technology Classification 2012

  • 102 Computer Sciences

Cite this