Notices where this attachment appears
-
Embed this notice
@sj_zero @lanodan @kirby Well, an entire ed plus the vi commands, plus screen-handling routines. I think a few thousand is reasonable. nvi is 77k but they have, apparently, a Perl interface, Tcl/Tk bindings. Just the regex code is 3,778 lines.
sam is 7,294 lines, but it's cheating, kind of: Plan 9 has a regex library, standard UI library, etc., things like that. It's hard to get more compact than ken's code, so I'm pretty comfortable treating that figure as being near the lower limit for a full-featured editor. So, several thousand lines. Linus maintains a personal fork of uemacs, a small emacs (haven't used it but it's 19,538 lines.
If we include just the C code, vim 7.4 is 417k lines and vim 8.2 is 510k lines. GNU emacs is 359k if we just count the C code, or if we include all the .el files, a little over a million lines. Way at the other end, we have https://archive.vector.org.uk/art10501320 :
> It began badly. We were walking along the South Downs Way in early summer, the sun glittering on the English Channel on our right, the Weald of Sussex stretching away to our left. “How big,” asked Arthur, “should a text editor be?”
> I’ve known Whitney most of my life. I know what he does. I know his stupid questions. And still I can’t resist trying to give helpful answers. “I don’t know. One could find out, surely? What do Emacs and Vim weigh – tens of megabytes?”
> “I’ve got a text editor in four lines of K. Just need to add Copy and Paste.”