Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Programming

R7RS Scheme Progress Report 47

John Cowan recently gave a talk on the progress of R7RS (slides), the next revision of the Scheme language standard, at LispNYC. After the R6RS debacle, the community stepped back and is now basing the next standard on R5RS; the work has been split into two languages — R7RS-Small and R7RS-Large. The first working group is preparing to issue a final draft of the R7RS-Small language (PDF; clocking in at 73 pages vs. R5RS's 50) within the next few weeks. Read on for a summary of the planned changes to R7RS (more or less in the order of presentation).
The talk details a number of improvements over R5RS and R6RS, and is divided into two portions. The majority of the talk discuses the status of the small language, with the last portion giving a quick update on the future intent of the large language group.

First on the list of major new features is a mandatory library system designed to be easily implemented atop existing module systems. R6RS's library system proved to tackle too much at once and be incompatible with everything already in a use (a persistent concern in the design of the R7RS-Small language). The R7RS system, on the other hand, is static, simple, and just powerful enough to promote implementation of portable libraries.

Exceptions are stripped down from R6RS (which proved too incompatible with existing implementations for practical use). guard (similar to try...catch in other languages) and with-exception-handler are supported: the latter runs the handler in the context from which the error was triggered (permitting recovery from the error like invoke-restart ) Unlike r6rs, exceptions lack a strictly defined hierarchy and can be any object (you could e.g. throw 4 if you really felt like it).

Dynamically scoped variables, in the form of parameters, are now part of the standard. Unlike Common Lisp special variables, parameters are first-class objects bound to expressions rather than symbols that are declared dynamically scoped. For reasons of simplicity it was decided to make parameters immutable (i.e. any "mutation" has to be done by rebinding). This has the (intentional) side-effect of making parameters play more nicely with threads (when mutation is permitted, setting a parameter that has not been rebound in the current thread requires synchronizing all threads and can have unexpected results).

As expected, R7RS includes bytevectors to complement strings. The small language standard only permits accessing bytevectors as ordered sets of unsigned 8-bit values (the large language standard will offer more flexible access). Binary I/O is implemented via a set of parallel procedures (open-binary-input-file vs. open-input-file, etc.) in contrast to the incredibly complicated dual binary/text ports provided by R6RS. Additionally, string and bytevector ports similar to SRFI-6 are provided instead of the incompatible string ports provided by R6RS.

Taylor Campbell noted that integer division in most languages is insufficiently expressive, and so R7RS will provide Euclidean division and centered division in addition to the usual suspects. Mathematicians rejoice!

As with R6RS, Unicode support is mandated. Unlike R6RS, the only characters that must be supported are those present in ASCII. For supported characters, Unicode case mapping and normalization are mandatory. One interesting diversion from Unicode and R6RS is that string order comparison is implementation-dependent: this gives implementers latitude with the internal encoding of strings.

Any user of Scheme knows that the language strives for consistent and obvious names for bindings. R7RS furthers this goal by resolving the long-standing inconsistency with core data structure creation, copying, mutation, mapping, etc. Lists, strings, and vectors now have a consistent set of each: make-TYPE, TYPE-copy, TYPE-set!, etc. Conversion procedures between all three types are also provided.

Finally, number of minor improvements were made. Most notable: record types are compatible with SRFI-6 (widely in use today); case sensitivity is the default (with optional insensitivity via include-ci); s-expression and nested block comments were added; IEEE infinities and NaNs have read syntax; strings may contain C-style escape sequences; Common Lisp circular list notation is supported; and common extensions to syntax-rules were standardized.

The final 20 minutes of the talk were about the status of R7RS-Large.

The R7RS Large language is currently on hold, mostly because all the small language members are on the large language committee as well, so there is a lack of time to work on both simultaneously. Work is planned to resume upon release of the final draft of the small language. Some work, however, has been completed.

The main focus of R7RS-Large is providing Scheme "with batteries included." John Cowan started the process by looking beyond the Lisp and Scheme communities (Python is mentioned) to figure out which libraries modern programmers expect their language to include.

This resulted in a list of around 250 packages that was narrowed down to around 80 packages through an initial voting process. It was decided then than some desirable packages (e.g. a foreign function interface) had to be omitted due to complexity. It is expected that implementers will continue experimenting and gradually come to a consensus on the larger packages using the existing SRFI process, and perhaps another revision of the standard down the road.

Of the packages planned for inclusion, the most prominent are: networking, threads, regular expressions, delimited continuations, URI handling, date and time parsing/arithmetic/formatting, hash tables, ambient environment access, file system directory access, gettext (i18n support), and pattern matching.

Most will be optional; packages will only be made mandatory if a number of the other packages require them. A compliant R7RS-Large implementation will only have to either provide a package fully or not at all (half implementations are forbidden).

Interestingly, R7RS large with all packages will be even larger than Common Lisp.

To avoid getting bogged down in stylistic discussions, a decision was made to focus on functionality above other concerns. The resulting packages may not be aesthetically pleasing to everyone, but will provide useful functionality. Users who disagree with naming, scope of functionality, argument ordering, etc. will be free to use the library system to import only the bindings they want, rename functions, wrap things into the style they want, etc. Basically, a compromise between the MIT approach and "Worse is Better" is being sought.

Here a call for volunteers is made: Since the focus will be on functionality over pure aesthetics, developers outside of the Lisp and Scheme communities are actively encouraged to participate in the R7RS-Large language process. No fixed time commitment would be required; the goal is to get a lot of people involved with a few core members maintaining momentum and guiding the process. The R7RS-Large language is most definitely a language designed by and for developers. So, make your voice heard!

Overall R7RS is shaping up to be the standard R6RS should have been (which, of course, could not have happened without the lessons of R6RS). The split between an elegant core language with each design issue meticulously fretted over and voted upon and a looser library standard should, hopefully, result in a core language that will stand the test of time with a standard library that can be used to get actual work done.
This discussion has been archived. No new comments can be posted.

R7RS Scheme Progress Report

Comments Filter:
  • by Anonymous Coward

    So what happened to R2D2?

    • by mrmeval ( 662166 )

      They cut it into a small piece and a large piece then made them incompatible.

      It's inebriated to have two opposing versions of the same version...or ... what?

  • by eepok ( 545733 ) on Tuesday October 04, 2011 @03:45PM (#37603992) Homepage

    It's been quite a while since the summary made so little sense to me that I didn't bother to read the article. Sometimes, I like to be reminded of how much I just don't know.

    Thank you Scheme Language Standard!

  • I didn't understand a word of that gobbledygook. I better turn in my nerd credentials, before someone catches on. :(

    /greger

    • Re:Crap... (Score:4, Interesting)

      by arielCo ( 995647 ) on Tuesday October 04, 2011 @04:16PM (#37604458)

      Don't. It's increasingly harder to be a polymath, even if you confine your domain to technology, perhaps even in CS.

      You may have inferred that Scheme [wikipedia.org] is related to Lisp [wikipedia.org] ; they call it a "dialect", stretching a bit the analogy with human languages. Common Lisp [wikipedia.org] is another, and I had brief run-ins with both while peeking under the hood of two great projects: Maxima [wikipedia.org] and the gEDA suite [wikipedia.org]. They left me impressed and determined to learn the language, as soon as I had the mood/time to wrap my easily-distracted brain around it.

      • Do as the great mathematician Paul Erds did and use amphetamine instead of coffee, it works great ! And your insurance can reimburse it if you have the right symptoms !!!

    • by TopSpin ( 753 )

      There is a functional language called Scheme. It is a minimal LISP with some advanced features and noted for having a very small specification. The current version is (deep breath) R6RS. Don't panic; that just means Revised(6) Report (on the algorithmic language) Scheme. The previous version was R5RS and the next is R7RS. Yes, you could drop all the consonants and have the same result, but that doesn't occur to academics.

      The gist of the story is that R6RS isn't being adopted by implementations (scheme ha

      • From the article, I didn't even pick up that this was a programming language lol...
        http://en.wikipedia.org/wiki/Scheme_(programming_language) [wikipedia.org]

        Thanks for the clarification.

        This stuff sounds like it pre dates my education, I've heard of LISP, but never worked with it, it's something that runs somewhere fortran and C reign and we're a .NET shop with the oldest app being in classic ASP, and some seriously outdated PHP, but LISP? who still runs this and why?

        • by Raenex ( 947668 )

          but LISP? who still runs this and why?

          http://www.google.com/search?q=why+lisp [google.com]

          The main advantage is that the language is extendable via macros, which can reduce a lot of boilerplate. It's also very popular in academia for this reason, because it let's you explore new language features by extending the language.

        • a set of the AI researchers:
          http://act-r.psy.cmu.edu/actr6/ [cmu.edu]

        • by mellon ( 7048 )

          Nobody runs it. There is nothing to see here. These are not the droids you are looking for.

          http://xkcd.com/297/ [xkcd.com]

        • by Riktov ( 632 )

          (re-posting what I just posted anonymously)

          A lot of the "cool, cutting-edge" features you see in popular modern languages like Python, Ruby, JavaScript, etc. - stuff like closures, functions as first-class objects, lambdas, and filter/map/reduce - come straight from Lisp. Even the very idea of XML is just a variation on the list structure of Lisp. It's taken fifty years for these modern languages to catch up to Lisp.

          • I would imagine so lol, the wiki says it's the 2nd oldest OOP, language technology progress tends to be a grab the best and most features you can out of what exists, add a few of your own and name the sucker. Thus why we have a ton of programming languages that are used every day to do the same things differently. Also, it's not very easy to depreciate languages when there are million dollar apps written in them.

            The syntax for LISP is ehm less then elegant though http://www.apl.jhu.edu/~hall/lisp.html [jhu.edu] a s

      • The numbers in R5RS, R6RS, and R7RS are really superscripts: R5RS stands for "the Revised Revised Revised Revised Revised Report on the Algorithmic Language Scheme".

        Personally I think that joke's pretty worn out, but the Working Group decided otherwise.

  • WTH? It's like I opened up "The Two Towers" at page 219 having never read Tolkien before.
  • by e4liberty ( 537089 ) on Tuesday October 04, 2011 @04:15PM (#37604434)
    Chibi-scheme [google.com] is a nice C-based implementation following the R7RS-Small standard closely -- the author is the R7RS-Small committee chair.
    • Not quite R7RS conformant yet, but that's definitely a goal. It's already R5RS conformant.

      There is also a longer range plan to accept JavaScript, Lua, Go, and bash as source languages and translate them to Scheme.

      • When I watched the talk I noticed the multi-language goals of Chibi Scheme seem to overlap with those of Guile — is there any reason there isn't collaboration? Guile did recently get a fancy new VM (with a direct compiler, wingo has made grumblings about rectifying that...), and good progress has been made toward getting Emacs-Lisp running on it (it can load subr.el and run dunnet at least, I've seen it with my own eyes). It seems like getting multiple languages to interoperate other is going to be a

        • by Anonymous Coward

          Cool Anecdote Bro moment: I took a look at Guile after it showed up in a recent slashdot article. (Having some small experience in Scheme, and then a bunch of self study in Common Lisp). I liked Guile.... once I had it running. That was the catch. Getting the latest version running involved a lot more dependency hell than I would prefer; the new version wasn't in the ubuntu repositories, so I had to compile it, and that meant getting a dozen other pieces (some of which themselves weren't in the repos and ne

        • Well, both Guile and Chibi are both meant to be embedded, but in different ways. The Guile 2.0 shared library is about ten times the size of the Chibi shared library (on 32-bit Linux); on the other hand, Guile 2.0 has a compiler, whereas Chibi is a fast bytecode interpreter. In general, Chibi optimizes for space: it doesn't provide multiple versions of procedures in the SRFI 1 list library, for example. Running Chibi (perhaps with some features compiled out) on an embedded chip makes sense; Guile is aime

    • Sadly, it is an interpreter. R7RS is unproven until a serious compiler implements it. There are too many possibilities for unforeseen problems. (I say this from experience; been there, done that, don't have the time right now.)

  • Was not one of scheme original goals to a have small and extendable language and let's it's users use the library they want ? They have lost that goal somewhere along the road from r4rs to r6rs

    • by Sodel ( 1917500 )

      "Was not one of scheme original goals to a have small and extendable language and let's it's users use the library they want ?" That's *exactly* what they're getting: a small, meticulously crafted kernel language, upon which you can build whatever you like!

      Interested in avoiding the fragmentation of a thousand non-standard libraries that do more or less the same thing? Got you covered there, too! R7RS-Large is a portable set of libraries for your applications. Fragmentation, be gone!

      From the summary, the hi

      • Do you know what ambient environment access is ? (This is not a flamebate question, my google cannot seems to be able to explain it to me)

        • by JanneM ( 7445 )

          "Do you know what ambient environment access is ?"

          You can read out the state of your Lava lamp.

        • Either I misspoke or someone misheard. "Environment enquiries" is a Common Lisp term for functions that return things from the environment such as wall-clock time, internal time in jiffies, the name and version of the implementation, the name of the hardware and OS the implementation is running on, the host name, the working directory, the Unix environment variables, the command-line arguments, and so on. Most of these things wound up in R7RS-small one way or another already, but I didn' t know that when

          • Environment enquiries is more sensible that ambient environment access, thank you for the clarification

      • Yes, I agree. There is such a blind reverence to the CLHS and "[just grab a lib|roll your own] is so easy, why bother?" is so prevalent that it seems that many in the CL community don't even conceive of the possibility of an updated standard, just delving into what nuances can be extracted from the current spec for edge cases and optimization conditions. Plus, many of the libraries are something that a CL hacker banged together in his interactive sessions and aren't very robust or documented, but become a

  • The Scheme programming language began as a research and teaching project at MIT in 1975. Since then, it has become very influential among advanced researchers and designers of programming languages. It's also had some successful use in industry. Scheme is defined by a Report on Scheme; this is the 7th Revision of that report, thus R7RS. This hour long talk about the latest revision will be of interest to three groups of people:
    1. Those who already familiar with Scheme, Lisp, or functional programming, a

  • Pointless changes:

    • Renamed "textual" ports to "character" ports. Note that they kept "binary" ports which is properly parallel to "textual". The parallel of "character" (noun) is "byte" (noun), not "binary" (adjective).
    • Library system incompatible with R6RS. R6RS already had a least common denominator library system that all the major Schemes have already implemented. Good luck getting them to implement yet another library system. The summary is misleading when it claims R6RS libraries are complicated.
    • 1) The WG has already voted to use "textual port" instead of "character port", but the new draft has not yet been published.

      2) It is false that "all the major Schemes" have implemented R6RS libraries. The definition of "major" is subjective and subject to change, but Chicken is a major Scheme by any standard, and has not implemented them. It's true that the R7RS library format is not quite a subset of R6RS's, but adding the R7RS features to an R6RS library implementation is expected to be trivial. The ma

      • First, thank you for taking the time to address these concerns. If I am critical, it is only because I want to see R7RS succeed and be a good language spec.

        1) I'm glad to hear about the use of "textual". Watching from the sidelines, it seems like the process has been prone to reinventing things in ways that different than R6RS without being better. That makes it hard for implementors to provide compatibility and smooth upgrade paths.

        2) I'll grant that Chicken is a major Scheme. Your point about phasing

        • Sorry for the delay in responding: ./ won't let me post from behind $EMPLOYER's firewall.

          2) It's still an open issue whether we will support both implicit and explicit phasing in R7RS-large. Personally, I think that since you are not allowed to give identifiers different definitions at different phases in R6RS (as you can in Racket), implicit phasing should suffice. The R7RS extensions to R6RS library syntax make more work for implementers, but less for users. In particular:

          Allowing interspersed import a

"The vast majority of successful major crimes against property are perpetrated by individuals abusing positions of trust." -- Lawrence Dalzell

Working...