R6RS Status Report

Kent Dybvig, Will Clinger, Matthew Flatt, Mike Sperber, and Anton van Straaten

June 21, 2006

1. Overview
2. Change Log
3. Guiding Principles
4. Decisions
4.1. Language structure
4.2. Programs
4.3. Features eliminated
4.4. Changes
4.5. Features added
4.6. Features to be added
4.7. Reaffirmations
4.8. Beyond R6RS
5. Mutability of pairs
6. Reference implementations 
7. Work in Progress
7.1. Libraries
7.2. Records
7.3. Unicode
7.4. Arithmetic
7.5. Exceptions
7.6. I/O
7.7. Macros
7.8. Binary block datatype
7.9. Other possible changes
8. Completion Process

1. Overview

This status report describes the current state of the R6RS standardization effort. It covers principles we have outlined to guide the effort, decisions we have made to date, our work in progress, and the process by which we intend to complete the Revised6 Report on Scheme.

2. Change Log

Here is a brief overview of the important changes to this document since the February 2006 version.

Section 4.1 provides some examples of libraries we believe might be required by R6RS.

Section 4.2 (new): describes the forms which portable code can take.

Section 4.3: now lists interaction-environment, top-level definitions, and top-level expressions among the eliminated features. It also lists scheme-report-environment, null-environment quotient, remainder, and modulo among those that have been relegated to an R5RS compatibility library.

Section 4.4 lists several additional changes. (All but the first four listed are new.)

Section 4.5 lists several added features. (All but the first six listed are new.)

Section 4.6 lists two new features to be added: scripts and a byte-vector datatype. Read/write invariance is now covered in Section 4.4.

Section 4.7 lists several newly reaffirmed features. (All but the first three listed are new.)

Section 4.8 lists several features that are officially not under consideration for R6RS. (All but the first four listed are new.)

Section 5 announces that the editors have decided to reconsider whether to make pairs immutable and may even consider whether to require that the second argument of cons be a list.

Section 6 (new) describes the editors' commitment to provide reference implementations for the major subsystems included in R6RS.

Section 7.2 documents that we have now withdrawn the record SRFI as planned, after receiving valuable community input, and that support for records will be based on this SRFI. It also describes decisions we have made regarding some issues left open by the SRFI.

Section 7.3 documents that we have now withdrawn the Unicode SRFI as planned, after receiving valuable community input, and that support for Unicode will be based on this SRFI.

Section 7.4 documents that the arithmetic SRFI has undergone revisions.

Section 7.5 documents that we have decided to base the R6RS exception system on SRFI's 34 and 35.

Section 7.6 documents that we have decided to base the R6RS I/O system on SRFI's 79 and 81.

Section 7.8 (new) documents that we have decided to base R6RS byte vectors on SRFI 74.

Section 7.9 now lists enumerations and eval among possible features and changes. Some of the previously listed items are no longer under consideration and are now listed as "beyond R6RS" in Section 4.8:

One is now mentioned in Section 4.1:

One is now mentioned in Section 4.7:

Some are listed as changes to be made, features added, or features to be added:

Section 8 now lists Sperber and Clinger as the editors in charge of byte vectors.

3. Guiding Principles

To help guide the standardization effort, the editors have adopted a set of principles, presented below. They are, like R6RS itself, a work in progress and still subject to change.

Like R5RS Scheme, R6RS Scheme should:

In addition, R6RS Scheme should:

In general, R6RS should include building blocks that allow a wide variety of libraries to be written, include commonly used user-level features to enhance portability and readability of library and application code, and exclude features that are less commonly used and easily implemented in separate libraries.

R6RS Scheme should also be backward compatible with programs written in R5RS Scheme to the extent possible without compromising the above principles and future viability of the language. With respect to future viability, we operate under the assumption that many more Scheme programs will be written in the future than exist in the present, so the future programs are those with which we must be most concerned.

4. Decisions

This section outlines the decisions made to date.

4.1. Language structure

The R6RS language consists of a core language and a set of additional libraries. The exact composition of the core language is expected to fluctuate as other features of R6RS are finalized.

Some examples of the kind of libraries which R6RS might specify are as follows:

4.2. Programs

R6RS programs exist only in the form of libraries and scripts. A library consists of a single top-level library form. Libraries may import variable and keyword bindings from other libraries (standard or user-defined) and may export variable and keyword bindings. A script consists of a standard script header and a single top-level library. All definitions and expressions must appear within a library form; R6RS has no notion of a top-level definition or expression. The eval procedure will likely, however, allow the evaluation of an expression (but not a definition) within the scope of a specified set of library bindings.

4.3. Features eliminated

The following features of R5RS have been eliminated.

The following features of R5RS are deprecated but will be available in an R5RS compatibility library:

4.4. Changes

The following syntactic and semantic changes have been made to existing features.

4.5. Features added

The following features have been added:

4.6. Features to be added

The following features will be added, but the details have yet to be fully worked out.

4.7. Reaffirmations

The following features of R5RS are reaffirmed for R6RS.

4.8. Beyond R6RS

The following features are definitely not under consideration for R6RS. We encourage anyone interested in seeing any of these features in R7RS to make concrete proposals via the SRFI process.

5. Mutability of pairs

Although set-car! and set-cdr! were previously reaffirmed (Section 4.7), the editors have decided to reconsider whether pairs should be immutable in R6RS. Members of the Scheme community wishing to weigh in on the issue should contact one of the editors.

Making pairs immutable would simplify argument error checks for some list-processing operations, simplify the list? predicate, allow apply not to copy the input list when invoking a procedure with a dot interface, and allow program improvers to perform deforestation, i.e., to eliminate some of the intermediate lists allocated when nested mapping, reversing, appending and similar operations are used. User-defined record types can be used in place of pairs whenever a mutable data structure is required.

On the other hand, making pairs immutable is an incompatible change that would break some existing programs, and mutable pairs are natural building blocks for various abstractions, like queues and streams.

A more radical change is to require that the second argument to cons be a list, i.e., the empty list or a pair. This would make list? constant time and further simplify argument error checks for some list-processing operations. Pairs would become useful only as building blocks for lists, and records (or vectors) would have to be used for most other purposes for which pairs are currently used.

6. Reference implementations 

The editors will publish, along with the revised report proper, nonnormative, portable (with implementation-dependent hooks as necessary), and reasonably efficient reference implementations of the major subsystems of R6RS, including the library, record, Unicode, arithmetic, exceptions, I/O, and macro subsystems. The editors may publish reference implementations of selected additional features as well.

7. Work in Progress

Most of the standardization effort is currently focused on several subsystems. Sections 7.1-7.8 list for each subsystem any informal requirements the editors have identified, the current status, and open questions.

In several cases, a subsystem is up for discussion as a SRFI in order to give the editors a chance to inform the community of the ongoing work and obtain valuable feedback from the community. The final mechanism adopted for R6RS may, however, differ in minor or significant ways from the published SRFI.

A list of other items up for consideration is given in Section 7.9. These have not received as much attention to date, usually because they involve less complex or far-reaching changes or are considered to be of lower priority.

7.1. Libraries

Informal requirements: support distribution of portable libraries, support identification of library location, namespace management, export/import of macros, permit separate but dependent analysis and compilation, support generation of efficient compiled code, ability to define new libraries.

Support for libraries is under community discussion via SRFI 83 (R6RS Library Syntax). Two big issues have arisen: the need to clarify phases, e.g., for compile-time modules that import at compile-time, and how library names are written (coding as strings is controversial). Still up in the air are the extent to which the syntax of import and export forms is tied down, what built-in libraries besides r6rs there might be, and how to support subsetting and supersetting of libraries.

7.2. Records

Informal requirements: disjoint types, syntactic interface, mutable fields.

Support for records will be based on SRFI 76 (R6RS Records), which has now been withdrawn as planned after revisions based in part on community input. While the SRFI did not fully specify the generativity of ordinary record definitions, we have decided that they should be "run-time" generative unless declared nongenerative. We have also eliminated the restriction that the parent of a nongenerative record be a nongenerative record, and we decided to keep the "sealed" feature.

Additionally, we have decided to allow an implementation to treat any or all of its built-in types as records, i.e., record? may or may not return true for an object of a built-in type.

7.3. Unicode

Informal requirements: provision for Unicode characters and character syntax, Unicode strings and string syntax; Unicode character I/O; integer->char and char->integer are inverse operations and support Unicode-specific text encodings; write/read invariance for every datum, including symbols.

Support for Unicode will be based on SRFI 75 (R6RS Unicode data), which has now been withdrawn as planned after revisions based in part on community input. See http://srfi.schemers.org/srfi-75/mail-archive/msg00309.html for a discussion of probable differences between the withdrawn SRFI and R6RS.

7.4. Arithmetic

Informal requirements: support for IEEE zeros, infinities, and NaNs, clean up behavior of eqv? wrt numbers, fix certain arithmetic operations, transparency.

Changes for R6RS arithmetic, including support for fixnum-specific, flonum-specific, and bitwise operators and IEEE arithmetic, are under community discussion via SRFI 77 (Preliminary Proposal for R6RS Arithmetic), which has recently been revised based in part on community input.

7.5. Exceptions

Informal requirements: clarify the meaning of "is an error," view exception handling as a means of communication between parts of the program.

The editors have decided to adopt SRFI 34 (Exception Handling for Programs) as the basis for the R6RS exception-handling system and SRFI 35 (Conditions) as the basis for the R6RS condition system.

7.6. I/O

Informal requirements: read-byte and write-byte, ports that support binary I/O, byte-vector datatype, block read/write operations.

The editors have decided to adopt SRFI 79 (Primitive I/O) and SRFI 81 (Port I/O) as the basis for the R6RS I/O system.

The byte-vector datatype requirement is addressed by the binary block datatype (Section 7.8).

7.7. Macros

Informal requirements: specify expansion semantics, specify interaction with modules, allow procedural transformers, hygiene-breaking operations, maintain support for syntax-rules.

The editors have decided to adopt syntax-case as currently implemented in Chez Scheme and MzScheme, with various differences to be worked out by Dybvig and Flatt. Also, the underscore identifier ("_") will no longer be a pattern variable but instead a special identifier that matches any input, and underscore will be allowed in place of the keyword naming a macro in a syntax-rules pattern.

SRFI 93 (R6RS Syntax-Case Macros) has recently been submitted.

7.8. Binary block datatype

The editors have decided to adopt SRFI 74 (Octet-Addressed Binary Blocks) as the basis for byte-vector functionality in R6RS, with the name bytes replaces the name blob. In contrast with the SRFI, the contents of (make-bytes n) is unspecified and an optional fill argument has been added, as with make-string and make-vector.

7.9. Other possible changes

The following possible features and changes have been discussed without resolution.

8. Completion Process

We intend to deliver a draft R6RS to the Steering Committee by September 1, 2006. An initial internal (editors only) draft of R6RS has been created and reflects most of the decisions the editors have made to date. This draft will be updated as work wraps up on the major subsystems and other issues.

For each of the subsystems, the core/library split, and the safe/unsafe mode mechanism and semantics, we have assigned a single editor to be responsible for ensuring progress. We have also assigned one or more additional editors to help. These assignments are shown below.

subsystem primary editor additional editors
libraries Flatt Dybvig
records Sperber Dybvig, van Straaten
arithmetic Clinger Sperber
Unicode Flatt Clinger
macros Dybvig Flatt
exceptions Sperber Clinger
I/O Sperber van Straaten
byte vectors Sperber Clinger
core/library split van Straaten Dybvig
hash tables van Straaten Clinger
safe/unsafe mode Clinger Sperber

At this point, our discussions will be limited mostly to the major subsystems and the other possible features and changes described in Section 7.9. New issues may also be considered if this can be done without jeopardizing our goal to submit a draft R6RS to the steering committee by the target deadline.

Responsibility for making sure that the editors complete their work and communicate effectively lies with the chair (Dybvig) and responsibility for completing the R6RS draft lies with the project editor (Sperber).