
The Glorious Horror of TECO (2010) - okket
http://goodmath.scientopia.org/2010/11/30/the-glorious-horror-of-teco/
======
cpr
Though the author is confused about Emacs history, talking about Stallman's
and Gosling's Emacs as if they were the same thing.

IIRC (I was around the AI Lab a bit after the fact) Richard Gabriel and Guy
Steele (MIT AI Lab) wrote the original Emacs (editor macros) in TECO under
MIT's ITS, which was a huge superset of the original DEC TECO. RMS took it
over after a while, since RPG and GLS were mostly doing academic stuff. (Mike
McMahon (MMcM) and others ported the ITS version to TOPS-20.)

Meanwhile, Bernie Greenberg wrote an Emacs in Multics Lisp, which was a huge
influence on future Emacs implementations.

Eventually, RMS and others wrote the current Emacs.

Gosling's Emacs (nicknamed Gosmacs, written while he was at CMU, I believe)
was a C-based implementation for Unix, and a poor-man's subset of the real
thing.

~~~
hga
_Stallman 's and Gosling's Emacs as if they were the same thing_

They were, Gnu Emacs is a fork of what was then an old version of Gosling's
Emacs. This was something contemporaneously admitted to by RMS, claiming he
had an email authorizing it, but he, to my memory, never even produced a copy
of it.

To someone intimately familiar with Gosling Emacs, as I was at the time,
working for UniPress, this was totally obvious. Amusingly, this was perhaps
the one time I could have been an expert witness of sorts, but the two owners
of UniPress were menches and knew legal action was a bad idea (they'd had
their own horror story forming the company after the broke from [redacted
because I'm not 100% sure of my memory, but a name you'd recognize from that
era]'s company, which they won when the latter's lawyer was caught
burglarizing their office) and felt sales of their supported, on the then
zillions of available Unix platforms (their unique selling proposition) Emacs
would only be helped by RMS's version, at least for a good long while.

 _Eventually, RMS and others wrote the current Emacs._

See above, not at all. Substantially rewritten, but in the legal sense it's a
derivative work. And exhibit number 1 in the list of horrific examples of
RMS's stewardship of GNU/the FSF/etc., he took a chance that if it had gone
badly would have resulted in GNU being stillborn or nearly so, much like
happened to BSD.

The rest of your history is right (I have eyewitness testimony on the genesis
from one of the beta testers, Ed Schwalenberg), except for Gosling Emacs being
"a poor man's substitute", it was industrial strength, including not being an
ersatz Emacs.

That is, it had a "Mocklisp" byte code compiled extension language (where else
have we heard of this sort of thing from James Gosling? :-) in which a fair
amount of functionality was embedded, it just wasn't a real LISP (but of
course neither was TECO), and it diverged a fair amount in default keybindings
etc.

There were also some other EMACS versions written in this in-between period,
including SINE for the predecessor of the Media Lab's Multics like Magic OS,
EINE and I think ZWEI, the latter two the ones for the Lisp Machine.

~~~
cpr
I'm well aware of UniPress (didn't they start out selling Brian Reid's Scribe
commercially?) and Michael Shamus' rather jailhouse-lawyer-ish behavior.

But hearing that GNU Emacs started from Gosmacs is just hard to believe. If
you were there and say so, I'll have to believe. ;-) It was certainly nowhere
near as extensible as GNU Emacs, at least in my years of experience with it.

~~~
hga
I was so there that RMS and I were roommates when he started the GNU Project
^_^ (much early history omitted, we were in the same social circle...).

This of course came a bit later, I started working for a UniPress
subcontractor in December of 1984 on the MS-DOS port, and then a year later
directly for UniPress.

But I absolutely, positively guarantee you they shared a common code base,
something I confirmed for myself towards the end of or after more than a year
of becoming _intimately_ familiar with the UniPress Gosling Emacs C lower
level code base.

And it doesn't take _much_ effort with Google to find confirmation from RMS,
e.g. here's a 2013 Slashdot AMA
([https://features.slashdot.org/story/13/01/06/163248/richard-...](https://features.slashdot.org/story/13/01/06/163248/richard-
stallman-answers-your-questions)):

 _Favorite hack

by vlm

Give me your best hack....

RMS: I can't remember all the hacks that I was proud of, so I can't pick the
best. But here's something I remember fondly. The last piece of Gosmacs code
that I replaced was the serial terminal scrolling optimizer, a few pages of
Gosling's code which was proceeded by a comment with a skull and crossbones,
meaning that it was so hard to understand that it was poison. I had to replace
it, but worried that the job would be hard. I found a simpler algorithm and
got it to work in a few hours, producing code that was shorter, faster,
clearer, and more extensible. Then I made it use the terminal commands to
insert or delete multiple lines as a single operation, which made screen
updating far more efficient._

Note that he _might_ be overstating the significance of this, Gosling started
his Emacs in 1981 per Wikipedia at a time CMU's researchers were somehow happy
with running their fixed line terminals at the 1,200 baud default (they were
capable of more, this story told to me by Ted Anderson, who coincidentally was
the author of SINE, which Craig Finseth's list
[http://org.ntnu.no/emacs/implementations.html](http://org.ntnu.no/emacs/implementations.html)
says was actually SINE Is Not EINE and therefore "the first known doubly-
recursive acronym").

In general if you were using a standard terminal of the era, especially with a
modem, you were desperate for cleverness from your redisplay code, it was e.g.
a couple of years before the Ann Arbor Ambassador came out, and maybe longer
before its firmware was up to snuff, VT-100 like, and could run at a flat out
9600 baud with 60 lines of text thanks to a fast microprocessor. And that
_might_ be why the Gosling Emacs redisplay code didn't do those multi-line
operations, maybe they weren't possible on earlier terminals, or didn't buy
you enough.

Michael Shamus? That wasn't the famous figure UniPress broke away from. By the
time I showed up in late 1984/early 1985, their two big things were handling
the distribution and support of a Unix for Apple computers (Lisa? Mcintosh?
Can't remember), and having or having access to one of most every type of
popular Unix system available, so they could port the other software they were
distributing including Gosling Emacs, provide binaries, fix bugs and provide
real support, etc.

~~~
cpr
Great history!

Yes, sorry, Shamus was not associated with UniPress, but his own company
Unilogic, started to commercialize Scribe (Reid's CMU PhD project). My only
excuse is it's been a long time.

Ah, happy memories of terminal multi-line operation optimization in Twenex
Emacs. (We did a lot of that kind of hacking when I was at Columbia in the
very late 70's.)

------
RichardCA
It wasn't all that bad. If you were an average college student in the early
80's you had a time-sharing login to a PDP 11/70 running RSTS. TECO was there
but there was also VTEDIT which was a collection of TECO macros that sent the
correct escape sequences to the VT52 terminal to create a usable screen-
editing environment. And if you wanted to tweek the escape sequences to
customize your function keys that was do-able.

This scene from Wargames shows what an average college computer lab looked
like in the early 80's. The terminals were probably VT52's, VT100's, or
Teleray 10T's which were VT52-compatible.

[https://www.youtube.com/watch?v=n31fogbmQTg](https://www.youtube.com/watch?v=n31fogbmQTg)

------
todd8
Around 1975, I loved TECO and totally embraced it strange, compact set of
commands. I even expected my students (second semester CS majors) to develop a
reasonable level of skill with TECO as it was at the time, on our systems, the
most efficient way to write code. I programmed in it keeping my program in my
head as much as I could, because like ed you had to issue a command for it to
print out lines of the file you were working on. It's hard to imagine that it
was possible to write real programs like that.

Before TECO I was punching cards so it seemed like a big improvement. My use
of TECO didn't last long; there was a full screen editor of some kind that I
can't remember running on the KRONOS OS (CDC 6600 mainframe) that replaced
TECO and shortly after that I discovered Emacs. What strange and interesting
days those were to be programming.

------
korethr
And we'll wrap up the article with a BrainFuck interpreter, one that's more
compact than a BrainFuck interpreter written in BrainFuck. That truly _is_ a
glorious horror.

------
okket
The Wikipedia page is also a good first taste resource

[https://en.wikipedia.org/wiki/TECO_(text_editor)](https://en.wikipedia.org/wiki/TECO_\(text_editor\))

There is also source code on Github

[https://github.com/matthiasr/teco](https://github.com/matthiasr/teco)

------
hga
Ah, how could I forget my finding in my email archives and posting Marvin
Minsky's Universal Turing Machine in TECO at
[https://news.ycombinator.com/item?id=10161159](https://news.ycombinator.com/item?id=10161159),
"When I wrote the following Universal Turing Machine, which works, I actually
understood it." and some discussion:
[https://news.ycombinator.com/item?id=10987288](https://news.ycombinator.com/item?id=10987288)

------
gumby
Sad(!) to say I could still read that TECO example. The PDP-10 TECO in which
Emacs was written was amazingly powerful -- you could assemble machine code
into a string and then branch to it.

------
pmoriarty
TECO programming reminds me of ed[1] and also of the sorts of things I type in
to vim (or vi) in normal mode.

[1] -
[http://everything2.com/user/xerces/writeups/ed](http://everything2.com/user/xerces/writeups/ed)

~~~
Esau
I was recently playing with ed[1] and in some ways, it felt like a shell for
text files. In fact, I found myself wishing for Readline integration.

~~~
pmoriarty
Check out rlwrap:

[http://utopia.knoware.nl/~hlub/uck/rlwrap/](http://utopia.knoware.nl/~hlub/uck/rlwrap/)

------
beezle
Back in the day I recall using an editor called Foxe on a 2060. Was easier to
me than TECO for basic editing. But the really cool geeks had already begun
moving on to Emacs. This was a time when punch cards were still being used,
mostly by those on CDC stuff

------
dzdt
(2010) not that it matters much... TECO was long dead much earlier.

~~~
okket
Right, thanks for reminding.

