Proceedings of the FREENIX Track: 2002 USENIX Annual Technical Conference

Total Page:16

File Type:pdf, Size:1020Kb

Proceedings of the FREENIX Track: 2002 USENIX Annual Technical Conference USENIX Association Proceedings of the FREENIX Track: 2002 USENIX Annual Technical Conference Monterey, California, USA June 10-15, 2002 THE ADVANCED COMPUTING SYSTEMS ASSOCIATION © 2002 by The USENIX Association All Rights Reserved For more information about the USENIX Association: Phone: 1 510 528 8649 FAX: 1 510 548 5738 Email: [email protected] WWW: http://www.usenix.org Rights to individual papers remain with the author or the author's employer. Permission is granted for noncommercial reproduction of the work for educational or research purposes. This copyright notice must be included in the reproduced paper. USENIX acknowledges all trademarks herein. Biglook: a Widget Library for the Scheme Programming Language Erick Gallesio Manuel Serrano Universite´ de Nice – Sophia Antipolis Inria Sophia Antipolis 950 route des Colles, B.P. 145 2004 route des Lucioles – B.P. 93 F-06903 Sophia Antipolis, Cedex F-06902 Sophia-Antipolis, Cedex EÖickºGaÐÐe×iÓ@ÙÒiceºfÖ ÅaÒÙeкËeÖÖaÒÓ@iÒÖiaºfÖ Abstract Biglook is an Object Oriented Scheme library for constructing GUIs. It uses classes of a CLOS- like object layer to represent widgets and Scheme closures to handle events. Combining functional and object-oriented programming styles yields an original application programming interface that advocates a strict separation between the implementation of the graphical interfaces and the user-associated commands, enabling compact source code. The Biglook implementation separates the Scheme programming interface and the na- Figure 1: Two Biglook applications: a code tive back-end. This permits different ports browser on the left, “dock” applications on the for Biglook. The current version uses GTK· right and Swing graphical toolkits, while the pre- vious release used Tk. It is available at: hØØÔ:»»kaÓÐiÒºÙÒiceºfÖ»BigÐÓÓk . shots of Biglook applications: i) kbÖÓÛ×e on the left and ii) the Biglook dock applications, ala` NextStep, on the right. These Biglook applica- tions are used on a daily basis. Introduction By contrast to previous work, no attempt has been made to make that library familiar to pro- We have studied the problem of construct- grammers used to imperative or purely object ori- ing GUI in functional languages by designing a ented programming style. On the contrary, our li- widget library for the Scheme programming lan- brary introduces an original application program- guage, called Biglook. In this paper we focus on ming interface (API) that benefits from the high how to apply the functional style to GUIspro- level constructions of the extended Scheme im- gramming. plementation named Bigloo [25] which is open source and freely available since 1992. The main Biglook’s primary use is to implement graph- Bigloo component is an optimizing compiler that ical applications (e.g., ÜÐÓad, editors ala` delivers small and efficient applications for the Emacs, browser ala` Netscape, programming UnixTM operating system. Bigloo is able to pro- tools such as kbÖÓÛ×e, our graphical Scheme duce native code (via C) and JVM bytecode. Cur- code browser). Figure 1 presents two screen rently Biglook uses GTK· [20] associated with the Bigloo C back-end and Swing [29] with the 1 Bigloo Bigloo JVM back-end. The previous release of Biglook [12] used Tk [19]. Bigloo is an open implementation of the Bigloo implements an object layer inspired Scheme programming language. From the be- by CLOS [1]. It is a class-based model where ginning, the aim was to propose a realistic and methods override generic functions and are not pragmatic alternative to the strict Scheme [17]. declared inside classes as in Smalltalk [13], Bigloo does not implement “all” of Scheme; for O’Caml [22] or Java [14]. example, the execution of tail-recursion may al- locate memory. On the other hand, Bigloo imple- Biglook is implemented as a wrapping layer ments numerous extensions: support for lexical on top of native widget libraries (that we name and syntactic analysis, pattern matching, an ex- henceforth the back-end). This software architec- ception mechanism, a foreign interface, an object ture saves the effort of implementing low-level layer and a module language. In this Section, we constructions (pixel switching, clipping, event present Bigloo’s modules and its object model; handling and so on) allowing to focus on the that is, class declarations and generic functions. Scheme implementation of new features. Virtual slots, which are heavily used in Biglook, are presented in Section 2. When designing the Biglook API,wealways had to decide which model to choose: the func- tional model or the object model. We think that 1.1 Modules these two models are not contradictory but com- plementary. For instance, if the widget hierarchy naturally fits a class hierarchy, user call-backs are Bigloo modules have two basic purposes: one naturally implemented by the means of Scheme is to allow separate compilation and the second is closures. to increase the number of errors that can be de- tected by the compiler. Bigloo modules are sim- In Section 1 we briefly present the Bigloo sys- ple and they have been designed with the concern tem emphasizing its module system and its object of an easy implementation. layer. This section is required for readers unfa- miliar with the CLOS model and it also serves as A module is a compilation unit for Bigloo. It an introduction to virtual slots. Virtual slots are is represented by one or more files and has the a new Bigloo construction that is required in or- following syntax: der to separate the Biglook API made of classes and the native back-end. They are presented in ´ÑÓdÙÐe module-name · £ ´iÑÔÓÖØ Section 2. In Section 3 we present the Biglook import µ · £ µ library. We start showing a simple Biglook ap- ´eÜÔÓÖØ export · £ µ plication and its associated source code. Then, ´×ØaØic static · £ µ ´ÐibÖaÖÝ static we detail the Biglook programming principles µ (widgets creation, event handling, etc.) motivat- opt-body ing our design orientations by programming lan- guage considerations. In this section we are con- Import clauses are used to import bindings in the ducted to compare the functional programming module. In order to import, one just needs to state style and the object oriented one. In Section 4 we the identifier to be imported and its source mod- present the Biglook implementation. At last, in ule. Note that a shorthand exists to import all the Section 5 we present a comparison with related bindings of a module. work. Export and static clauses play a close role. They point out to the compiler that the module implements some bindings and distinguish those that can be used within other modules (they are exported) and those that cannot (they are static). These clauses do not contain identifiers but proto- types. It is then possible to export variables (mu- ÑÓdÙÐe¹ÔÓiÒØ× table bindings) or functions (read-only bindings). ´ÑÓdÙÐe ´cÐa×× ÔÓiÒØ Static clauses are optional (the bindings of a mod- ´eÜÔÓÖØ ´ÔÓiÒعiÒiص ´defaÙÐØ ¼º¼µµ ule which are not referenced in a clause are, by ´Ü::dÓÙbÐe ´defaÙÐØ ¼º¼µµµ default, static). ´Ý::dÓÙbÐe ´cÐa×× ÔÓiÒع¿d::ÔÓiÒØ ´defaÙÐØ ¼º¼µµµµµ Library clauses enable programs to use Bigloo ´Þ::dÓÙbÐe ÔÓiÒعiÒiØ libraries. A Bigloo library is merely a collec- ´defiÒe ´´cÓÙÒØ ¼µµ tion of pre-compiled modules. Using a library is ´ÐeØ ´Óbj::ÔÓiÒص equivalent to importing all the modules compos- ´ÐaÑbda cÓÙÒØ ´· ½ cÓÙÒصµ ing the library. Detailed information on Bigloo ´×eØ! ´ÔÖiÒØ "# Óf ÔÓiÒØ×: " cÓÙÒصµµµ modules may be found in the two papers [25, 26]. 1.2.2 Instances 1.2 Object layer When declaring a class cÐa, Bigloo automat- ically generates the predicate cÐa?, an allo- cÐa cator iÒ×ØaÒØiaØe:: , an instance cloner In this paper we assume a CLOS-like object cÐa cÐa¹Ü dÙÔÐicaØe:: , accessors (e.g., for model with single inheritance and single dis- cÐa¹Ü¹×eØ! aslotÜ), modifiers (e.g., for a patch. The object layer implemented in Bigloo slot Ü) and an abbreviated special access form, is a restricted version of CLOS [1] inspired, to a cÐa ÛiØh¹acce××:: , to allow accessing and great extent, by MEROON [21]. writing slots simply by using their name. Here is how to allocate and access an instance of ÔÓiÒع¿d : ´ÐeØ ´´Ô ´iÒ×ØaÒØiaØe::ÔÓiÒع¿d ¹¿º4µ 1.2.1 Class declarations ´Ý ´Ü ½º¼µµµµ ;; The initialization value of a slot can be omitted ;; from the arguments list if it has a default value; ÔÓiÒع¿d Classes can be declared static or exported. It ;; this is the case for the slot Þ of class . Ô ´Ü Ý Þµ is then possible to make a declaration accessible ´ÛiØh¹acce××::ÔÓiÒع¿d ´· ´×ÕÖ Üµ ´×ÕÖ Ýµ ´×ÕÖ Þµµµµµ from another module or to limit its scope to one ´×ÕÖØ module. The abbreviated syntax of a class decla- ÛiØh¹acce×× ration is: The iÒ×ØaÒØiaØe and special forms are implemented by the means of macros that statically resolve the keyword parameters :: µ ´cÐa×× class-id super-class-id opt-init opt-slots Ý Þ (such as Ü, and ). For instance, the above ex- ample is expanded into: A class can inherit from a single super class. ´´Ô ´Ñake¹ÔÓiÒع¿d ½º¼ ¹¿º4 ¼º¼µµµ Classes with no specified super class inherit from ´ÐeØ ´×ÕÖØ ´· ´×ÕÖ ´ÔÓiÒع¿d¹Ü Ôµµ ÓbjecØ ´ÔÓiÒع¿d¹Ý Ôµµ the class. The type associated with a sub- ´×ÕÖ ´ÔÓiÒع¿d¹Þ Ôµµµµµ class is a subtype of the type of the super class. ´×ÕÖ A class may be provided with an initialization As we can see, since macros are expanded at function (opt-init) that is automatically called compile-time, there is no run-time penalty asso- each time an instance of class-id is created. Ini- ciated with keyword parameters. tialization functions accept one argument, the created instance.
Recommended publications
  • Introduction to Programming in Lisp
    Introduction to Programming in Lisp Supplementary handout for 4th Year AI lectures · D W Murray · Hilary 1991 1 Background There are two widely used languages for AI, viz. Lisp and Prolog. The latter is the language for Logic Programming, but much of the remainder of the work is programmed in Lisp. Lisp is the general language for AI because it allows us to manipulate symbols and ideas in a commonsense manner. Lisp is an acronym for List Processing, a reference to the basic syntax of the language and aim of the language. The earliest list processing language was in fact IPL developed in the mid 1950’s by Simon, Newell and Shaw. Lisp itself was conceived by John McCarthy and students in the late 1950’s for use in the newly-named field of artificial intelligence. It caught on quickly in MIT’s AI Project, was implemented on the IBM 704 and by 1962 to spread through other AI groups. AI is still the largest application area for the language, but the removal of many of the flaws of early versions of the language have resulted in its gaining somewhat wider acceptance. One snag with Lisp is that although it started out as a very pure language based on mathematic logic, practical pressures mean that it has grown. There were many dialects which threaten the unity of the language, but recently there was a concerted effort to develop a more standard Lisp, viz. Common Lisp. Other Lisps you may hear of are FranzLisp, MacLisp, InterLisp, Cambridge Lisp, Le Lisp, ... Some good things about Lisp are: • Lisp is an early example of an interpreted language (though it can be compiled).
    [Show full text]
  • An Optimized R5RS Macro Expander
    An Optimized R5RS Macro Expander Sean Reque A thesis submitted to the faculty of Brigham Young University in partial fulfillment of the requirements for the degree of Master of Science Jay McCarthy, Chair Eric Mercer Quinn Snell Department of Computer Science Brigham Young University February 2013 Copyright c 2013 Sean Reque All Rights Reserved ABSTRACT An Optimized R5RS Macro Expander Sean Reque Department of Computer Science, BYU Master of Science 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 fit 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 [6] 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.
    [Show full text]
  • Towards a Portable and Mobile Scheme Interpreter
    Towards a Portable and Mobile Scheme Interpreter Adrien Pi´erard Marc Feeley Universit´eParis 6 Universit´ede Montr´eal [email protected] [email protected] Abstract guage. Because Mobit implements R4RS Scheme [6], we must also The transfer of program data between the nodes of a distributed address the serialization of continuations. Our main contribution is system is a fundamental operation. It usually requires some form the demonstration of how this can be done while preserving the in- of data serialization. For a functional language such as Scheme it is terpreter’s maintainability and with local changes to the original in- clearly desirable to also allow the unrestricted transfer of functions terpreter’s structure, mainly through the use of unhygienic macros. between nodes. With the goal of developing a portable implemen- We start by giving an overview of the pertinent features of the tation of the Termite system we have designed the Mobit Scheme Termite dialect of Scheme. In Section 3 we explain the structure interpreter which supports unrestricted serialization of Scheme ob- of the interpreter on which Mobit is based. Object serialization is jects, including procedures and continuations. Mobit is derived discussed in Section 4. Section 5 compares Mobit’s performance from an existing Scheme in Scheme fast interpreter. We demon- with other interpreters. We conclude with related and future work. strate how macros were valuable in transforming the interpreter while preserving its structure and maintainability. Our performance 2. Termite evaluation shows that the run time speed of Mobit is comparable to Termite is a Scheme adaptation of the Erlang concurrency model.
    [Show full text]
  • PUB DAM Oct 67 CONTRACT N00014-83-6-0148; N00014-83-K-0655 NOTE 63P
    DOCUMENT RESUME ED 290 438 IR 012 986 AUTHOR Cunningham, Robert E.; And Others TITLE Chips: A Tool for Developing Software Interfaces Interactively. INSTITUTION Pittsburgh Univ., Pa. Learning Research and Development Center. SPANS AGENCY Office of Naval Research, Arlington, Va. REPORT NO TR-LEP-4 PUB DAM Oct 67 CONTRACT N00014-83-6-0148; N00014-83-K-0655 NOTE 63p. PUB TYPE Reports - Research/Technical (143) EDRS PRICE MF01/PC03 Plus Postage. DESCRIPTORS *Computer Graphics; *Man Machine Systems; Menu Driven Software; Programing; *Programing Languages IDENTIF7ERS Direct Manipulation Interface' Interface Design Theory; *Learning Research and Development Center; LISP Programing Language; Object Oriented Programing ABSTRACT This report provides a detailed description of Chips, an interactive tool for developing software employing graphical/computer interfaces on Xerox Lisp machines. It is noted that Chips, which is implemented as a collection of customizable classes, provides the programmer with a rich graphical interface for the creation of rich graphical interfaces, and the end-user with classes for modeling the graphical relationships of objects on the screen and maintaining constraints between them. This description of the system is divided into five main sections: () the introduction, which provides background material and a general description of the system; (2) a brief overview of the report; (3) detailed explanations of the major features of Chips;(4) an in-depth discussion of the interactive aspects of the Chips development environment; and (5) an example session using Chips to develop and modify a small portion of an interface. Appended materials include descriptions of four programming techniques that have been sound useful in the development of Chips; descriptions of several systems developed at the Learning Research and Development Centel tsing Chips; and a glossary of key terms used in the report.
    [Show full text]
  • The Evolution of Lisp
    1 The Evolution of Lisp Guy L. Steele Jr. Richard P. Gabriel Thinking Machines Corporation Lucid, Inc. 245 First Street 707 Laurel Street Cambridge, Massachusetts 02142 Menlo Park, California 94025 Phone: (617) 234-2860 Phone: (415) 329-8400 FAX: (617) 243-4444 FAX: (415) 329-8480 E-mail: [email protected] E-mail: [email protected] Abstract Lisp is the world’s greatest programming language—or so its proponents think. The structure of Lisp makes it easy to extend the language or even to implement entirely new dialects without starting from scratch. Overall, the evolution of Lisp has been guided more by institutional rivalry, one-upsmanship, and the glee born of technical cleverness that is characteristic of the “hacker culture” than by sober assessments of technical requirements. Nevertheless this process has eventually produced both an industrial- strength programming language, messy but powerful, and a technically pure dialect, small but powerful, that is suitable for use by programming-language theoreticians. We pick up where McCarthy’s paper in the first HOPL conference left off. We trace the development chronologically from the era of the PDP-6, through the heyday of Interlisp and MacLisp, past the ascension and decline of special purpose Lisp machines, to the present era of standardization activities. We then examine the technical evolution of a few representative language features, including both some notable successes and some notable failures, that illuminate design issues that distinguish Lisp from other programming languages. We also discuss the use of Lisp as a laboratory for designing other programming languages. We conclude with some reflections on the forces that have driven the evolution of Lisp.
    [Show full text]
  • Allegro CL User Guide
    Allegro CL User Guide Volume 1 (of 2) version 4.3 March, 1996 Copyright and other notices: This is revision 6 of this manual. This manual has Franz Inc. document number D-U-00-000-01-60320-1-6. Copyright 1985-1996 by Franz Inc. All rights reserved. No part of this pub- lication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means electronic, mechanical, by photocopying or recording, or otherwise, without the prior and explicit written permission of Franz incorpo- rated. Restricted rights legend: Use, duplication, and disclosure by the United States Government are subject to Restricted Rights for Commercial Software devel- oped at private expense as specified in DOD FAR 52.227-7013 (c) (1) (ii). Allegro CL and Allegro Composer are registered trademarks of Franz Inc. Allegro Common Windows, Allegro Presto, Allegro Runtime, and Allegro Matrix are trademarks of Franz inc. Unix is a trademark of AT&T. The Allegro CL software as provided may contain material copyright Xerox Corp. and the Open Systems Foundation. All such material is used and distrib- uted with permission. Other, uncopyrighted material originally developed at MIT and at CMU is also included. Appendix B is a reproduction of chapters 5 and 6 of The Art of the Metaobject Protocol by G. Kiczales, J. des Rivieres, and D. Bobrow. All this material is used with permission and we thank the authors and their publishers for letting us reproduce their material. Contents Volume 1 Preface 1 Introduction 1.1 The language 1-1 1.2 History 1-1 1.3 Format
    [Show full text]
  • Structured Foreign Types
    Ftypes: Structured foreign types Andrew W. Keep R. Kent Dybvig Indiana University fakeep,[email protected] Abstract When accessing scalar elements within an ftype, the value of the High-level programming languages, like Scheme, typically repre- scalar is automatically marshaled into the equivalent Scheme rep- sent data in ways that differ from the host platform to support resentation. When setting scalar elements, the Scheme value is consistent behavior across platforms and automatic storage man- checked to ensure compatibility with the specified foreign type, and agement, i.e., garbage collection. While crucial to the program- then marshaled into the equivalent foreign representation. Ftypes ming model, differences in data representation can complicate in- are well integrated into the system, with compiler support for ef- teraction with foreign programs and libraries that employ machine- ficient access to foreign data and debugger support for convenient dependent data structures that do not readily support garbage col- inspection of foreign data. lection. To bridge this gap, many high-level languages feature for- The ftype syntax is convenient and flexible. While it is similar in eign function interfaces that include some ability to interact with some ways to foreign data declarations in other Scheme implemen- foreign data, though they often do not provide complete control tations, and language design is largely a matter of taste, we believe over the structure of foreign data, are not always fully integrated our syntax is cleaner and more intuitive than most. Our system also into the language and run-time system, and are often not as effi- has a more complete set of features, covering all C data types along cient as possible.
    [Show full text]
  • Chez Scheme Version 5 Release Notes Copyright C 1994 Cadence Research Systems All Rights Reserved October 1994 Overview 1. Funct
    Chez Scheme Version 5 Release Notes Copyright c 1994 Cadence Research Systems All Rights Reserved October 1994 Overview This document outlines the changes made to Chez Scheme for Version 5 since Version 4. New items include support for syntax-case and revised report high-level lexical macros, support for multiple values, support for guardians and weak pairs, support for generic ports, improved trace output, support for shared incremental heaps, support for passing single floats to and returning single floats from foreign procedures, support for passing structures to and returning structures from foreign procedures on MIPS-based computers, and various performance enhancements, including a dramatic improvement in the time it takes to load Scheme source and object files on DEC Ultrix MIPS-based computers. Overall performance of generated code has increased by an average of 15–50 percent over Version 4 depending upon optimize level and programming style. Programs that make extensive use of locally-defined procedures will benefit more than programs that rely heavily on globally-defined procedures, and programs compiled at higher optimize levels will improve more than programs compiled at lower optimize levels. Compile time is approximately 25 percent faster. Refer to the Chez Scheme System Manual, Revision 2.5 for detailed descriptions of the new or modified procedures and syntactic forms mentioned in these notes. Version 5 is available for the following platforms: • Sun Sparc SunOS 4.X & Solaris 2.X • DEC Alpha AXP OSF/1 V2.X • Silicon Graphics IRIX 5.X • Intel 80x86 NeXT Mach 3.2 • Motorola Delta MC88000 SVR3 & SVR4 • Decstation/Decsystem Ultrix 4.3A • Intel 80x86 BSDI BSD/386 1.1 • Intel 80x86 Linux This document contains four sections describing (1) functionality enhancements, (2) performance enhance- ments, (3) bugs fixed, and (4) compatibility issues.
    [Show full text]
  • S Allegro Common Lisp Foreign Function Interface
    Please do not remove this page Extensions to the Franz, Inc.'s Allegro Common Lisp foreign function interface Keane, John https://scholarship.libraries.rutgers.edu/discovery/delivery/01RUT_INST:ResearchRepository/12643408560004646?l#13643533500004646 Keane, J. (1996). Extensions to the Franz, Inc.’s Allegro Common Lisp foreign function interface. Rutgers University. https://doi.org/10.7282/t3-pqns-7h57 This work is protected by copyright. You are free to use this resource, with proper attribution, for research and educational purposes. Other uses, such as reproduction or publication, may require the permission of the copyright holder. Downloaded On 2021/09/29 22:58:32 -0400 Extensions to the Franz Incs Allegro Common Lisp Foreign Function Interface John Keane Department of Computer Science Rutgers University New Brunswick NJ keanecsrutgersedu January Abstract As provided by Franz Inc the foreign function interface of Allegro Com mon Lisp has a number of limitations This pap er describ es extensions to the interface that facilitate the inclusion of C and Fortran co de into Common Lisp systems In particular these extensions make it easy to utilize libraries of numerical subroutines such as those from Numerical Recip es in C from within ACL including those routines that take functions as arguments A mechanism for creating Lisplike dynamic runtime closures for C routines is also describ ed Acknowledgments The research presented in this do cument is supp orted in part by NASA grants NCC and NAG This research is also part of the Rutgers based
    [Show full text]
  • Drscheme: a Pedagogic Programming Environment for Scheme
    DrScheme A Pedagogic Programming Environment for Scheme Rob ert Bruce Findler Cormac Flanagan Matthew Flatt Shriram Krishnamurthi and Matthias Felleisen Department of Computer Science Rice University Houston Texas Abstract Teaching intro ductory computing courses with Scheme el evates the intellectual level of the course and thus makes the sub ject more app ealing to students with scientic interests Unfortunatelythe p o or quality of the available programming environments negates many of the p edagogic advantages Toovercome this problem wehavedevel op ed DrScheme a comprehensive programming environmentforScheme It fully integrates a graphicsenriched editor a multilingua l parser that can pro cess a hierarchyofsyntactically restrictivevariants of Scheme a functional readevalprint lo op and an algebraical ly sensible printer The environment catches the typical syntactic mistakes of b eginners and pinp oints the exact source lo cation of runtime exceptions DrScheme also provides an algebraic stepp er a syntax checker and a static debugger The rst reduces Scheme programs including programs with assignment and control eects to values and eects The to ol is useful for explainin g the semantics of linguistic facilities and for studying the b ehavior of small programs The syntax c hecker annotates programs with fontandcolorchanges based on the syntactic structure of the pro gram It also draws arrows on demand that p oint from b ound to binding o ccurrences of identiers The static debugger roughly sp eaking pro vides a typ e inference system
    [Show full text]
  • Supplementary Material Forrebuilding Racket on Chez Scheme
    Supplementary Material for Rebuilding Racket on Chez Scheme (Experience Report) MATTHEW FLATT, University of Utah, USA CANER DERICI, Indiana University, USA R. KENT DYBVIG, Cisco Systems, Inc., USA ANDREW W. KEEP, Cisco Systems, Inc., USA GUSTAVO E. MASSACCESI, Universidad de Buenos Aires, Argentina SARAH SPALL, Indiana University, USA SAM TOBIN-HOCHSTADT, Indiana University, USA JON ZEPPIERI, independent researcher, USA All benchmark measurements were performed on an Intel Core i7-2600 3.4GHz processor running 64-bit Linux. Except as specifically noted, we used Chez Scheme 9.5.3 commit 7df2fb2e77 at github:cicso/ChezScheme, modified as commit 6d05b70e86 at github:racket/ChezScheme, and Racket 7.3.0.3 as commit ff95f1860a at github:racket/racket. 1 TRADITIONAL SCHEME BENCHMARKS The traditional Scheme benchmarks in figure1 are based on a suite of small programs that have been widely used to compare Scheme implementations. The benchmark sources are in the "common" directory of the racket-benchmarks package in the Racket GitHub repository. The results are in two groups, where the group starting with scheme-c uses mutable pairs, so they are run in Racket as #lang r5rs programs; for Racket CS we expect overhead due to the use of a record datatype for mutable pairs, instead of Chez Scheme’s built-in pairs. The groups are sorted by the ratio of times for Chez Scheme and the current Racket imple- mentation. Note that the break-even point is near the end of the first group. The racket collatz benchmark turns out to mostly measure the performance of the built-in division operator for rational numbers, while fft and nucleic benefit from flonum unboxing.
    [Show full text]
  • Towards a Portable and Mobile Scheme Interpreter
    Towards a Portable and Mobile Scheme Interpreter Adrien Pi´erard Marc Feeley Universit´eParis 6 Universit´ede Montr´eal [email protected] [email protected] Abstract guage. Because Mobit implements R4RS Scheme [6], we must also The transfer of program data between the nodes of a distributed address the serialization of continuations. Our main contribution is system is a fundamental operation. It usually requires some form the demonstration of how this can be done while preserving thein- of data serialization. For a functional language such as Scheme it is terpreter’s maintainability and with local changes to the original in- clearly desirable to also allow the unrestricted transfer offunctions terpreter’s structure, mainly through the use of unhygienicmacros. between nodes. With the goal of developing a portable implemen- We start by giving an overview of the pertinent features of the tation of the Termite system we have designed the Mobit Scheme Termite dialect of Scheme. In Section 3 we explain the structure interpreter which supports unrestricted serialization of Scheme ob- of the interpreter on which Mobit is based. Object serialization is jects, including procedures and continuations. Mobit is derived discussed in Section 4. Section 5 compares Mobit’s performance from an existing Scheme in Scheme fast interpreter. We demon- with other interpreters. We conclude with related and futurework. strate how macros were valuable in transforming the interpreter while preserving its structure and maintainability. Our performance 2. Termite evaluation shows that the run time speed of Mobit is comparable to Termite is a Scheme adaptation of the Erlang concurrency model.
    [Show full text]