2006 Scheme and Functional Programming Papers, University of Chicago TR-2006-06
Total Page:16
File Type:pdf, Size:1020Kb
λλλλλλλλλλλ λλ λ λλ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λλ λ λ λ λ λλ λλ λ λ λλ λ λ λλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλ Scheme and λλFunctionalλλλλλλλλλλλλλλλλλλλλλλλλλ Programming λλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλ2006λλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλλ Preface This report contains the papers presented at the Seventh Workshop on Scheme and Functional Program- ming, held on Sunday, September 17, 2006 in Portland, Oregon, affiliated with the 2006 International Conference on Functional Programming (ICFP). Out of sixteen papers submitted in response to the call for papers, fifteen were chosen for publication by the program committee in a virtual meeting (one was later withdrawn by its author). We are grateful to external reviewers Matthias Blume (Toyota Technological Institute Chicago), Matthew Flatt (University of Utah), Martin Gasbichler (University of Tubingen),¨ Aaron Keen (Cal Poly), George Kuan (University of Chicago), Jacob Matthews (University of Chicago), Christian Queinnec (University Paris 6), and Adam Wick (University of Utah) for their gracious help. Paper submission and review were managed by the Continue server (http://continue.cs.brown. edu), implemented in Scheme, of course. Thanks to Jay McCarthy and Shriram Krishnamurthi who provided and supported the server. Olin Shivers’ writeup of the 2002 Scheme workshop proved invaluable in organizing this one, as did timely advice from Matthias Felleisen, Mike Sperber, and the steering committee. Thanks also to the ICFP general chair John Reppy, the local arrangements chair Jim Hook, and the ACM for handling registrations and arrangements at the workshop site. Robby Findler University of Chicago Organizer and Program Chair for the program committee Program Committee John Clements (Cal Poly) Cormac Flanagan (UC Santa Cruz) Sebastian Egner (Philips Research) Erik Hilsdale (Google) Robby Findler (University of Chicago) Eric Knauel (University of Tubingen)¨ Steering Committee William D. Clinger (Northeastern University) Christian Queinnec (University Paris 6) Marc Feeley (Universite´ de Montreal)´ Manuel Serrano (INRIA Sophia Antipolis) Robby Findler (University of Chicago) Olin Shivers (Georgia Tech) Dan Friedman (Indiana University) Mitchell Wand (Northeastern University) Scheme and Functional Programming, 2006 3 4 Scheme and Functional Programming, 2006 Schedule & Table of Contents 8:30am Invited Talk: The HOP Development Kit .................................................. 7 Manuel Serrano (Inria Sophia Antipolis) A Stepper for Scheme Macros ............................................................ 15 Ryan Culpepper, Matthias Felleisen (Northeastern University) 10:00am Break 10:30am An Incremental Approach to Compiler Construction ..................................... 27 Abdulaziz Ghuloum (Indiana University) SHard: a Scheme to Hardware Compiler ................................................. 39 Xavier Saint-Mleux (Universit´ede Montr´eal),Marc Feeley (Universit´ede Montr´eal)and Jean-Pierre David (Ecole´ Polytechnique de Montr´eal) Automatic construction of parse trees for lexemes ........................................ 51 Danny Dub´e(Universit´eLaval) and Anass Kadiri (EPITA, Paris France) Rapid Case Dispatch in Scheme .......................................................... 63 William D. Clinger (Northeastern University) Experiences with Scheme in an Electro-Optics Laboratory ............................... 71 Richard Cleis and Keith Wilson (Air Force Research Laboratory) 12:30pm Lunch 2:00pm Gradual Typing for Functional Languages ............................................... 81 Jeremy G. Siek and Walid Taha (Rice University) Sage: Hybrid Checking for Flexible Specifications ....................................... 93 Jessica Gronski (University of California, Santa Cruz (UCSC)), Kenneth Knowles (UCSC), Aaron Tomb (UCSC), Stephen N. Freund (Williams College), and Cormac Flanagan (UCSC) From Variadic Functions to Variadic Relations: A miniKanren Perspective . 105 William E. Byrd and Daniel P. Friedman (Indiana University) 3:30pm Break 4:00pm A Self-Hosting Evaluator using HOAS .................................................. 119 Eli Barzilay (Northeastern University) Concurrency Oriented Programming in Termite Scheme ................................ 125 Guillaume Germain, Marc Feeley, Stefan Monnier (Universit´ede Montr´eal) Interaction-Safe State for the Web ....................................................... 137 Jay McCarthy and Shriram Krishnamurthi (Brown University) Scheme for Client-Side Scripting in Mobile Web Browsing, or AJAX-Like Behavior Without Javascript .............................................. 147 Ray Rischpater (Rocket Mobile, Inc.) Component Deployment with PLaneT: You Want it Where? ............................. 157 Jacob Matthews (University of Chicago) 6:10pm Break for dinnner 8:00pm Gelato 8:15pm R6RS Status Report Kent Dybvig (Indiana University) Scheme and Functional Programming, 2006 5 6 Scheme and Functional Programming, 2006 The HOP Development Kit Manuel Serrano Inria Sophia Antipolis 2004 route des Lucioles - BP 93 F-06902 Sophia Antipolis, Cedex, France http://www.inria.fr/mimosa/Manuel.Serrano ABSTRACT for building HTML graphical user interfaces is presented here. It Hop, is a language dedicated to programming reactive and dynamic is presented in Section 2, along with a presentation of the Hop applications on the web. It is meant for programming applications solution for bringing abstraction to Cascade Style Sheets. such as web agendas, web galleries, web mail clients, etc. While The section 3 focuses on programming the Hop web broker. a previous paper (Hop, a Language for Programming the Web Its presents basic handling of client requests and it presents the 2.0, available at http://hop.inria.fr) focused on the linguistic facilities for connecting two brokers and for gathering information novelties brought by Hop, the present one focuses on its execution scattered on the internet. The Section 4 presents the main functions environment. That is, it presents Hop’s user libraries, its extensions of the broker programming library. to the HTML-based standards, and its execution platform, the Hop web broker. 1.1 The web 2.0 In the newsgroup comp.lang.functional, a Usenet news group DOWNLOAD for computer scientists (if not researchers in computer science) someone reacted rather badly to the official announce of the avail- Hop is available at: http://hop.inria.fr. ability of the first version Hop: “I really don’t understand why people are [so] hyped-up over The web site contains the distribution of the source code, the Web 2.0. It’s just Java reborn with a slower engine that doesn’t online documentation, and various demonstrations. even have sandboxing capabilities built into it. I guess this hype will taper off just like the Java hype, leaving us with yet another 1. Introduction large technology and a few niches where it’s useful.” Along with games, multimedia applications, and email, the web This message implicitly compares two programming languages, has popularized computers in everybody’s life. The revolution is namely Java and JavaScript and reduces Hop to yet another engaged and we may be at the dawn of a new era of computing general-purpose programming language. This is a misunderstand- where the web is a central element. ing. The point of Hop is to help writing new applications that are Many of the computer programs we write, for professional nearly impossible (or at least, discouragingly tedious) to write us- purposes or for our own needs, are likely to extensively use the ing traditional programming languages such as Java and the like. As web. The web is a database. The web is an API. The web is a novel such, its goal is definitively not to compete with these languages. architecture. Therefore, it needs novel programming languages and As a challenge, imagine implementing a program that represents novel programming environments. Hop is a step in this direction. the user with a map of the United States of America that : lets the A previous paper [1] presented the Hop programming language. user zoom in and out on the map, and also helps with trip planning. This present paper presents the Hop execution environment. The In particular the user may click on two cities, and the application rest of this section presents the kind of end-user applications Hop responds with the shortest route between the cities, the estimated focuses on (Section 1.1) and the technical solutions it promotes trip time, the price of the gas for the trip (using local pump prices) (Section 1.2). The rest of this paper assumes a familiarity with strict the weather forecasts along the route (for the appropriate tires), and functional languages and with infix parenthetical syntaxes such as where to find the best pizza and gelatos in each town along the way. the ones found in Lisp and Scheme. Although it is possible to write such a program using Java or C and Because it is normal for a web application to access databases, existing resources available online, the web 2.0 is the infrastructure manipulate multimedia documents (images, movies, and music), that makes it feasible to write such programs. Because the web and parse files according to public formats, programming the web 2.0 provides the potential to easily combine fancy graphics and demands a lot of libraries. Even though it is still young, Hop information from disparate