What are some good resources to learn more about the inner workings of text editors or building one from scratch? So far I've found and enjoyed reading/watching the resources below and would love to learn more.
One of the best docs describing how to write an editor I've ever read was the old documentation for the lcc-win32 compiler. It touches on the practical aspects of developing an editor (and the pipelining compiler as well.) Some understanding on how the Windows API works might be of value for the editor part, but the compiler part should be understandable to anyone:
(I won't go into jus how hard it was to find this version of the docs and extract the file on a non-Windows computer. Luckily I just did that a few months ago for unrelated reasons!)
>(I won't go into jus how hard it was to find this version of the docs and extract the file on a non-Windows computer. Luckily I just did that a few months ago for unrelated reasons!)
Thanks, this is fascinating! This is the sort of thing that makes me think Vernor Vinge wasn't so far off when he described the concept of programmer archaeologists.
BTW, can you upload the original doc file somewhere? Google Docs appears to be mangling the formatting in a few places (page 28, for example).
For archaeology's sake (and to contrast with X-Windows), here are a couple design [1] and protocol [2] documents RMS wrote about window system design, circa 1985, before X10R2 was released in 1986, but after all his work on the CADR Lisp Machine window system. (Not to be confused with Genera!!! [3])
> CADR Lisp Machine window system. (Not to be confused with Genera!!!
Early Genera was based on the Lisp Machine window system. Later Symbolics introduced a new window system (Dynamic Windows), but the old one (TV, ...) was still provided.
I hadn't heard of Vernon Vinge before, but the concept resonates. There's so much lore and knowledge to be found in old software packages. When I was learning how to program, I randomly found this pseudo-BASIC compiler called ASIC, which was amazing for what it could do. It provided low-level functionality that normal QBASIC wouldn't give you. I remember spending a whole summer playing with that and a free tutorial on 3D programming called "3DICA" written by some Finish students. Good times.
Well, if you like science fiction, you should read some of his works. He is a mathematician and computer scientist who has written some fascinating science fiction. "A Fire Upon the Deep" is probably his best and most famous work. Imagine that in different parts of the universe people can have different intellectual abilities because of different physical laws. And we are living in the slow zone.
Thanks for the book recommendation! I'll add it to my queue, for when I finish Abaddon's Gate (The Expanse, BTW, is a pretty solid sci-fi series, although I think I'm ready to take a little break after three books in a row.)
Should have saved your allowance and bought the QuickBASIC compiler! I did and when I discovered that the textfile-reading program I wrote to handle huge files (at the time) would buffer keystrokes, fill the buffer, and beep annoyingly if I held down the 'Down' arrow or 'Page Down' keys, I was led into learning x86 assembler. Well, enough that I could use BIOS routines for displaying text and scrolling the screen. Also got to learn what a 'linker' did and how QB did argument passing on the stack. I still wonder if I was the only person in the world linking my assembly code into a QB app I also wrote. But hey, it worked!
Haha, your story about hitting a wall with BASIC only to go somewhere else reminds me of how I decided to learn C: I had "mastered" QBASIC and was learning Visual Basic, so my dad bought me a book called "Hardcore Visual Basic". That book discussed extensively how to get Visual Basic to interact with the native Windows API for fun and profit. Pretty much every chapter began with "this is so much easier in C, but here's how we do it in VB", so wee me decided to hunt for a C compiler in the pile of Shareware CDs I had laying around. Finally found a really old version of Visual C++ (I think it was 2.1, so it was old even by the time) and then spend the next year of my life writing toolbar and common control libraries for lack of anything better to do :)
I've found that reading the source code (or at least the general structure) of kakoune[1] really helped me understand editors. I think it's a very high quality c++ codebase for a relatively complex editor.
James Gosling published "A Redisplay Algorithm" [1] in Proceedings of the 1981 ACM SIGPLAN SIGOA symposium on Text manipulation, describing the Emacs redisplay algorithm (the code with the skull and crossbones [2] that Stallman rewrote [3]).
I really enjoyed typing along with this 3-part series: https://www.youtube.com/watch?v=oDv6DfQxhtQ
Per writes the beginnings of an emacs-inspired Windows (directwrite) text editor.
I want to continue developing it, but have no idea what to do regarding design... I'm considering using Sublime's themes.
https://docs.google.com/document/d/1_S7gv6UGLAKuo9g1tNoNbU2O...
(I won't go into jus how hard it was to find this version of the docs and extract the file on a non-Windows computer. Luckily I just did that a few months ago for unrelated reasons!)