View previous topic :: View next topic |
Author |
Message |
Naib Watchman
Joined: 21 May 2004 Posts: 6070 Location: Removed by Neddy
|
Posted: Thu Aug 23, 2018 12:02 am Post subject: The history of vi |
|
|
As a user that constantly sticks with vim even though there are more "complete editors" for python, mathlab, vhdl for my day to day work... this is an interesting read on where it came from
https://thenewstack.io/a-look-at-vim-a-text-editor-for-the-ages/
Quote: | The pair eventually worked their way up from em to ex, which was included in the first release of BSD Unix in March of 1978. And it was in the second release of BSD Unix — in May of 1979 — that the program was finally installed under its now-familiar name vi — a name which indicated to users that it was ex launched in its visual mode.
...
“Fundamentally, vi is still ed inside,” Joy told Unix Review in 1994. “You can’t really fool it.”
...
|
_________________ #define HelloWorld int
#define Int main()
#define Return printf
#define Print return
#include <stdio>
HelloWorld Int {
Return("Hello, world!\n");
Print 0; |
|
Back to top |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6222 Location: Dallas area
|
Posted: Thu Aug 23, 2018 12:09 am Post subject: |
|
|
Quote: | Fundamentally, vi is still ed inside |
Yeah, but ed sucked to work with _________________ UM780, 6.12 zen kernel, gcc 13, openrc, wayland |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20589
|
Posted: Thu Aug 23, 2018 5:04 am Post subject: |
|
|
Saw that the other day. I liked this part: Quote: | which he’d named “em” — a shortened version of “ed for mortals.”
“I christened it that after Ken Thompson visited our lab at QMC while I was developing it and said something like: ‘yeah, I’ve seen editors like that, but I don’t feel a need for them, I don’t want to see the state of the file when I’m editing’.” |
Also:
An incomplete history of the
QED Text Editor
Dennis Ritchie
(Came across that at the same time, but didn't see the reference on the vi page.) _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
russK l33t
Joined: 27 Jun 2006 Posts: 665
|
Posted: Thu Aug 23, 2018 5:10 am Post subject: |
|
|
Anon-E-moose wrote: | Quote: | Fundamentally, vi is still ed inside |
Yeah, but ed sucked to work with |
Interesting that 24 years after that quote, on Gentoo there is no vi in portage, there is vim (vi improved), and it does not depend on ed. But if you want ed, ed is in portage.
The power of vim is pretty amazing, there are things it can do that "complete editors" cannot, for instance when you pipe buffers through other unix filters like awk. I don't know of many editors besides vim where you can swap arbitrary columns of a table with just a few keystrokes (except perhaps ed).
Cheers |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Thu Aug 23, 2018 7:11 am Post subject: |
|
|
russK wrote: | Interesting that 24 years after that quote, on Gentoo there is no vi in portage, there is vim (vi improved), and it does not depend on ed. But if you want ed, ed is in portage. |
russK ... actually, there are a bunch of them: app-editors/nvi, app-editors/vis, app-editors/elvis, app-editors/vile, app-editors/levee, etc. There is also 'vim -C', and everyone will have 'busybox vi'.
So many options in fact, we have app-eselect/eselect-vi for 'manag[ing] the /usr/bin/vi symlink'
best ... khay |
|
Back to top |
|
|
russK l33t
Joined: 27 Jun 2006 Posts: 665
|
Posted: Fri Aug 24, 2018 2:47 am Post subject: |
|
|
khay wrote: | russK ... actually, there are a bunch of them: app-editors/nvi, app-editors/vis, app-editors/elvis, app-editors/vile, app-editors/levee, etc. |
khay,
Thanks for pointing that out. So, there are many vi derivatives but none seems to depend on ed, which was really my point. For grins I emerge'd ed anyway, but I can't think of any use cases where I wouldn't just use vim. I do make use of ed commands inside vim plenty often, it's practically unavoidable.
Regards |
|
Back to top |
|
|
HungGarTiger Apprentice
Joined: 04 Feb 2014 Posts: 180 Location: /nz/auckland
|
Posted: Fri Aug 24, 2018 7:54 am Post subject: |
|
|
That's really interesting, thank Naib.
I wasn't around for a lot of the development of the applications we use today so I find it interesting learning about where they came from |
|
Back to top |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6222 Location: Dallas area
|
Posted: Fri Aug 24, 2018 9:40 am Post subject: |
|
|
russK wrote: | Thanks for pointing that out. So, there are many vi derivatives but none seems to depend on ed, which was really my point. |
The last time I saw ed really being used was years ago in the early days of the patch utility, pre-context diffs.
Some of the early unix systems, used vi and (I don't remember the keystroke) but if you accidently hit it you went to ed mode, and if you couldn't remember the exit keystroke for ed, you were stuck. *gaaaahhhh* ... well stuck until you exited the session. _________________ UM780, 6.12 zen kernel, gcc 13, openrc, wayland |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Fri Aug 24, 2018 11:43 am Post subject: |
|
|
khay wrote: | russK ... actually, there are a bunch of them: app-editors/nvi, app-editors/vis, app-editors/elvis, app-editors/vile, app-editors/levee, etc. |
russK wrote: | Thanks for pointing that out. So, there are many vi derivatives but none seems to depend on ed, which was really my point. For grins I emerge'd ed anyway, but I can't think of any use cases where I wouldn't just use vim. I do make use of ed commands inside vim plenty often, it's practically unavoidable. |
russK ... you're welcome. The relationship is not one of dependency, vi doesn't use ed (and so depend on it's existence), it is a continuation of "line editing", vi is the VISUAL ed[itor]. You'll find 'ed' like features in a variety of places, zsh has 'zed', vim 'ex', and 'sed' is a stream ed. So, editing commands such as '1s/foo/ba/' found in vi, sed, zed, etc, are derived from 'ed'. The relationship to sys-apps/ed is one of familial "line editor" features.
best ... khay |
|
Back to top |
|
|
steveL Watchman
Joined: 13 Sep 2006 Posts: 5153 Location: The Peanut Gallery
|
Posted: Fri Aug 24, 2018 1:17 pm Post subject: |
|
|
Anon-E-moose wrote: | The last time I saw ed really being used was years ago in the early days of the patch utility, pre-context diffs. :) | Tsk, y'all clearly have not spent enough time in #bash, never mind ##ed.
Khay covered most of what I was going to write, wrt the lineage from ed; though I'd just add the old chestnut, that grep derives from the ed sequence g/re/p.
ed is still bloody useful if you work in the terminal, or if you shell-script to any degree.
I'll just mention the main two items: negative-addressing, and robustness wrt data files. |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 23097
|
Posted: Sat Aug 25, 2018 12:23 am Post subject: |
|
|
ed could also be useful for embedded systems or as an emergency recovery tool. ed depends on libc and nothing else, so if your system is even vaguely functional, you can use ed. Compare that to all the more common text editors, which have notably more dependencies. For the console editors, you require a working ncurses and probably at least some terminfo. For the GUI ones (GVim, XEmacs, Kate, Gedit, etc.), there are yet more dependencies, so even more ways for a broken system to be unable to use them. |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Sat Aug 25, 2018 12:02 pm Post subject: |
|
|
Hu wrote: | ed could also be useful for embedded systems or as an emergency recovery tool. ed depends on libc and nothing else, so if your system is even vaguely functional, you can use ed. Compare that to all the more common text editors, which have notably more dependencies. For the console editors, you require a working ncurses and probably at least some terminfo. For the GUI ones (GVim, XEmacs, Kate, Gedit, etc.), there are yet more dependencies, so even more ways for a broken system to be unable to use them. |
Hu ... I would expect embedded, or a rescue boot, to have busybox[static] and have 'busybox vi' and/or 'busybox sed', and/or 'busybox ed', for such a purpose.
best ... khay |
|
Back to top |
|
|
josephg l33t
Joined: 10 Jan 2016 Posts: 783 Location: usually offline
|
Posted: Sat Aug 25, 2018 12:27 pm Post subject: |
|
|
yeah well remember when they used ed, they didn't have fancy gui full screen window editors like we do now :p at most they could work on one line at a time. and they could do magic with ed at that time. |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Sat Aug 25, 2018 12:44 pm Post subject: |
|
|
josephg wrote: | yeah well remember when they used ed, they didn't have fancy gui full screen window editors like we do now :p at most they could work on one line at a time. and they could do magic with ed at that time. |
josephg ... hmmm, "at most [...] one line at a time"?
Code: | % busybox ed .zshrc
".zshrc", 544 lines, 13861 chars
: 10,15p
NO_always_to_end \
append_history \
auto_cd \
auto_list \
auto_menu \
NO_auto_name_dirs \
: 10,15s/NO/no/
: 10,15p
no_always_to_end \
append_history \
auto_cd \
auto_list \
auto_menu \
no_auto_name_dirs \ |
best ... khay |
|
Back to top |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6222 Location: Dallas area
|
Posted: Sat Aug 25, 2018 12:48 pm Post subject: |
|
|
You have to remember most used something like a teletype at the time, not a monitor, so one line at a time was common.
Comparing now and then is like apples and oranges
_________________ UM780, 6.12 zen kernel, gcc 13, openrc, wayland |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Sat Aug 25, 2018 1:02 pm Post subject: |
|
|
Anon-E-moose wrote: | You have to remember most used something like a teletype at the time, not a monitor, so one line at a time was common. Comparing now and then is like apples and oranges. |
Anon-E-moose ... well, yes, but I only printed to show what the '10,15s/foo/ba/' multi-line edit did ... and those lines are effected regardless of the TTY. That was the point :)
best ... khay |
|
Back to top |
|
|
josephg l33t
Joined: 10 Jan 2016 Posts: 783 Location: usually offline
|
Posted: Sat Aug 25, 2018 1:52 pm Post subject: |
|
|
khayyam, i stand corrected i meant they could see one line at a time rather than process one line at a time. |
|
Back to top |
|
|
pun_guin Apprentice
Joined: 06 Feb 2018 Posts: 204
|
Posted: Sat Aug 25, 2018 3:07 pm Post subject: |
|
|
I use ed every week because I fail to understand why I would have to fire up a full-screen editor for basically performing a simple replace command. However, in that article Bill Joy was quoted like this:
Quote: | People don’t know that vi was written for a world that doesn’t exist anymore. |
And that is the major problem with most discussions like this: "Nerds", "professionals" and other "experts" continuously recommending things which are like that because of the limited hardware of their time, not because they were technically superior than modern alternatives. _________________ I already use the new Genthree. |
|
Back to top |
|
|
josephg l33t
Joined: 10 Jan 2016 Posts: 783 Location: usually offline
|
Posted: Sat Aug 25, 2018 3:39 pm Post subject: |
|
|
pun_guin wrote: | And that is the major problem with most discussions like this: "Nerds", "professionals" and other "experts" continuously recommending things which are like that because of the limited hardware of their time, not because they were technically superior than modern alternatives. |
i feel sad that we have reached such a stage where everything has to be restricted, dumbed down, and jazzed-up for the sake of "normal" users. _________________ "Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Sat Aug 25, 2018 3:49 pm Post subject: |
|
|
pun_guin wrote: | [...] in that article Bill Joy was quoted like this:
Quote: | People don’t know that vi was written for a world that doesn’t exist anymore. |
And that is the major problem with most discussions like this: "Nerds", "professionals" and other "experts" continuously recommending things which are like that because of the limited hardware of their time, not because they were technically superior than modern alternatives. |
pun_guin ... I would argue that available resources have nothing to do with it. That "world" was one of "computing" whereas, after the onslaught of Microsoft, Apple, etc, all that remains is an "appliance" (word processor, media player, game console, facebook/twitter activity notifier, etc). In its modern incarnation computer "use" can not be said to be "technically superior" because there is little techne (Gk., skill) involved.
best ... khay |
|
Back to top |
|
|
pun_guin Apprentice
Joined: 06 Feb 2018 Posts: 204
|
Posted: Sat Aug 25, 2018 4:38 pm Post subject: |
|
|
Of course the hardware at a given point of time has a major impact on the software written for it. Unix commands (Linux commands not so much) usually have two or three characters instead of four or more ("cp", "mv", "cat", ... "vi") because typing on teletypes hurt the fingers and the developers wanted to soften that. With better hardware there is not much reason to stick to solutions for problems which have become outdated. _________________ I already use the new Genthree. |
|
Back to top |
|
|
roki942 Apprentice
Joined: 18 Apr 2005 Posts: 285 Location: Seattle
|
Posted: Sat Aug 25, 2018 7:23 pm Post subject: |
|
|
pun_guin wrote: | Of course the hardware at a given point of time has a major impact on the software written for it. Unix commands (Linux commands not so much) usually have two or three characters instead of four or more ("cp", "mv", "cat", ... "vi") because typing on teletypes hurt the fingers and the developers wanted to soften that. With better hardware there is not much reason to stick to solutions for problems which have become outdated. |
I thought the subject of the thread is "The history of vi" not "use the original 70s software in 2018"
History that is educational to many will always be a trip down memory lane for those who lived it.
There's really not need to make it one of the 4 Olds. |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Sat Aug 25, 2018 7:51 pm Post subject: |
|
|
pun_guin wrote: | Of course the hardware at a given point of time has a major impact on the software written for it. Unix commands (Linux commands not so much) usually have two or three characters instead of four or more ("cp", "mv", "cat", ... "vi") because typing on teletypes hurt the fingers and the developers wanted to soften that. With better hardware there is not much reason to stick to solutions for problems which have become outdated. |
pun_guin ... what has this to do with the point I was making? ... and again, I disagree, "computing" is what it's all about, regardless of "hardware", those problems don't become "outdated".
best ... khay |
|
Back to top |
|
|
Akkara Bodhisattva
Joined: 28 Mar 2006 Posts: 6702 Location: &akkara
|
Posted: Sat Aug 25, 2018 10:04 pm Post subject: |
|
|
Interesting discussion, thanks for bringing it up.
Hu wrote: | For the console editors, you require a working ncurses and probably at least some terminfo. |
I've wondered how much of a role ncurses and terminfo serve these days. It always seems to be "xterm". Which seems to be a lot like "vt100". The gui-based terminal programs I used all emulate that one. Must have been a popular one back in the day. But maybe I'm seeing a biased landscape because most of what I deal with is Linux/Unix-based.
Are there any terminals in use these days (outside of a museum) that are not vt100-based? How big of a sin am I committing when I embed the escape-sequences directly inside a "printf" format string, without bothering to consult a database or link to a library?
josephg wrote: | khayyam, i stand corrected i meant they could see one line at a time rather than process one line at a time. |
Those were often paper-based teletypes. The previously-worked lines were all available for viewing simply by grabbing the paper and looking. Complete with 3-D zoom effects with fast frame-rates and immediate touch feedback which even today virtual-reality systems struggle to match.
pun_guin wrote: | With better hardware there is not much reason to stick to solutions for problems which have become outdated. |
Old decisions certainly should be revisited from time to time to accommodate changing circumstances. However, I would not be so quick to dismiss something simply because it is old. Those limitations back then were severe. But the people working on it were brilliant. The solutions found are were so good that they are still in use nearly 50 years later. Which says a lot.
That doesn't mean we shouldn't take advantage of modern hardware to make our lives easier. However, look at how long it takes for something like eclipse to start up. Or kdevelop for that matter. Then fight the UI lag. It is bad enough that I usually just fire up vi just so I can get started right away on whatever I'm doing. Hardware is tens even hundreds of thousands of times faster than what they had used back then. If just 1 out of every 2 orders-of-magnitude speed increases had gone toward improving programmer productivity (leaving the other 1 out of 2 to soak up bloat), we'd be 100 to 1000x more productive with these modern environments. Are we? _________________ Many think that Dilbert is a comic. Unfortunately it is a documentary. |
|
Back to top |
|
|
pun_guin Apprentice
Joined: 06 Feb 2018 Posts: 204
|
Posted: Sat Aug 25, 2018 10:54 pm Post subject: |
|
|
I'm not saying that efficiently written software should be replaced. By any means, we need more efficiency today, with text editors hogging 500 MiB of RAM while sitting on your desktop, doing nothing. I rather see the problem that people misunderstand "still in use" as "still the best solution". That's why I quoted Bill Joy initially. _________________ I already use the new Genthree. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|