An Optimized R5RS Macro Expander

Macro systems allow programmers abstractions over the syntax of a programming language. This gives the programmer some of the same power posessed by a programming language designer, namely, the ability to extend the programming language to meet the needs of the programmer. The value of such systems...

Full description

Bibliographic Details
Main Author: Reque, Sean P.
Format: Others
Published: BYU ScholarsArchive 2013
Subjects:
Online Access:https://scholarsarchive.byu.edu/etd/3509
https://scholarsarchive.byu.edu/cgi/viewcontent.cgi?article=4508&context=etd
id ndltd-BGMYU2-oai-scholarsarchive.byu.edu-etd-4508
record_format oai_dc
spelling ndltd-BGMYU2-oai-scholarsarchive.byu.edu-etd-45082019-05-16T03:31:06Z An Optimized R5RS Macro Expander Reque, Sean P. Macro systems allow programmers abstractions over the syntax of a programming language. This gives the programmer some of the same power posessed by a programming language designer, namely, the ability to extend the programming language to meet the needs of the programmer. The value of such systems has been demonstrated by their continued adoption in more languages and platforms. However, several barriers to widespread adoption of macro systems still exist. The language Racket defines a small core of primitive language constructs, including a powerful macro system, upon which all other features are built. Because of this design, many features of other programming languages can be implemented through libraries, keeping the core language simple without sacrificing power or flexibility. However, slow macro expansion remains a lingering problem in the language's primary implementation, and in fact macro expansion currently dominates compile times for Racket modules and programs. Besides the typical problems associated with slow compile times, such as slower testing feedback, increased mental disruption during the programming process, and unscalable build times for large projects, slow macro expansion carries its own unique problems, such as poorer performance for IDEs and other software analysis tools. In order to improve macro expansion times for Racket, we implement an existing expansion algorithm for R5RS Scheme macros, which comprise a subset of Racket's macro system, and use that implementation to explore optimization opportunities. Our resulting expander appears to be the fastest implementation of a R5RS macro expander in a high-level language and performs several times faster than the existing C-based Racket implementation. 2013-02-05T08:00:00Z text application/pdf https://scholarsarchive.byu.edu/etd/3509 https://scholarsarchive.byu.edu/cgi/viewcontent.cgi?article=4508&context=etd http://lib.byu.edu/about/copyright/ All Theses and Dissertations BYU ScholarsArchive Macros R5RS Optimizations Expander Computer Sciences
collection NDLTD
format Others
sources NDLTD
topic Macros
R5RS
Optimizations
Expander
Computer Sciences
spellingShingle Macros
R5RS
Optimizations
Expander
Computer Sciences
Reque, Sean P.
An Optimized R5RS Macro Expander
description Macro systems allow programmers abstractions over the syntax of a programming language. This gives the programmer some of the same power posessed by a programming language designer, namely, the ability to extend the programming language to meet the needs of the programmer. The value of such systems has been demonstrated by their continued adoption in more languages and platforms. However, several barriers to widespread adoption of macro systems still exist. The language Racket defines a small core of primitive language constructs, including a powerful macro system, upon which all other features are built. Because of this design, many features of other programming languages can be implemented through libraries, keeping the core language simple without sacrificing power or flexibility. However, slow macro expansion remains a lingering problem in the language's primary implementation, and in fact macro expansion currently dominates compile times for Racket modules and programs. Besides the typical problems associated with slow compile times, such as slower testing feedback, increased mental disruption during the programming process, and unscalable build times for large projects, slow macro expansion carries its own unique problems, such as poorer performance for IDEs and other software analysis tools. In order to improve macro expansion times for Racket, we implement an existing expansion algorithm for R5RS Scheme macros, which comprise a subset of Racket's macro system, and use that implementation to explore optimization opportunities. Our resulting expander appears to be the fastest implementation of a R5RS macro expander in a high-level language and performs several times faster than the existing C-based Racket implementation.
author Reque, Sean P.
author_facet Reque, Sean P.
author_sort Reque, Sean P.
title An Optimized R5RS Macro Expander
title_short An Optimized R5RS Macro Expander
title_full An Optimized R5RS Macro Expander
title_fullStr An Optimized R5RS Macro Expander
title_full_unstemmed An Optimized R5RS Macro Expander
title_sort optimized r5rs macro expander
publisher BYU ScholarsArchive
publishDate 2013
url https://scholarsarchive.byu.edu/etd/3509
https://scholarsarchive.byu.edu/cgi/viewcontent.cgi?article=4508&context=etd
work_keys_str_mv AT requeseanp anoptimizedr5rsmacroexpander
AT requeseanp optimizedr5rsmacroexpander
_version_ 1719186744505532416