Scheme (programming language)

This is an old revision of this page, as edited by Nanshu (talk | contribs) at 09:08, 22 February 2003 (ja:). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.


The Scheme programming language is a functional programming language which is a dialect of Lisp. It was developed by Guy L. Steele and Gerald Jay Sussman in the 1970s and introduced to the academic world via a series of papers now referred to as Sussman and Steele's 'Lambda Papers.'

It was the first variety of Lisp to feature lexical variable scoping rather than dynamic variable scoping. Like Lisp, Scheme supports garbage collection of unreferenced data. It uses lists as primary data structure, and list operations such as cdr and car.

Scheme's philosophy is unashamedly minimalist. Its goal is not to pile feature upon feature, but to remove weaknesses and restrictions that make new features appear necessary. Therefore, Scheme provides as few primitive notions as possible, and let everything else be implemented on top of them. For instance, the main mechanism for governing control flow is tail recursion.

Why the curious name? Well, it was originally called "Schemer", in the tradition of the languages Planner and Conniver, but its authors used the ITS operating system which didn't allow filenames longer than 6 characters.


Advantages of Scheme

Scheme has very little syntax compared to many other programming languages. It has no operator precedence rules because they are explicit in the notation.

Thanks to its macro facilities, Scheme can be adapted to any problem ___domain. Extending Scheme to naturally support object-oriented programming can be done using only macros.

Scheme encourages functional programming. Pure functional programs need no global variables and don't have side-effects, and are therefore automatically thread-safe, automatically verifyable and have more of these nice properties. However, Scheme can also do variable assignment for those who want it.

In Scheme, functions are first class citizens. This means they can be passed as arguments to another function or stored in a variable and manipulated. This allows higher order functions that can further abstract program logic.


Disadvantages of Scheme

Unlike scripting languages such as Perl or Python, Scheme is not standardized beyond its core. Functions that exist in one Scheme implementation do not need to exist in another or may have a completely different name and/or interface. The Scheme Requests for Implementation (SRFI) process tries to remedy this.


Standards

There are two standards that define the Scheme language: the official IEEE standard, and a de facto standard called the Revisedn-th Report on the Algorithmic Language Scheme, nearly always abbreviated RnRS, where n is the number of the revision. The latest RnRS version is R5RS, available online at http://www.schemers.org/Documents/Standards/R5RS/ .


Examples

Scheme code can be found in at least the following Wikipedia articles:


Implementations

  • Chez Scheme, a proprietary freeware Scheme interpreter and commercial Scheme compiler for Microsoft Windows and several UNIX systems
  • Guile is the GNU project's official extension language. The Scheme interpreter is packaged as a library to provide scripting to applications. It can be found here.
  • The PLT Scheme suite, a suite of Scheme programs for Windows, Mac, and Unix platforms including an interpreter (MzScheme), a graphical toolkit (MrEd), a pedagogically-oriented graphical editor (DrScheme), and various other components including Component object model and ODBC libraries.
  • Gauche is an R5RS Scheme implementation developed to be a handy script interpreter, which allows programmers and system administrators to write small to large scripts for their daily chores. Quick startup, built-in system interface, native multilingual support are some of my goals. Gauche is being developed by Shiro Kawai and BSD licensed.It can be found at this site.


Additional Resources