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

 



Forgot your password?
typodupeerror
×

Draft Scheme Standard R6RS Released 235

Watson Ladd writes, "The new version of the official Scheme standard has been released as a draft (PDF)." From the draft: "[This] report gives a defining description of the programming language Scheme. Scheme is a statically scoped and properly tail-recursive dialect of the Lisp programming language invented by Guy Lewis Steele Jr. and Gerald Jay Sussman. It was designed to have an exceptionally clear and simple semantics and few different ways to form expressions. A wide variety of programming paradigms, including imperative, functional, and message passing styles, find convenient expression in Scheme."
This discussion has been archived. No new comments can be posted.

Draft Scheme Standard R6RS Released

Comments Filter:
  • Hurray! (Score:5, Funny)

    by Anonymous Coward on Sunday September 17, 2006 @03:27PM (#16125716)
    (I (for one (welcome (our new (Scheme (overlords.))))))
  • Actually, I have been carrying around R5RS with me for a while; it will be nice to suck down more print quota on r5r6 (when it is released). Scheme is quite a fun language, though as far as Lisps go, I do prefer Common. Still, for people who want to learn how to program, I generally tell them to start out with Scheme, usually using the PLT stuff [plt-scheme.org], and to look at SICP [mit.edu].
  • by RAMMS+EIN ( 578166 ) on Sunday September 17, 2006 @03:31PM (#16125736) Homepage Journal
    Scheme is a language that every programming language enthusiast should know. Being both simple and flexible, it's suitable for communicating and explaining all kinds of concepts. A lot of books and papers are about Scheme or use Scheme for examples or teaching (see Readscheme.org [readscheme.org]). Scheme also pioneered some of the concepts in modern programming languages (such as lexical scoping), as well as several uncommon features (such as hygienic macros and first-class continuations). There are many Scheme implementations, some tiny, some slow, some fast, some with extensive libraries, some which interface to other programming languages, etc. etc.
    • by TheRaven64 ( 641858 ) on Sunday September 17, 2006 @03:47PM (#16125813) Journal
      Scheme is a language that every programming language enthusiast should know.

      No, it (or some other Lisp dialect) is a language that every programmer should know. Every programmer should know Lisp, Smalltalk, and either C or some dialect of assembly language (ideally both). As a bonus, they should also know Haskell and Prolog. Once you know these languages, it is trivial to pick up any other. I would also recommend Erlang; not because it's a particularly good example of anything, but just because it's a real joy to work with.

      • Re: (Score:3, Interesting)

        by brilinux ( 255400 )
        While we are on this bit, I would recommend an ML, either SML [standardml.org] or OCaml [inria.fr], perhaps even in place of Haskell [haskell.org] (Haskell's syntax can be easily argued to be either better than or worse than ML's, and anything you can so in Haskell (including type-classes and lazyness) can be done in ML, so while I do use Haskell, I generally recommend one of the MLs as a well-typed, type-inferring functional language to know (OCaml if they are more systems/applications oriented, and SML if they are more theory oriented or just cur
        • SML or OCaml are great lenguages, but if you're going to learn a functional language, Haskell is a great place to start. First because the syntax is very clean (I never quite liked the "let rec" bit) but also because in both SML and OCaml it is too easy to slip back into imperative styles. Haskell makes that substantially more difficult, which means to use it well you really, really have to get the whole functional programming idea.
        • Re: (Score:3, Funny)

          Be careful man. It's not wise to leave unbalanced parentheses in a Slashdot post in general, but in an article about Scheme, it's damn near suicidal!
      • Re: (Score:3, Insightful)

        by Poeir ( 637508 )
        I'm with you on the recommendation of learning Erlang, but not for the same reason you are. The vast majority of new systems are at least dual core today. Most people run at least two programs, often meaning that one program can run entirely on one core, and another program runs on another core. Intel recently announced quad-core CPUs, and the first prototypes have got into a few people's hands. It looks like as time goes on, instead of upping the clock speed, the number of cores will increase. Most pr
      • Heh. Which of those will help you learn APL?
      • by pilkul ( 667659 )
        Once you know these languages, it is trivial to pick up any other.

        I call bullshit. How about SQL (navigational language) or Clik (parallel-programming oriented language)?

        Anyway, putting aside the fact that you neglected several paradigms, in the real world it takes much longer to master all the minor technicalities of a language than the basic idea of it. You're like that linguist who claimed to have learned Japanese after watching a single subtitled movie. Yeah, he understood it was a subject-obje
      • ... for the same reasons why we must learn history (to know not to make the same mistakes ourselves)...

        scheme code unevitably turns into an unreadable pile of ((((((((((()((() junk

        Actually, I could not give an accurate representation of scheme, because slashdot kept saying 'Lameness filter encountered. Post aborted! Reason: Please use fewer 'junk' characters.'

        And don't get me started in functional programming languages.
    • Being both simple and flexible, it's suitable for communicating and explaining all kinds of concepts.

      Scheme is an extremely cumbersome language for experienced computer scientists to communicate ideas: Scheme lacks many concepts (e.g., exceptions, threads, records, associative data structures) that are widely used for communicating ideas. That may be justifiable for a teaching language, but it makes Scheme too cumbersome for most other purposes.

      Scheme also pioneered some of the concepts in modern programmi
      • exceptions

        meh [plt-scheme.org]

        threads

        yeah right whatever [plt-scheme.org]

        records

        can be trivially replaced by lists

        associative data structures

        such as hashes? [plt-scheme.org]

        While these aren't into the RnRS themselves (they don't have many reasons to be there either, anyway), saying that Scheme somehow "lacks" these concepts mostly shows that you don't know the language at all.

        • And it sure looks like I should've read the R6RS status report before posting this, because all of these are either filed under "features to be added" or "Work in Progress" (with references to the related SRFIs)

      • R6RS has exceptions and records. It has continuations, and some implementations provide threads (this is not something that belongs in the standard). It has hash tables. Also, the GP stated he recommends PLT, which already has all of these.
        • Well, I'm glad that we seem to agree that it is necessary (though not sufficient) for a language to have exceptions and threads in order to be a good language for communicating concepts in computer science. Right now, Scheme is defined by R5RS, and R5RS lacks those. That's one of the many reasons for Scheme's failure to catch on (contrary to popular opinion, syntax is probably not one of them; after all, XML and Perl succeeded despite their syntax).

          Whether R6RS will be a good language for communicating co
          • I wasn't agreeing with you. As for what "Scheme is defined by", it doesn't matter: You program with implementations, not standards. R6RS is also not much different from R5RS at all -- It is mostly library additions. This should make teaching easier, as one can show off hash tables to students without first requiring they import some module or use some specific implementation. Furthermore, Scheme, as it is now, can be a very good "grown-up" language (whatever that means). See Chicken Scheme and its large num
            • Re: (Score:3, Insightful)

              by oohshiny ( 998054 )
              As for what "Scheme is defined by", it doesn't matter: You program with implementations, not standards

              We're not discussing whether Scheme is a good language to program in (that's a separate debate), we're discussing whether it's a good language to communicate ideas in, as the GP claimed.

              Furthermore, Scheme, as it is now, can be a very good "grown-up" language (whatever that means).

              It means that programmers and computer scientists find other languages more useful for communicating their ideas and getting the
          • by msuzio ( 3104 )
            I can't say I agree with that. Where in the world would you get that idea? Threads and exceptions are nice, but so many programs of considerable value can be written without ever touching those concepts that they are not fundamentals in any way.

            I don't at all get your point(s). Especially knocking data structure support in Scheme -- that would have to be the fundamental structure of the entire language, isn't it? Lists and atoms are, well, kind of it, and everything else can be built from those (and oft
            • Lists and atoms are, well, kind of it, and everything else can be built from those (and often already are, via slib for example).

              Brainfuck is an even more minimal language than Scheme but that doesn't make it a better language. Good language design isn't about choosing a minimal set of primitives, it's about choosing a good set of primitives.
      • by bidule ( 173941 )

        Here Scheme has the same failing as the C language. The C++ language does not define threads either. If you skim through the srfi, you'll find that most if not all of these issues are "standardized", but outside the language itself.
      • ``Scheme is an extremely cumbersome language for experienced computer scientists to communicate ideas: Scheme lacks many concepts (e.g., exceptions, threads, records, associative data structures) that are widely used for communicating ideas.''

        It depends on the level at which you want to communicate, I guess. The advantage Scheme has over many other languages it that it doesn't lock you into a particular way of doing things. For example, if you _want_ throw-catch style exceptions, you can easily implement th
        • So you're saying Scheme did not pioneer all the things I said it did. Could you enlighten me as to where I went wrong, and which languages did pioneer these things?

          Algol 60 had lexical scoping and predated Scheme by many years.

          It depends on the level at which you want to communicate, I guess. [...] For example, if you _want_ throw-catch style exceptions, you can easily implement them in Scheme, but if you want a more flexible Scheme, you can easily implement that, too.

          At issue is not what Scheme has, at iss
          • ``Algol 60 had lexical scoping and predated Scheme by many years.''

            Thanks for the correction. What about the other features I mentioned? Was I right about those?

            ``At issue is not what Scheme has, at issue is what it lacks.''

            That may be how you want to frame the discussion, but I won't go along with that. Many things that are ostensibly lacking from Scheme can be added, whereas things that are included can't be taken away. See my earlier comment about exceptions.

            ``Many languages have call/cc or equivalent co
            • That may be how you want to frame the discussion, but I won't go along with that.

              We're discussing this claim:

              Scheme is a language that every programming language enthusiast should know. Being both simple and flexible, it's suitable for communicating and explaining all kinds of concepts.

              That's the claim I disagree with: you can be an educated computer scientists or language enthusiast these days and never bother with Scheme.

              Thanks for the correction. What about the other features I mentioned? Was I right abo

    • by feijai ( 898706 )

      There are many Scheme implementations, some tiny, some slow, some fast, some with extensive libraries, some which interface to other programming languages, etc. etc.

      IMHO, this is precisely why Scheme has failed to catch on in the Lisp community. There really isn't a standard: there are a series of standards and a whole lot of RFIs, and every Scheme system implements its own subset. It's amazingly frustrating building a portable Scheme program. Common Lisp has fewer, more stringent standards, and is mu

      • ``IMHO, this is precisely why Scheme has failed to catch on in the Lisp community. There really isn't a standard: there are a series of standards and a whole lot of RFIs, and every Scheme system implements its own subset.''

        I'd say you get the general gist, but I can't really agree with your wording. There really is a standard. And yes, it is very minimal, but that's deliberate: the idea has been that something only gets standardized once everybody agrees on the way to do it, and implementations are left fre
        • by feijai ( 898706 )

          Compare this to Python or Ruby or Java or Perl, where there is not only a standard, but a benchmark program which every implementation must be bug-for-bug compatable with. That's when you start seeing real portability.

          Actually, no. Most of these languages don't _have_ a standard, only an implementation.

          Hmmm, both Python and Java have formal specifications easily found on the web. So your usage of "most" requires some... mathematical flexibility. But granted, I'm not sure if either Ruby of Perl have

  • ..."I came, I saw, I programmed in LISP." This is interesting, but what I'd like to see is a dual-core-optimized dialect of QBasic that will handle obscenely large arrays without kvetching.
  • by RPoet ( 20693 ) on Sunday September 17, 2006 @03:45PM (#16125791) Journal
    I've never heard about this language, but hopefully the new version will help it keep up with the latest innovations in programming languages, such as codeblocks and Web 2.0.

    Yours truly,
    Fictional stereotypical teenage Ruby fanatic.
  • by mav[LAG] ( 31387 ) on Sunday September 17, 2006 @03:46PM (#16125800)
    are both tools of beauty that have taught me more about programming and problem-solving than all other languages combined. SICP [mit.edu] and PAIP [norvig.com] are both classics in this regard that everyone should rush out and get now.

    It's just such a pity that, since they're both standards which anyone can implement, lots of people do, and as a result, finding one you like and then getting it to talk to other languages and libraries can be a very frustrating experience. And languages like Python with one canonical implementation driven by a BDFL and with exceptional library support are just getting more Lisp-like, which can't be good news for for a renaissance in Lisp or Scheme. Pity really, since I really like 'em both...

  • Tail Recursion (Score:5, Informative)

    by RAMMS+EIN ( 578166 ) on Sunday September 17, 2006 @03:52PM (#16125838) Homepage Journal
    For those of you who don't know what "properly tail recursive" means, a quick explanation. Consider the following code:

    (define (f x) (x x))
    (f f)

    This defines a function, f, which takes one argument, x, which should be a function (yay, first-class functions!), and calls x upon itself. Then, it calls f on f.

    Of course, this will cause f to call f upon itself. Again. And again. Infinite recursion!

    Now, proper tail recursion means that if a function call returns in tail position (meaning it is the last thing the surrounding function does before it returns), the activation frame for the surrounding function is replaced by that of the function it calls. Contrast this with normal recursion, where a _new_ activation frame would be created for the called function.

    Tail recursion makes the example code above run in bounded memory...looping forever. :-)
    • Not bounded memory. It just has to run forever. If the system has an infinite amount of memory, that memory can be consumed by the recusion and that is propert tail recursion. Not that that would matter at all in reality.
      • by leshert ( 40509 )
        I think that in this case, "proper tail recursion" is just an inexact and fuzzy way of saying "supports proper tail-call optimization" and "supports proper recursion".

        For example, C specifies "proper recursion" but most implementations do no tail-call optimization, and so they suffer from the performance characteristics you mention.

        Obviously, if the function itself consumes memory, then yes--even a language and implementation that performs tail-call optimization will consume infinite memory. But if a langu
  • I notice that r6rs has a lot more editors than r5rs, and another author...

    Which isn't surprising. r6rs is twice as long as r5rs which had the entire table of contents on the first page.

    I'm glad to see that a lot of the slib stuff is being merged into scheme, and that they're making a lot of progress on number types. r6rs is laying out a lot more information on ADTs, IO and Unicode support.

    The explanation of continuations is still as clear as mud. How are they so easy in Python and so hard in Scheme?
    • Short and simple explanation of continuations:

      A continuation is "the part of the program that hasn't been executed yet". If your code is

      (foo)
      (bar)
      (baz)

      and you've just executed (foo), the continuation is (bar) (baz).

      In Scheme, continuations are first-class values, which means they can be stored in variables, returned from functions, passed as arguments, etc.

      There is a single way to create continuations, namely through the call-with-current-continuation form (often abbreviated call/cc). You pass call/cc a fun
  • by Bluesman ( 104513 ) on Sunday September 17, 2006 @06:15PM (#16126415) Homepage
    This always comes up, but if you're at all interested in programming languages, here's why you should learn Scheme.

    A few years ago I was doing a project that involved parsing the intermediate code that GCC generated while compiling a C program. Doing a bit of research I found out that one of GCC's intermediate stages was a language called RTL (register transfer language). To my surprise, RTL looked something like this:

    (set (reg:0) (mem:blah blah))

    But wait, I thought -- that looks like Lisp. Come to find out RTL was based on lisp s-expressions.

    It was then I realized what the Big Deal with Lisp was - it has no syntax at all, and programs written in this parenthetical form are trivially converted into a parse tree. In fact, if you've ever written a simple interpreter or compiler, odds are good you'd use a list-like structure to store the parsed code.

    The reason Lisp and Scheme are so "powerful" is that you, as a programmer, have direct access to the program's parse tree at all times. (You can even alter the parse tree at compile time with macros, which is really modifying the compiler to suit your program.)

    But really, the best way to learn why Scheme or Lisp are so great is to implement them. Writing a Scheme to assembly compiler will give you an incredibly deep understanding as to how compilers and programming languages in general work.

    If you were to try to write a compiler for any other language, you'd probably spend most of your time on the lexer and parser. With Lisp or Scheme, the program, as written, is already almost fully parsed for you. Once you understand that, you'll realize why it's so cool.

  • Learn Scheme (Score:4, Informative)

    by borgboy ( 218060 ) on Sunday September 17, 2006 @06:29PM (#16126509)
    I am sure there are a numer of ways to learn Scheme if you are interested. Here's one: follow the CS-61A course podcast [berkeley.edu] of Brian Harvey's class at Berkeley.
  • I thought the Scheme language had been standardized by the IEEE a while back. Is this a revision of the standard, then?

One man's constant is another man's variable. -- A.J. Perlis

Working...