💾 Archived View for freeshell.de › gemlog › 2021-10-27.gmi captured on 2022-06-11 at 21:16:28. Gemini links have been rewritten to link to archived content
View Raw
More Information
⬅️ Previous capture (2021-11-30)
-=-=-=-=-=-=-
Recursive minimalism ✍️
I read somewhere (gopher?) about ed, the line-oriented text editor. I'd never used it, but I did use edlin which was in the same vein. So I thought: learn a minimalist tool by using it to write a clone of itself. I'm not sure this is a sensible use of my time, but I enjoyed it.
Did I learn anything?
- Using a line-oriented editor made me think a lot more about the mechanics of editing. I normally use a GUI editor where it's easy to jump around and make related changes. In ed I had to stop and think about how to make the changes, and not just about what needed changing. It was slow.
- Parsing the input was the hard part. The input for ed seems simple, but there's an awful lot of variations and edge cases. I never learned how to do parsers/lexers, so I assume that I made a naive attempt at something I don't really understand. I considered a metric tonne of unit tests, but meh, I'm doing this for amusement only.
- Having got some things working, I felt the weight of the 80/20 rule. I've had some fun getting it kind-of working, but completion is far off still, and the fun tails off quickly.
- I learned more about ed than I would have done any other way. I dived in and used it, but also I was forced to read up on the details of the command syntax.
- I learned why people stopped using line-oriented editors as soon as full screen editors appeared. What am I saying? I already knew this!
- I remembered that I hate basic regexes, but this time I had to figure how to translate them to extended regexes (so I could actually use them in the target language) and that made me hate them more.
back to gemlog