skip to main content
10.1145/2661103.2661107acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

A sufficiently smart compiler for procedural records

Published: 09 September 2012 Publication History

Abstract

Many languages include a syntax for declaring programmer-defined structured data types, i.e., structs or records. R6RS supports syntactic record definitions but also allows records to be defined procedurally, i.e., via a set of run-time operations. Indeed, the procedural interface is considered to be the primitive interface, and the syntactic interface is designed to be macro expandable into code that uses the procedural interface. Run-time creation of record types has a potentially significant impact. In particular, record creation, field access, and field mutation cannot generally be open coded, as it can be with syntactically specified records. Often, however, the shape of a record type can be determined statically, and in such a case, performance equivalent to that of syntactically specified record types can be attained. This paper describes an efficient run-time implementation of procedural record types, discusses its overhead, and describes a set of compiler optimizations that eliminate the overhead when record-type information can be determined statically. The optimizations improve the performance of a set of representative benchmark programs by over 20% on average.

References

[1]
M. D. Adams, A. W. Keep, J. Midtgaard, M. Might, A. Chauhan, and R. K. Dybvig. Flow-sensitive type recovery in linear-log time. In OOPSLA, pages 483--498, 2011.
[2]
A. Bondorf. Self-Applicable Partial Evaluation. PhD thesis, DIKU, Department of Computer Science, University of Copenhagen, Universitetsparken 1, DK-2100 Copenhagen Denmark, Dec 1990.
[3]
C. Chambers, D. Ungar, and E. Lee. An efficient implementation of self a dynamically-typed object-oriented language based on prototypes. In Conference proceedings on Object-oriented programming systems, languages and applications, OOPSLA '89, pages 49--70, New York, NY, USA, 1989. ACM. ISBN 0-89791-333-7.
[4]
W. D. Clinger. Description of benchmarks, 2008. URL http://www.larcenists.org/benchmarksAboutR6.html.
[5]
W. D. Clinger. Larceny user's manual, 2012. URL http://larceny.ccs.neu.edu/doc/.
[6]
L. G. DeMichiel and R. P. Gabriel. The Common Lisp Object System: An overview. In Proceedings of the European Conference on Object-Oriented Programming, ECOOP '87, pages 151--170, London, UK, UK, 1987. Springer-Verlag. ISBN 3-540-18353-1.
[7]
R. K. Dybvig. Chez Scheme Version 8 User's Guide. Cadence Research Systems, 2009.
[8]
M. Flatt, R. B. Findler, and PLT. The Racket guide, 2012. URL http://docs.racket-lang.org/guide/index.html.
[9]
B. Fulgham. The computer language benchmarks game, 2012. URL http://shootout.alioth.debian.org/.
[10]
A. Ghuloum. Ikarus Scheme user's guide, October 2008. URL https://launchpadlibrarian.net/18248997/ikarus-scheme-users-guide.pdf.
[11]
Google, Inc. Chrome v8: Design elements, 2012. URL http://developers.google.com/v8/design.
[12]
R. Hickey. Clojure, 2012. URL http://clojure.org.
[13]
A. W. Keep and R. K. Dybvig. Ftypes: Structured foreign types. In 2011 Workshop on Scheme and Functional Programming, 2011.
[14]
R. Kelsey, J. Rees, and M. Sperber. The incomplete Scheme 48 reference manual for release 1.8, 2008. URL http://s48.org/1.8/manual/manual.html.
[15]
T. Æ. Mogensen. Partially static structures in a self-applicable partial evaluator. In D. Bjørner, A. Ershov, and N. Jones, editors, Partial Evaluation and Mixed Computation, pages 325--347. North-Holland, 1988.
[16]
M. Sperber, R. K. Dybvig, M. Flatt, A. Van Straaten, R. Findler, and J. Matthews. Revised6 report on the algorithmic language scheme. Journal of Functional Programming, 19(Supplement S1):1--301, 2009. URL http://dx.doi.org/10.1017/S0956796809990074.
[17]
D. Ungar and R. B. Smith. Self: The power of simplicity. In Conference proceedings on Object-oriented programming systems, languages and applications, OOPSLA '87, pages 227--242, New York, NY, USA, 1987. ACM. ISBN 0-89791-247-0.
[18]
F. L. Winkelmann and The Chicken Team. The CHICKEN user's manual, 2012. URL http://wiki.call-cc.org/man/4/The%20User%27s%20Manual.

Cited By

View all
  • (2020)Hygienic macro technologyProceedings of the ACM on Programming Languages10.1145/33863304:HOPL(1-110)Online publication date: 12-Jun-2020
  • (2014)A run-time representation of scheme record typesJournal of Functional Programming10.1017/S095679681400020324:6(675-716)Online publication date: 1-Sep-2014

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
Scheme '12: Proceedings of the 2012 Annual Workshop on Scheme and Functional Programming
September 2012
99 pages
ISBN:9781450318952
DOI:10.1145/2661103
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: 09 September 2012

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Research-article

Conference

ICFP'12
Sponsor:

Acceptance Rates

Scheme '12 Paper Acceptance Rate 4 of 4 submissions, 100%;
Overall Acceptance Rate 4 of 4 submissions, 100%

Upcoming Conference

ICFP '25
ACM SIGPLAN International Conference on Functional Programming
October 12 - 18, 2025
Singapore , Singapore

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)2
  • Downloads (Last 6 weeks)0
Reflects downloads up to 22 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2020)Hygienic macro technologyProceedings of the ACM on Programming Languages10.1145/33863304:HOPL(1-110)Online publication date: 12-Jun-2020
  • (2014)A run-time representation of scheme record typesJournal of Functional Programming10.1017/S095679681400020324:6(675-716)Online publication date: 1-Sep-2014

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