Next: , Previous: , Up: Introduction   [Contents][Index]


16.3.2 New Techniques

Lisp gives you tools that other languages don’t provide. Taken separately, the new things that come with Lisp—automatic memory management, manifest typing, closures, and so on—each make programming that much easier. Taken together, they form a critical mass that makes possible a new way of programming.

Extensible Software

Lisp is designed to be extensible: it lets you define new operators yourself. This is possible because the Lisp language is made out of the same functions and macros as your own programs. So it’s no more difficult to extend Lisp than to write a program in it. In fact, is so easy (and so useful) that extending the language is standard practice.

Bottom-up Programming

As you are writing your program down toward the language, you build the language up toward your program. You work bottom-up, as well as top-down.

Almost any program can benefit from having the language tailored to suit its needs, but the more complex the program, the more valuable bottom-up programming becomes.

A bottom-up program can be written as a series of layers, each one acting as a sort of programming language for the one above. TeX was one of the earliest programs to be written this way. You can write programs bottom-up in any language, but Lisp is far the most natural vehicle for this style.

Bottom-up programming leads naturally to extensible software. If you take the principle of bottom-up programming all the way to the topmost layer of your program, then that layer becomes a programming language for the user. Because the idea of extensibility is so deeply-rooted in Lisp, it makes the ideal language of writing extensible software. Three of the most successful programs of the 1980s provide Lisp as an extension language: Gnu Emacs, Autocad, and Interleaf.

Reusable Software

Working bottom-up is also the best way to get reusable software.

,*The essence of writing reusable software is to separate the general from the specific, and bottom-up programming inherently creates such a separation.*

Instead of devoting all your effort to writing a single, monolithic application, you devote part of your effort to building a language, and part to writing a (proportionately smaller) application on top of it. What is specific to this application will be concentrated in the topmost layer. The layers beneath will from a language for writing applications like this one—and what could be more reusable than a programming language?

Big Abstractions and a Dynamic Interactive Environment

Lisp allows you not just to write more sophisticated programs, but to write themn faster. Lisp programs tend to be short—the language gives you bigger concepts, so you don’t have to use as many. The time it takes to write a program depends mostly on its length. So this fact alone means that Lisp programs take less time to write.

The effect is amplified by Lisp’s dynamic character: in Lisp the edit-compile-test cycle is so short that programming is real-time.

Bigger abstractions and an interactive environment can change the way organizations develop software. The phrase rapid prototyping describes a kind of programming that began with Lisp: in Lisp, you can often write a prototype in less time that it would take to write the spec for one. Such a prototype can be so abstract that it makes a better spec than one written in English. Lisp allows you to make a smooth transition from prototype to production software. When Copmmon Lisp programs are written with an eye to speed and compiled by modern compilers, they run as fast as programs in any other high-level language.


Next: A New Approach, Previous: New Tools, Up: Introduction   [Contents][Index]