In ye olden days at the MIT Artificial Intelligence laboratory,
there was a text editor known as TECO. This text editor was one of
the new-fangled visual editors, a concept that can be
difficult to understand for many people, as the idea of a non-visual
editor is rather alien to most users of modern computational
machinery. In all simplicity, a visual editor is one that displays
the text being edited - compare to older line, or stream, based
editors (DOS/Windows users can type EDLIN at a command
prompt to relive the joy, while those of you that have seen the
light can use ed or ex). Naturally, TECO's obvious
superiority compared to the other text editors of the day resulted
in it being massively popular among the hackers at MIT. These
hackers, all being highly skilled programmers, engaged in the now
cherished tradition of heavily customizing ones tools. This resulted
in multiple incompatible macro packages for TECO that all added some
new functionality to the editor, but unfortunately, these macro
packages were rarely compatible with one another. Two MIT hackers,
Richard Stallman and Guy Steele, decided to solve this problem by
creating a super-package of all the functionality provided by the
various macro packages - and thus was the original EMACS
born. This is why Emacs is an acronym for Editor MACroS. Eventually,
implementations of the Emacs principles and features appeared on
other systems, for example in Multics Emacs (one of the first
emacsen to use a Lisp dialect - MacLisp, to be precise) and Gosling
Emacs, the first Emacs to run on Unix. In the eighties, Richard
Stallman also started working on GNU Emacs, which was forked to
produce XEmacs and so forth, but this part of the Emacs tale is
boring - everybody already knows it. So instead, I'll go back to
1976 and talk about EINE, the original Emacs for the MIT Lisp
Machine, and possibly the first Emacs to be heavily integrated with
its run-time environment. EINE eventually begat ZWEI ("ZWEI Was Eine
Initially"), the second editor for the Lisp Machine, and when the
commercialization of the machines started, ZWEI was used as the
editor component to build the final version of Emacs for the Lisp
Machines, Zmacs (which was,
apparently, really
cool). The use of Lisp for the implementation of the editor gave
the MIT hackers incredible flexibility and power compared to the
previous TECO and assembly-based implementations, and started the
now de-facto tradition of using Lisp to write and extend emacsen.
I find it pretty interesting to look into the history and philosophy
that was behind these early Emacsen - and sometimes I am saddened
that they died out while GNU Emacs became a success, because they
had some good ideas here and there. Fortunately, it is actually
possible to get hold of
the source
code for the MIT CADR Lisp Machine! In
the extract/nzwei is what I assume to be the actual ZWEI
editor. The code is written in an old dialect of Lisp (MacLisp I
think), but it's still not hard to read if you know Common Lisp, and
it's pretty interesting to see the techniques they used back
then. My favorite pieces of code is the various editor commands, and
it's especially interesting to compare them to how they are
implemented in other, more modern emacsen.
This is a blog, therefore, I must post something narcissistic in
every entry. I am going to write a bit about how the Lisp Machine
Emacs tradition is being carried (or dragged) on by modern hackers,
an effort I am somehow associated with. After
the demise of the
Lisp Machines, emacsen fully written in Lisp started to die out
- the editors of the commercial Common Lisp implementations
and Hemlock were
all that was left. People switched to GNU Emacs or XEmacs, editors
that were often "good enough", yet lacked some of the flexibility,
elegance and features of, say, Zmacs. Years later, however
the McCLIM
developers read
the holy
scripture and it was revealed to them that McCLIM was required
to implement an Emacs-style text
editor. Tim Moore,
one of the faithful, implemented what is known as Goatee ("Goatee
Owes All To Emacs, Evidently"), an Emacs-style text editor component
that was used to implement input-editing and text editor fields for
McCLIM. However, not all was well - while Goatee did what it was
designed for, it did not do much else than this - it was not suited
for use as a complete editor, it did not have tight integration with
the underlying Lisp system, it provided little in the way of
powerful editing tools, its internals were not quite as powerful as
they could be, and it did not do syntax-highlighting or many of the
other features that are taken for granted these
days. Thus, Climacs was
created - originally as a project meant to replace the internals of
Goatee and Hemlock with more modern code, eventually as a complete
implementation of an Emacs-style text editor. And I hope we'll soon
come full circle - I'm currently working on (and succeeding at)
getting a Climacs-based editing component (named "Drei" in the Lisp
Machine tradition) to replace Goatee for all purposes in
McCLIM. Once this is done, all McCLIM-based applications will be
able to transparently leverage an extremely powerful text editor for
all their editing needs, and the user will be able to easily define
new editing commands that can be used in all CLIM applications. It's
the logical inverse of the GNU Emacs philosophy - instead of putting
everything in Emacs, we're putting Emacs in everything. Hopefully,
it'll work.