miriam_e: from my drawing MoonGirl (Default)
[personal profile] miriam_e
Fell down a deep rabbithole today. For far too long I have been on a quest to find (or create) the perfect text editor. Today I found out about TECO -- the ancestor to emacs. If you thought emacs is ugly (I do) then you will be appalled at the awful, powerful ugliness of TECO. It is fascinating.

This seems a bit random, right? Spending much of the day reading about a text editor whose heyday was way back when I was a kid in school? I came to that after musing about the command set for the line editor Microsoft made for the TRS-80 and CoCo computers (I know the CoCo is technically a TRS-80 computer, but that gets confusing). The clumsy line editor (for editing program lines) has a very sparse, but powerful command set of just 16 instructions:
nSpace Move forward n number of characters
nC Change n number of characters
nD Delete n number of characters
nSc Search for nth occurence of character c
nKc Kill (delete) to nth occurrence of character c
n ← Move cursor n characters to the left
I Insert text
H Hack off rest of line and go into insert mode
L List current line and continue editing
X eXtends line - go to end of line and enter insert mode
A Abort changes and continue editing
Shift ↑ escape subcommand (escape insert mode)
Q Quit without saving
Break Quit without saving
E End editing, save changes
Enter End editing, save changes

I wondered if there were any more, so I read the disassembly of the BASIC ROMs for the old TRS-80 and CoCo. No. That's the full command set for their line editor.

I became curious about where they got the idea for this line editor from. When I looked for earlier examples of use of these commands in a line editor, I found that Bill Gates, and Paul Allen also wrote the BASIC interpreter for the Altair 8080 -- the world's first personal computer -- and Gates recently released the source code. So I read through its code. No, that early version doesn't include a line editor, however it turns out that a later, extended version of the Altair's BASIC in 1977 did have an identical line editor (I don't have the code for it, but was able to download a manual for it).

Interestingly, he and Allen didn't have an Altair at the time they wrote that BASIC, but their school had timeshare access to a PDP-8, and Paul Allen had written an 8080 emulator for the PDP-8, so they wrote the BASIC interpreter on the PDP-8 using that emulator! I don't know what editor they used at the time, but it might have been TECO... and that's how I came to be doing that particular bit of computer archaeology.

Oh, and by the way, if you feel masochistic enough, you can download and compile TECO today.
https://github.com/blakemcbride/TECOC
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

miriam_e: from my drawing MoonGirl (Default)
miriam_e

April 2026

S M T W T F S
   1234
567891011
12131415161718
19202122232425
2627282930  

Style Credit

Expand Cut Tags

No cut tags
Page generated Sunday, 5 April 2026 10:49 pm
Powered by Dreamwidth Studios