5 ms·
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
by bonquesha99 10y ago
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.
* The Craft of Text Editing: https://www.finseth.com/craft/ https://www.finseth.com/craft/
* Writing a Text Editor From Scratch: https://www.twitch.tv/gary_bernhardt/v/90796516 https://www.twitch.tv/gary_bernhardt/v/90796516
* A Modern Text Editor Built in Rust: https://www.youtube.com/watch?v=SKtQgFBRUvQ https://www.youtube.com/watch?v=SKtQgFBRUvQ
- omtose 10y agoI'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. [1] https://github.com/mawww/kakoune https://github.com/mawww/kakoune
- dguaraglia 10y agoOne 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: https://docs.google.com/document/d/1_S7gv6UGLAKuo9g1tNoNbU2OR_5DBYEdquvYeqgkPMk/edit?usp=sharing 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!)
- voltagex_ 10y ago>(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!) Sounds like a good topic for a small blog post.
- Lx1oG-AWb6h_ZG0 10y agoThanks, 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).
- dguaraglia 10y agoHey, absolutely. Here they are, zipped with the original installer: https://drive.google.com/file/d/0BxF_x9mBC-n1eEduWVRmV3ZJTUU/view?usp=sharing https://drive.google.com/file/d/0BxF_x9mBC-n1eEduWVRmV3ZJTUU... 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. BTW, http://www.textfiles.com http://www.textfiles.com is a great place to start looking for oldies but goodie :)
- otakucode 10y agoShould 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!
- dguaraglia 10y agoHaha, 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 :)
- bluefox 10y agoMultics Emacs: The History, Design and Implementation: http://multicians.org/mepap.html http://multicians.org/mepap.html
- swah 10y agoI really enjoyed typing along with this 3-part series: https://www.youtube.com/watch?v=oDv6DfQxhtQ 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. Another interesting tutorial: http://www.catch22.net/tuts/neatpad http://www.catch22.net/tuts/neatpad
- bootload 10y ago"good resources" always been partial to "A Tale Of Five Editors" ~ http://www.catb.org/esr/writings/taoup/html/ch13s02.html http://www.catb.org/esr/writings/taoup/html/ch13s02.html
- DonHopkins 10y agoJames 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]). [1] http://dl.acm.org/citation.cfm?id=806463 http://dl.acm.org/citation.cfm?id=806463 [2] http://donhopkins.com/home/archive/emacs/skull-and-crossbones.txt http://donhopkins.com/home/archive/emacs/skull-and-crossbone... [3] https://news.ycombinator.com/item?id=3427495 https://news.ycombinator.com/item?id=3427495