Scheme programming language

Updated: 04/26/2017 by Computer Hope

Scheme logoScheme is a programming language that is a variation of LISP. It was created in the 1970s by Guy Steele and Gerry Sussman at MIT's Artificial Intelligence lab. It was the first dialect of LISP that required its implementations to use tail-call optimization, placing a strong emphasis on functional programming and recursive algorithms, in particular.

The Scheme programming language employs a design philosophy of minimalism, specifying a small standard core and providing powerful tools for extending the language. It is widely used in educational and scientific organizations, especially in the field of AI. Programmers who write in Scheme are informally known as "Schemers."

Similarities to LISP

The syntax of the Scheme is very similar to LISP. It is based on s-expressions: parenthesized lists in which the operator comes first and the operands follow. For instance, the expression "3 plus 4 times 5" is written in Scheme as (+ 3 (* 4 5)).

Like LISP, Scheme uses the lambda keyword to represent anonymous functions. For instance, the statement (lambda (x y) (+ x y)) represents an anonymous function that adds two numbers.

Other notable features

  • Lexical scope — the bindings of all variables in Scheme are determined by the unit of code in which the variable appears.
  • A shared namespace for variables and procedures — the same primitives used to operate on variables can be used to operate on procedures and functions as well.
  • A full set of numerical data types.
  • Delayed evaluation, which allows for the implementation of asynchronous programming techniques such as promises and futures.
  • Hygenic macros — a macro system that allows the programmer to extend the functionality of the language without interfering with the language's native syntax.
  • The ability to natively evaluate its own code.
  • The ability to redefine standard procedures and functions.

Hello World! in Scheme

(display "Hello, world!")

MIT, Programming language, Programming terms