In association with heise online

05 April 2010, 09:18

Emacs & the birth of the GPL

by Richard Hillesley

"Don't get set into one form, adapt it and build your own, and let it grow, be like Emacs. Empty your mind, be formless, shapeless - like Emacs. If you put Emacs in a cup it becomes the cup, if you put into a bottle it becomes the bottle. You put Emacs into a teapot it becomes the teapot. Now, Emacs can flow or it can crash. Be Emacs, my friend" - a hacker koan found on the Emacs wiki

Emacs logo Emacs is not so much a text editor, more a way of life - an "extensible, customisable self-documenting real time display editor" with thousands of ready made extensions that take you way beyond its original remit as a text editor, some of which can be found at the Emacs wiki or on the Emacs Lisp list.

You can spend the whole of your keyboard life inside Emacs and many programmers do. You can read your mail, read the news, write and debug your code, send it out to the world, play a game or browse the web (less so now than once you could), and never leave the slightly alien (to those brought up on a click and point interface) and strangely comfortable world of Emacs.

For many the old aphorism that "Emacs is my operating system, and Linux its device driver" still holds true.

Extensibility is everything

Zoom Emacs opening display
Emacs has become emblematic of Lisp, Unix and free software, but was originally written by Richard Stallman, with contributions from Guy Steele, Dave Moon, Richard Greenblatt and Charles Frankston, as an extension to the TECO editor on MIT's AI Lab Incompatible Timesharing System (ITS) which ran on PDP-6 and PDP-10 machines, somewhere around 1974.

The extensibility which is everything to Emacs would seem to run counter to the file-based modular approach of Unix where every program has a unique task and every task has a unique program, and probably gave rise to the vi programmers' retort that "Emacs isn't a bad operating system. It just lacks a good text editor."

As Stallman tells it:

"The original Emacs did not have Lisp in it. The lower level language, the non-interpreted language — was PDP-10 Assembler. The interpreter we wrote in that actually wasn't written for Emacs, it was written for TECO. It was our text editor, and was an extremely ugly programming language, as ugly as could possibly be."

GNU Emacs was written in C, and the use of the Lisp interpreter that became Emacs Lisp evolved from Bernie Greenberg's use of Maclisp in Multics Emacs, and James Gosling's MockLisp extensions to Gosling Emacs.

Emacs was a breakthrough in the history of text editors and its novelty was that it gave the programmer the ability to add his or her extensions, macros, commands and instructions dynamically, transforming the text editor into an extremely flexible and expressive framework for programmers.

Extensibility lay at the heart of Emacs - and the idea that any programmer could take a macro created by another programmer and extend it to create new functionality lay at the heart of the philosophy of free software as it evolved during the following years.

The commands of Emacs are written in the same language as the programmer extensions, Emacs Lisp, and the code is viewable by the programmer, so a programmer can remodel the commands to suit his or her own needs, and Emacs can be remade on the fly.

Eyes on stalks

Stallman's original hack on TECO was to make the screen commands redefinable, and "People would pass them around and improve them, making them more powerful and more general. The collections of redefinitions gradually became system programs in their own right" until TECO became less an editor than "a programming language for writing editors."

Emacs became legendary among programmers because of its endless extensibility, easy reconfigurability and infinite adaptability, and was soon widely used among academic and software circles. A culture developed around Stallman's one condition for its use:

" - that they give back all extensions they made so as to help Emacs improve. I called this arrangement 'the Emacs commune. As I shared, it was their duty to share; to work with each other rather than against."

Within this model can be seen the germ of Stallman's later hack on copyright law, which became copyleft and the GPL, and the makings of the free software movement in the years to follow - since which time Emacs has evolved "tentacles, glow-in-the-dark eyes on stalks, tail fins, chrome bumpers, a full endocrine system, telepathy, altruism, feathers, webbed feet, radiation shielding, a nictitating membrane and valved nostrils."

Next: Koans, haikus and recursions

Print Version | Permalink:
  • Twitter
  • Facebook
  • submit to slashdot
  • StumbleUpon
  • submit to reddit

  • July's Community Calendar

The H Open

The H Security

The H Developer

The H Internet Toolkit