I remember being told back in the 1980s that vi would set the terminal to "cooked mode" when vi was in "insert mode", so as to reduce expensive context switching for each character typed. Only vi's "command mode" would set the terminal to "raw mode" so as to provide immediate feedback on each (command) character typed. This would be a clever system performance optimization, and would also explain designing vi around distinct insert and command modes. However, I can't find such evidence even as far back as BSD 1. It seems that in insert mode ESC was processed like any other character. https://github.com/dspinellis/unix-history-repo/blob/BSD-1-Snapshot-Development/ex-1.1/ex_vops.c#L507 Cooked mode was only entered when scrolling in order to receive interrupts. https://github.com/dspinellis/unix-history-repo/blob/BSD-1-Snapshot-Development/ex-1.1/ex_vadjust.c#L180 Also, for this scheme to work ESC would need to be mapped to an interrupt key, so as to allow exiting the cooked mode through the corresponding signal handler. Again, grepping for ESC, did not show me any such code. I also remember being told that this optimization was what allowed twenty students to concurrently perform interactive editing on a VAX 11/780 (running 4.2BSD and then 4.3BSD), and that Emacs was not provided to students because it was always operating in raw mode. Was I misled? Was there perhaps a hacked version of vi that worked in this way? -Diomidis
[-- Attachment #1: Type: text/plain, Size: 777 bytes --] On Thu, Nov 3, 2022 at 3:44 PM Diomidis Spinellis <dds@aueb.gr> wrote: > Was I misled? Was there perhaps a hacked version of vi that worked in this > way? > I think you may be mixing a few stories ... and features ... v6 vs v7 PDP-11 vs Vax much less vi vs emacs. Some thoughts ... 1.) Emacs came from CMU and only a few years later after the Vax had was stable (post 4.1BSD) 2.) emacs was not so much prohibited as it was slow, it needed megabytes of memory -- that was limit. 3.) By the time emacs comes on the scene, workstations are showing up, so you did not have 20 students on a vax to UCB. 4.) Raw mode was a V6 feature for PDP-11, by the time of the Vax the TTY was using V7 using CBREAK (1/2 cooked) which still allows canonicalization ᐧ [-- Attachment #2: Type: text/html, Size: 2326 bytes --]
[-- Attachment #1: Type: text/plain, Size: 952 bytes --] I should say -- UNIX (Gosling) EMACS came from CMU .... ᐧ On Thu, Nov 3, 2022 at 4:26 PM Clem Cole <clemc@ccc.com> wrote: > > > On Thu, Nov 3, 2022 at 3:44 PM Diomidis Spinellis <dds@aueb.gr> wrote: > >> Was I misled? Was there perhaps a hacked version of vi that worked in this >> way? >> > I think you may be mixing a few stories ... and features ... > > > v6 vs v7 PDP-11 vs Vax much less vi vs emacs. > Some thoughts ... > > 1.) Emacs came from CMU and only a few years later after the Vax had was > stable (post 4.1BSD) > 2.) emacs was not so much prohibited as it was slow, it needed megabytes > of memory -- that was limit. > 3.) By the time emacs comes on the scene, workstations are showing up, so > you did not have 20 students on a vax to UCB. > 4.) Raw mode was a V6 feature for PDP-11, by the time of the Vax the TTY > was using V7 using CBREAK (1/2 cooked) which still allows canonicalization > > ᐧ > [-- Attachment #2: Type: text/html, Size: 3140 bytes --]
[-- Attachment #1: Type: text/plain, Size: 1699 bytes --] On Thu, Nov 3, 2022, 2:28 PM Clem Cole <clemc@ccc.com> wrote: > > > On Thu, Nov 3, 2022 at 3:44 PM Diomidis Spinellis <dds@aueb.gr> wrote: > >> Was I misled? Was there perhaps a hacked version of vi that worked in this >> way? >> > I think you may be mixing a few stories ... and features ... > > > v6 vs v7 PDP-11 vs Vax much less vi vs emacs. > Some thoughts ... > > 1.) Emacs came from CMU and only a few years later after the Vax had was > stable (post 4.1BSD) > There were a diversity of emacs clones for unix as well... 2.) emacs was not so much prohibited as it was slow, it needed megabytes of > memory -- that was limit. > The VAX 11/750 with 1MB we had at nmt ran emacs, but not gnu emacs. It was something special off the internet that was less featureful so took less memory. We had to have it since EMACS was popular on the DECsystem 20s we had.. The Vax could handle 15 students on each of the 15 terminals connected to it plus 5 or so coming in via telnet doing emacs compilein 100-500 line CS programs without being too insanely bogged down... < 10 and you didn't notice. 3.) By the time emacs comes on the scene, workstations are showing up, so > you did not have 20 students on a vax to UCB. > Emacs of different flavors predated workstations by a few years though. GNU Emacs 18 dates to when VAXstations, Suns and others were shipping on volume. 4.) Raw mode was a V6 feature for PDP-11, by the time of the Vax the TTY > was using V7 using CBREAK (1/2 cooked) which still allows canonicalization > All the oddball quirks in tty behavior can be dated to the early 80s to optimize somebody's use case... Warner > ᐧ > [-- Attachment #2: Type: text/html, Size: 4647 bytes --]
[-- Attachment #1: Type: text/plain, Size: 1291 bytes --] On Thu, Nov 3, 2022 at 4:55 PM Warner Losh <imp@bsdimp.com> wrote: > > There were a diversity of emacs clones for unix as well... > Absolutely... But the first in wide used in the UNIX world was Gosling EMACS which appeared outside of CMU soon after UCB dropped 4.1 in early 1980, probably the next was Zimmerman (*a.k.a.* CCA) EMACS, then GNU hacked Gosling's version (that strange trip has been discussed elsewhere and I'll not add it here). Zimmer's version was 'truer' to the original MIT/PDP-10 version from ITS than Gosling but Steve had built it when he worked for CCA so it was licensed (which we had a Masscomp and made available to our customers). To my knowledge Gosling's version never fit on any PDP-11 nor Gnu, I'm not sure if Steve ever got his to work on a split I/D [Noel might know]. I do know some of my MIT friends used to grouse about the differences between CMU EMACS and ITS EMACS. That said, there was also at least one microemacs which was originally for CPM and MSDOS IIRC, that got moved a number of the UNIX boxes which may be what you are referring. I seem to remember that was released on netnews and was a lot smaller. I never messed with it, because by then I had the address space of and I could run Gosling or Zimmerman. ᐧ [-- Attachment #2: Type: text/html, Size: 2411 bytes --]
[-- Attachment #1: Type: text/plain, Size: 1777 bytes --] On Thu, Nov 3, 2022 at 3:35 PM Clem Cole <clemc@ccc.com> wrote: > > > On Thu, Nov 3, 2022 at 4:55 PM Warner Losh <imp@bsdimp.com> wrote: > >> >> There were a diversity of emacs clones for unix as well... >> > Absolutely... > > But the first in wide used in the UNIX world was Gosling EMACS which > appeared outside of CMU soon after UCB dropped 4.1 in early 1980, probably > the next was Zimmerman (*a.k.a.* CCA) EMACS, then GNU hacked Gosling's > version (that strange trip has been discussed elsewhere and I'll not add it > here). Zimmer's version was 'truer' to the original MIT/PDP-10 version > from ITS than Gosling but Steve had built it when he worked for CCA so it > was licensed (which we had a Masscomp and made available to our > customers). To my knowledge Gosling's version never fit on any PDP-11 nor > Gnu, I'm not sure if Steve ever got his to work on a split I/D [Noel might > know]. I do know some of my MIT friends used to grouse about the > differences between CMU EMACS and ITS EMACS. That said, there was also at > least one microemacs which was originally for CPM and MSDOS IIRC, that got > moved a number of the UNIX boxes which may be what you are referring. I > seem to remember that was released on netnews and was a lot smaller. I > never messed with it, because by then I had the address space of and I > could run Gosling or Zimmerman. > IIRC, it was one of the microemacs from netnews (there were a few different ones) that had been back-ported to BSD (or maybe the early ones just worked there). It was funky, but it worked with the HP terminals that were attached to the VAX and was somewhat less that the other, larger emacs in terms of what it could do beyond just editing. Warner > ᐧsadf > [-- Attachment #2: Type: text/html, Size: 3264 bytes --]
[-- Attachment #1: Type: text/plain, Size: 224 bytes --] We used Montgomery’s EMACS and then JOVE on the PDP-11 UNIXes. I did a short stint working at Unipress on Gosling’s Emacs while their lead developer was off on another project (I was between jobs at the time). [-- Attachment #2: Type: text/html, Size: 1429 bytes --]
Clem Cole wrote: > probably the next was Zimmerman (a.k.a. CCA) EMACS, then GNU hacked > Gosling's version (that strange trip has been discussed elsewhere and > I'll not add it here). Zimmer's version was 'truer' to the original > MIT/PDP-10 version from ITS than Gosling but Steve had built it when > he worked for CCA so it was licensed (which we had a Masscomp and made > available to our customers). I recently found a copy of CCA Emacs. It's from 1983 and does not yet have the Elisp extension language. CCA was bought by Rocket Software, so they own it now. I asked permission to put it online, but unfortunately they said no. Ron Natalie wrote: > We used Montgomery’s EMACS and then JOVE on the PDP-11 UNIXes. Montgomery kindly agreed to putting a copy of his editor here, and wrote about its history: https://github.com/larsbrinkhoff/emacs-history/tree/sources/ana-3.lcs.mit.edu/%7Ejnc/tech/unix/emacs https://github.com/larsbrinkhoff/emacs-history/blob/sources/docs/Montgomery%20Emacs%20History.txt
On Fri, Nov 4, 2022 at 2:43 AM Lars Brinkhoff <lars@nocrew.org> wrote:
> Clem Cole wrote:
> > probably the next was Zimmerman (a.k.a. CCA) EMACS, then GNU hacked
> > Gosling's version (that strange trip has been discussed elsewhere and
> > I'll not add it here). Zimmer's version was 'truer' to the original
> > MIT/PDP-10 version from ITS than Gosling but Steve had built it when
> > he worked for CCA so it was licensed (which we had a Masscomp and made
> > available to our customers).
>
> I recently found a copy of CCA Emacs. It's from 1983 and does not yet
> have the Elisp extension language. CCA was bought by Rocket Software,
> so they own it now. I asked permission to put it online, but
> unfortunately they said no.
Out of curiosity, did they say why? It's hard to imagine it holds much
commercial value now. Was it some kind of IP ownership thing?
- Dan C.
Dan Cross wrote:
>> CCA was bought by Rocket Software, so they own [CCA Emacs] now. I
>> asked permission to put it online, but unfortunately they said no.
> Out of curiosity, did they say why? It's hard to imagine it holds much
> commercial value now. Was it some kind of IP ownership thing?
I aked through an intermediary who had an inside connection at Rocket
Software, so I don't know why.
[-- Attachment #1: Type: text/plain, Size: 539 bytes --] > >v6 vs v7 PDP-11 vs Vax much less vi vs emacs. > Amusingly, as weith many of us, I got my start with "ed." I never actually learned vi. By the time I was ready to move up to screen editors, the emacs-ish things were available to me. I did a small stint using INed (Rand-editor variant) at one job. My employees always found it amusing that if I was stuck on a machine that didn't have some emacs-ish thing, I just used ed. They marvelled at my ability to complex substitutions with the s/// regular expressions. [-- Attachment #2: Type: text/html, Size: 2228 bytes --]
[-- Attachment #1: Type: text/plain, Size: 2948 bytes --] I don't think vi would work correctly in cooked mode. It has to redraw (some of) the screen, inserting a character on each keystroke, and repainting the rest of the line. As Clem points out, in V6 it used raw, in V7 it used cbreak, which is "half cooked" and allows interrupts. It certainly affected performance when lots of students were using it, especially if they all had their own copies of the binary, which was typical on non-BSD systems. What really helped there was ensuring that the official vi binary was in /usr/ucb (or another standard directory) so that only one copy of the instruction space would be in memory, shared among all the users. Bell Labs, which typically ran internal versions of UNIX that didn't have vi, created the exptools package with most of the Berkeley tools and certain others, such as Montgomery's EMACS. This was partly to address the performance issue, and to get people to stop installing their own personal copies of everything. Thanks, /Mary Ann Horton/ (she/her/ma'am) maryannhorton.com <https://maryannhorton.com> "This is a great book" - Monica Helms "Brave and Important" - Laura L. Engel Available on Amazon and bn.com! <https://www.amazon.com/Trailblazer-Lighting-Transgender-Equality-Corporate-ebook/dp/B0B8F2BR9B> On 11/3/22 12:43, Diomidis Spinellis wrote: > I remember being told back in the 1980s that vi would set the terminal > to "cooked mode" when vi was in "insert mode", so as to reduce > expensive context switching for each character typed. Only vi's > "command mode" would set the terminal to "raw mode" so as to provide > immediate feedback on each (command) character typed. This would be a > clever system performance optimization, and would also explain > designing vi around distinct insert and command modes. > > However, I can't find such evidence even as far back as BSD 1. It > seems that in insert mode ESC was processed like any other character. > > https://github.com/dspinellis/unix-history-repo/blob/BSD-1-Snapshot-Development/ex-1.1/ex_vops.c#L507 > > > Cooked mode was only entered when scrolling in order to receive > interrupts. > > https://github.com/dspinellis/unix-history-repo/blob/BSD-1-Snapshot-Development/ex-1.1/ex_vadjust.c#L180 > > > Also, for this scheme to work ESC would need to be mapped to an > interrupt key, so as to allow exiting the cooked mode through the > corresponding signal handler. Again, grepping for ESC, did not show > me any such code. > > I also remember being told that this optimization was what allowed > twenty students to concurrently perform interactive editing on a VAX > 11/780 (running 4.2BSD and then 4.3BSD), and that Emacs was not > provided to students because it was always operating in raw mode. > > Was I misled? Was there perhaps a hacked version of vi that worked in > this way? > > -Diomidis [-- Attachment #2: Type: text/html, Size: 4699 bytes --]
On Fri, Nov 04, 2022 at 06:33:34PM +0000, Ron Natalie wrote:
> >
> > v6 vs v7 PDP-11 vs Vax much less vi vs emacs.
>
> Amusingly, as weith many of us, I got my start with "ed." I never actually
> learned vi. By the time I was ready to move up to screen editors, the
> emacs-ish things were available to me.
Yeah, same here, although my start was with the editor that came with
the PDP-8 disk operating system (using an ASR-35), the PDP-15's
foreground/background system (using a KSR-33), and the PDP-11's RT-11
running under TSX-plus (using VT-100's and DECwriter for the
console).
So when I finally got a chance to use Unix when I got to college,
/bin/ed was so similar to the line oriented editors I had used on the
various Digital systems I had a chance to use while growing up and in
high school, I never bothered to use vi. It was either ed or emacs,
depending on how loaded the time-sharing systems I was using my
freshman year. Of course, once I had a chance to use a Vaxstation or
the IBM PC/RT all to myself, I jumped over to emacs and never looked
back --- except when I was recovering a system in single user mode, of
course.
- Ted
On Fri, 4 Nov 2022, Theodore Ts'o wrote: > Yeah, same here, although my start was with the editor that came with > the PDP-8 disk operating system (using an ASR-35), the PDP-15's > foreground/background system (using a KSR-33), and the PDP-11's RT-11 > running under TSX-plus (using VT-100's and DECwriter for the console). I started off with TECO on RT-11; talk about cryptic... > So when I finally got a chance to use Unix when I got to college, > /bin/ed was so similar to the line oriented editors I had used on the > various Digital systems I had a chance to use while growing up and in > high school, I never bothered to use vi. It was either ed or emacs, > depending on how loaded the time-sharing systems I was using in my > freshman year. Shortly after I switched to "ed" on the 11/40 someone brought out "em" (editor for mortals) which was sort of a screen editor: I recall saying "what a stupid command name" as it was only a fumble away from "rm" :-( > Of course, once I had a chance to use a Vaxstation or the IBM PC/RT all > to myself, I jumped over to emacs and never looked back --- except when > I was recovering a system in single user mode, of course. A boss of mine insisted that everyone had to learned "ed", because after a system crash it might be the only editor available; that, or having to dial in over a slow modem. -- Dave
On Sat, Nov 05, 2022 at 11:45:26AM +1100, Dave Horsfall wrote:
> A boss of mine insisted that everyone had to learned "ed", because after a
> system crash it might be the only editor available; that, or having to
> dial in over a slow modem.
Same. Though vi in ex mode was also good.
I also got a little corrupted by whatever editor came with BDS C, my
.exrc looks like this:
map # :.,$
map @ :1,.
Those came from that editor, # says do whatever to the end of the file,
@ says do whatever from the top of the file to here.
map , !}fmt
This came from Udi Manber, , runs your paragraph through fmt
map! \x01 \x14
I set shiftwidth to 4 spaces because when you have code like
if ((this big thing == that big thing) && (this other big thing) &&
(yet another big thing)) {
I use 4 spaces for what I call the continuation line. I used ^A to write
that example, why I don't like ^T is lost to me.
And yeah, I paren stuff that doesn't need to have parens, it just makes
the code more obvious.
set redraw ai aw terse
redraw I think is left over from modems, autoident because duh,
autowrite because who doesn't hack, hack, hack, ^Z, !cc? terse
because I'm not a newbie.
set sections=uhshSHNH
set paragraphs=PSPETSTEFSFEKSKECSCERSREDSDEIPNPLPPPTLABAIAELIB1B2HH
Troff.
set ts=8 sw=4
set shell=/bin/sh
set showmode
set textwidth=1000
set vb
Etc.
I've been carrying around that .exrc for around 40 years. Sheesh, I'm old.
On Nov 4, 2022, at 6:02 PM, Larry McVoy <lm@mcvoy.com> wrote:
>
> I also got a little corrupted by whatever editor came with BDS C
I think that was wordstar. I had to retrain my fingers when I
switched to vi! I used SOS, edt(?) on Tops-10, edit(?) on CMS,
teco (on ITS), wordstar (on CP/M), ed, vi, rand editor, acme.
Now I stick to nvi & acme. And cat for small programs/files.
On Fri, Nov 04, 2022 at 06:25:03PM -0700, Bakul Shah wrote: > On Nov 4, 2022, at 6:02 PM, Larry McVoy <lm@mcvoy.com> wrote: > > > > I also got a little corrupted by whatever editor came with BDS C > > I think that was wordstar. I had to retrain my fingers when I > switched to vi! I used SOS, edt(?) on Tops-10, edit(?) on CMS, > teco (on ITS), wordstar (on CP/M), ed, vi, rand editor, acme. > Now I stick to nvi & acme. And cat for small programs/files. I used wordstar but I think BDS C had their own thing. Wordstar was different. -- --- Larry McVoy Retired to fishing http://www.mcvoy.com/lm/boat
[-- Attachment #1: Type: text/plain, Size: 937 bytes --] I don't recall BDS C having an editor but I could be wrong. They pushed Mark of the Unicorn's MINCE (mince is not complete emacs) and scribble, a scribe mini-clone. BDS was a one man shop, it stood for brain-damaged software. On Fri, Nov 4, 2022, 9:40 PM Larry McVoy <lm@mcvoy.com> wrote: > On Fri, Nov 04, 2022 at 06:25:03PM -0700, Bakul Shah wrote: > > On Nov 4, 2022, at 6:02 PM, Larry McVoy <lm@mcvoy.com> wrote: > > > > > > I also got a little corrupted by whatever editor came with BDS C > > > > I think that was wordstar. I had to retrain my fingers when I > > switched to vi! I used SOS, edt(?) on Tops-10, edit(?) on CMS, > > teco (on ITS), wordstar (on CP/M), ed, vi, rand editor, acme. > > Now I stick to nvi & acme. And cat for small programs/files. > > I used wordstar but I think BDS C had their own thing. Wordstar > was different. > -- > --- > Larry McVoy Retired to fishing > http://www.mcvoy.com/lm/boat > [-- Attachment #2: Type: text/html, Size: 1475 bytes --]
Wordstar came out in 1978, BDS C in 1979. MINCE was written in BDS C
so it probably didn't come with BDS C (but BDS C came with MINCE)!
In 1981/82 I ported Gosling Emacs to the Fortune box. It was slow
as molasses. My memory is that was due to it using bitfields, for
which our C compiler produced pretty bad code. But I didn't really
investigate it in any detail. In contrast vi & e (Rand editor as
further hacked on by Dave Yost) were so much better, especially on
a 60 line Ann Arbor Ambassador.
> On Nov 4, 2022, at 7:31 PM, Rich Salz <rich.salz@gmail.com> wrote:
>
> I don't recall BDS C having an editor but I could be wrong. They pushed Mark of the Unicorn's MINCE (mince is not complete emacs) and scribble, a scribe mini-clone. BDS was a one man shop, it stood for brain-damaged software.
>
> On Fri, Nov 4, 2022, 9:40 PM Larry McVoy <lm@mcvoy.com> wrote:
> On Fri, Nov 04, 2022 at 06:25:03PM -0700, Bakul Shah wrote:
> > On Nov 4, 2022, at 6:02 PM, Larry McVoy <lm@mcvoy.com> wrote:
> > >
> > > I also got a little corrupted by whatever editor came with BDS C
> >
> > I think that was wordstar. I had to retrain my fingers when I
> > switched to vi! I used SOS, edt(?) on Tops-10, edit(?) on CMS,
> > teco (on ITS), wordstar (on CP/M), ed, vi, rand editor, acme.
> > Now I stick to nvi & acme. And cat for small programs/files.
>
> I used wordstar but I think BDS C had their own thing. Wordstar
> was different.
> --
> ---
> Larry McVoy Retired to fishing http://www.mcvoy.com/lm/boat
On Fri, Nov 04, 2022 at 06:02:47PM -0700, Larry McVoy wrote: > On Sat, Nov 05, 2022 at 11:45:26AM +1100, Dave Horsfall wrote: > > A boss of mine insisted that everyone had to learned "ed", because after a > > system crash it might be the only editor available; that, or having to > > dial in over a slow modem. > > Same. Though vi in ex mode was also good. Yep, the computer lab I had to use had 30 or so terminals connected to a VAX 11/750 running BSD. To get work done it was often neccesary to switch to ex mode in vi. Later I was a teacher's assistent with night access to the lab and I could use it on my own or with only a few fellow TA's. -Otto > > I also got a little corrupted by whatever editor came with BDS C, my > .exrc looks like this: > > > map # :.,$ > map @ :1,. > > Those came from that editor, # says do whatever to the end of the file, > @ says do whatever from the top of the file to here. > > map , !}fmt > > This came from Udi Manber, , runs your paragraph through fmt > > map! \x01 \x14 > > I set shiftwidth to 4 spaces because when you have code like > > if ((this big thing == that big thing) && (this other big thing) && > (yet another big thing)) { > > I use 4 spaces for what I call the continuation line. I used ^A to write > that example, why I don't like ^T is lost to me. > > And yeah, I paren stuff that doesn't need to have parens, it just makes > the code more obvious. > > set redraw ai aw terse > > redraw I think is left over from modems, autoident because duh, > autowrite because who doesn't hack, hack, hack, ^Z, !cc? terse > because I'm not a newbie. > > set sections=uhshSHNH > set paragraphs=PSPETSTEFSFEKSKECSCERSREDSDEIPNPLPPPTLABAIAELIB1B2HH > > Troff. > > set ts=8 sw=4 > set shell=/bin/sh > set showmode > set textwidth=1000 > set vb > > Etc. > > I've been carrying around that .exrc for around 40 years. Sheesh, I'm old.
On Fri, Nov 04, 2022 at 06:40:29PM -0700, Larry McVoy wrote:
> On Fri, Nov 04, 2022 at 06:25:03PM -0700, Bakul Shah wrote:
> > On Nov 4, 2022, at 6:02 PM, Larry McVoy <lm@mcvoy.com> wrote:
> > >
> > > I also got a little corrupted by whatever editor came with BDS C
> >
> > I think that was wordstar. I had to retrain my fingers when I
> > switched to vi! I used SOS, edt(?) on Tops-10, edit(?) on CMS,
> > teco (on ITS), wordstar (on CP/M), ed, vi, rand editor, acme.
> > Now I stick to nvi & acme. And cat for small programs/files.
>
> I used wordstar but I think BDS C had their own thing. Wordstar
> was different.
There was also Turbo Pascal, which also had a very Wordstar-like
editor.
- Ted