Rhombus: A New Spin on Macros without All the Parentheses

Rhombus is a new language that is built on Racket. It offers the same kind of language extensibility as Racket itself, but using traditional (infix) notation. Although Rhombus is far from the first language to support Lisp-style macros without Lisp-style parentheses, Rhombus offers a novel synthesis...

Full description

Saved in:
Bibliographic Details
Published inProceedings of ACM on programming languages Vol. 7; no. OOPSLA2; pp. 574 - 603
Main Authors Flatt, Matthew, Allred, Taylor, Angle, Nia, De Gabrielle, Stephen, Findler, Robert Bruce, Firth, Jack, Gopinathan, Kiran, Greenman, Ben, Kasivajhula, Siddhartha, Knauth, Alex, McCarthy, Jay, Phillips, Sam, Porncharoenwase, Sorawee, Søgaard, Jens Axel, Tobin-Hochstadt, Sam
Format Journal Article
LanguageEnglish
Published New York, NY, USA ACM 16.10.2023
Subjects
Online AccessGet full text

Cover

Loading…
More Information
Summary:Rhombus is a new language that is built on Racket. It offers the same kind of language extensibility as Racket itself, but using traditional (infix) notation. Although Rhombus is far from the first language to support Lisp-style macros without Lisp-style parentheses, Rhombus offers a novel synthesis of macro technology that is practical and expressive. A key element is the use of multiple binding spaces for context-specific sublanguages. For example, expressions and pattern-matching forms can use the same operators with different meanings and without creating conflicts. Context-sensitive bindings, in turn, facilitate a language design that reduces the notational distance between the core language and macro facilities. For example, repetitions can be defined and used in binding and expression contexts generally, which enables a smoother transition from programming to metaprogramming. Finally, since handling static information (such as types) is also a necessary part of growing macros beyond Lisp, Rhombus includes support in its expansion protocol for communicating static information among bindings and expressions. The Rhombus implementation demonstrates that all of these pieces can work together in a coherent and user-friendly language.
ISSN:2475-1421
2475-1421
DOI:10.1145/3622818