Are there any purely functional Schemes or Lisps?

nickname picture nickname · May 23, 2010 · Viewed 9k times · Source

I've played around with a few functional programming languages and really enjoy the s-expr syntax used by Lisps (Scheme in particular).

I also see the advantages of working in a purely functional language. Therefore:

Are there any purely functional Schemes (or Lisps in general)?

Answer

jonr picture jonr · May 25, 2010

The new Racket language (formerly PLT Scheme) allows you to implement any semantics you like with s-expressions (really any syntax). The base language is an eagerly evaluated, dynamically typed scheme variant but some notable languages built on top are a lazy scheme and a functional reactive system called Father Time.

An easy way to make a purely functional language in Racket is to take the base language and not provide any procedures that mutate state. For example:

#lang racket/base
(provide (except-out (all-from-out racket/base) set! ...more here...))

makes up a language that has no set!.