Promoted to answer by request:
The antique "Software Tools in Pascal" by Kernighan and Plaugher implements the ed
editor in a language with neither real strings nor pointers. It contains a great overview of the design considerations that underlie any text editor.