Scheme programming language

Updated: 11/13/2018 by Computer Hope
Scheme logo

Scheme is a programming language that is a variation of Lisp. It was created in 1975 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, emphasizing 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 AI (artificial intelligence). Programmers who write in Scheme are informally known as "Schemers."

Similarities to Lisp

The syntax of the Scheme is similar to Lisp. It is based on s-expressions: parenthesized lists where 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 that the variable appears.
  • A shared namespace for variables and procedures — the same primitives used to operate on variables can also operate on procedures and functions.
  • A full set of numerical data types.
  • Delayed evaluation allows 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!")

Lisp, MIT, Programming language, Programming terms