Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A good article, which shows that even plain text editing (without any formatty) is already way more complex than a layperson may appreciate.

For the developer, there are some gems to be discovered when writing a text editor; recall that using regular expressions coverted to finite state machines saw the light as part of editing, and I remember being given a very cool paper (from the 1960s!) by my undergrad compiler construction professor that proposed an efficient algorithm for testing whether a string containing a line of text can possibly be a substring of any valid Pascal program (it was a piece of theory invented while and for a syntax-aware Pascal editor, possibly from IBM but not sure). Another thing is data structures: I learned of ropes, an alternative to strings for representing text (optimized for fast editing) in the context of text editing: https://dl.acm.org/doi/10.1002/spe.4380251203



There's a new(ish) editor called Xi that's built on the rope data structure: https://github.com/xi-editor/xi-editor


Just a heads up: That editor project, while conceptually interesting, is currently abandoned.


I don't think that's still actively developed.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: