Go to the first, previous, next, last section, table of contents.

Why Scheme?

There are few topics as controversial and as loaded with individual taste as the choice of a programming language. To make things worse, many people base their preference on ignorance and misconceptions about languages they don't know, and sometimes of the languages they do know as well. The opinions expressed in this section naturally reflect the authors' own preferences. Once you have read this book (and others on other languages) and practiced Scheme for a while, you'll have to form your own opinion.

Scheme is a very nice language for implementing languages, or for transformational programming in general--that is, writing programs that write programs--or for writing programs that can easily be extended or customized. The features that make Scheme attractive for implementing Scheme also make it good for all kinds of things, including scripting, the construction of new languages and application-specific programming environments, and so on.

As you become more familiar with Scheme, you'll probably realize that all interesting programs end up being, in effect, application-specific programming environments. In fact, this style of programming (i.e., turning your programming language into an application-specific environment rather than turning your problem into something understood by your language) is very powerful and has been practiced by experienced Lisp and Scheme programmers for a long time. If you're interested in reading more about this style, we recommend the book On Lisp, Advanced Techniques for CommonLisp by Paul Graham.

Most Scheme systems are interactive, allowing you to incrementally develop and test parts of your program. In this respect, it is much like BASIC or Tcl--but a far cleaner and more expressive language. Scheme can also be compiled, to make programs run fast. The interactivity combined with the possibility to compile makes makes Scheme easy to develop in, like BASIC or Tcl, but still fast, like C. (Scheme isn't usually quite as fast as C, but it's usually not too much slower, if you get a good Scheme compiler.) So if you're a Tcl or BASIC programmer looking for a less crufty and/or fossilized language, Scheme may be for you.

Unlike most interactive languages, Scheme is well-designed: it's not a kludge cobbled up by some people with very limited applications in mind, and later extended past its reasonable scope of application. It was designed from the outset as a general-purpose language, combining the best features of two earlier languages. It is fairly radical revision of Lisp, incorporating the best features of both Lisp and Algol (the ancestor of C, Pascal, et al.).

(The fact that Scheme is well-designed is why it has been adopted by several groups as an alternative to kludgey languages like Tcl and Perl. The Free Software Foundation's Guile extension language is based on Scheme. So is the Scheme Shell (scsh), which is a scripting language for UNIX. The CAD Framework Initiative has adopted Scheme as the glue for controlling Computer-Aided Design tools. The Dylan language is also based on Scheme, though with a different syntax and many extensions.)

If you want to learn Lisp, Scheme is a good place to start. Common Lisp is a big, somewhat messy language, which is probably easiest to learn by starting with Scheme. Then you can understand Common Lisp as a series of extensions (and significant obfuscations) of Scheme. Some of the best features of Common Lisp were copied from Scheme.

If you want to get something of the flavor of functional programming, you can do that in Scheme--most well-written Scheme programs are largely functional, because that's simply the easiest way to do many interesting things.

And if you just want to learn to program better, Scheme may open your eyes to new ways of thinking about programs. Many people prototype programs in Scheme, because it's so easy, even if they eventually have to recode them in other languages to satisfy their employers.

Why Scheme Now?

Scheme is not a new language--it's been around and evolving slowly for 20 years.

The evolution of Scheme has been slow, because the people who standardize Scheme have been very conservative--features are only standardized when there is a near-universal consensus on how they should work. The focus has been on quality, not industrial usability. The opposite has been the case for a related language, namely CommonLisp.

This policy has had two consequences. The first is that Scheme is a beautiful, extremely well-designed language. The second is that Scheme has been "behind the curve," lacking several features that are useful in general-purpose languages. Gradually, though, Scheme has grown from a very small language, suitable only for teaching concepts, to a very useful language.

The most important new feature of Scheme (in our view) is lexically-scoped ("hygienic") macros, which allow the implementation of many language features in a portable and fairly efficient way. The macro feature allows Scheme to remain small, but also allows useful extensions to the base language to be written as libraries, without a significant performance penalty.


Go to the first, previous, next, last section, table of contents.