The first editor I learned how to use was TECO on a line printer. You’d print the line of code you were on, then you’d issue commands to move the cursor around. You tried to avoid printing the line because that would be wasting paper. So you’d move the cursor around blind until you thought you got it to where you wanted, and then you’d start inserting characters. When you thought you had it, you’d print out the edited line.
Another undergrad saw me struggling with this and asked why I
wasn’t using vi
. I had never heard of vi
and I was amazed that you could view the code on the screen and move
your cursor around visually before going into insert mode and adding
text. With vi
I was orders of magnitude more
productive than with TECO.
When I came to the ’tute in the early 80s, I found that computer accounts were only routinely issued to students taking computer science courses. I hadn’t decided on a computer science major, so I didn’t have an account. However the Student Information Processing Board would give out a Multics account to interested students, so I signed up for that. The Multics terminal was in the basement and it had a dial up connection with an acoustically coupled modem: two rubber cups that the handset would cradle in.
Everyone at the AI Lab used a home grown editor called emacs, and
there was a Multics port. I abandoned vi
and learned
emacs. The paradigm was different, but I didn’t see one as superior
to the other. When I declared computer science as my major, I got
an account at the AI Lab on the Decsystem 20 machine. The editor
was TECO with the editor macros (emacs) package loaded.
When I took S&ICP, we had a lab with HP9836 “Chipmunks” running MIT Scheme. The Chipmunks were PCs, not time-shared, and each acted as its own Scheme machine, complete with an emacs clone for editing the code.
At the AI Lab, there were a couple of machines running ITS, the Incompatible Timesharing System. You could run Maclisp on them, but Maclisp was such a pig, using over a megabyte of RAM, that a couple of instances of Maclisp would bring the machine to its knees. The Lab had developed the Lisp Machine, a single user computer that would run ZetaLisp (the successor to Maclisp). In addition to Lisp, the Lisp machine ran the ZWEI editor. Zwei Was Eine Initially, and Eine Is Not Emacs, but rather an emacs clone written in Zetalisp.
ZWEI was integrated with the Lisp environment. You could insert Lisp objects in the ZWEI editor and their printed representation would appear in the edited text. The printed represention was mouse sensitive and had its own context menu.
If you weren’t using a Lisp Machine, your options were Unipress Emacs and Gosling Emacs which you could run on this new OS called “Unix”
Around this time (in the late 80s) a hacker named Stallman decided to write a new OS. His first task was to write an editor and he decided on a new version of Emacs written in its own Lisp dialect.
If you wanted to use Lisp, you interacted with it via Emacs.
These days, I use GNU Emacs and I load up the sly package. Sly is a slime fork and it turns GNU Emacs into an IDE for a Lisp running in another process. The interface gives you much of what you used to get when using ZWEI on the Lisp machine. You can evaluate subexpressions, macroexpand and compile programs, gather output, and run the Lisp debugger from within GNU emacs.
Emacs and Lisp co-evolved at MIT and Emacs has always been used as
a front-end to Lisp. I’ve never gone back to vi
, and
when I’ve had to use it I’ve found it frustrating (but this is
because I have forgotten everything about how to use it).
I understand that some people find Emacs impossible to use and have
a strong preference for vi
. Is the experience of
hacking Lisp in vi
any good?
4 comments:
My first exposure to Lisp was in an undergrad Languages course (Lisp, SNOBOL, COBOL) in '74 at UT Austin. Undergrads pretty much used the CDC 6x00 computers at the Comp Center using punch cards & teletypes. It doesn't get more painful than that. As an AI grad student, I got to use the DEC-10 & (memory is fuzzy here) SOS. But by the early '80s it was Gosling & Unipress Emacs on VAXen, and ZWEI on Symbolics and (later) TI Explorers (Zmacs). By the late '80s I had moved on to GNU Emacs on Sun & SGI workstations.
Never used vi for Lisp coding, although once - ages ago - I did bring up some Lisp code in gvim just to see what it looked like, but not to work on.
I am curious why you've chosen Sly over Slime.
No good reason. I was curious and decided to try it. I've got a penchant for new, improved, alternative, and non-standard things. As far as I know Sly and Slime are more or less equivalent.
I just predated you at MIT: I was a TA for two semesters of the SICP course, and we were running Scheme (as a Maclisp program) on one of those Decsystem 20s. That was my introduction to Lisp, busily learning a week ahead of the students in that first semester.
My undergraduate institution used a line editor on a CDC 6600, and I wrote one as a project at one point. Emacs was the first screen editor I ever saw. I was introduced to it as the defined way to run the Scheme stuff, and I've used it ever since. I did learn enough vi to get around, because I also play with operating systems.
My graduate program used Lisp machines to simulate its proposed supercomputer architecture, and that led me to a job at TI working on Explorers till the bitter end, then other simulators in Lisp. Eventually I landed in fields that forced me out of Lisp in general, but I still use it for scripts (scheme->c, scsh, clisp) though python is often easier to productise.
Side trip: I also use emacs for email. Started with Babyl mode in Teco emacs at MIT, then Lisp machine mail readers (I kept an Explorer alive just for that), then VM, now mu4e.
Post a Comment