3 ms·
A must-read paper in this space is the 1998 paper by Charles Crowley, Data Structures for Text Sequences: https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.
by nsajko 5y ago
A must-read paper in this space is the 1998 paper by Charles Crowley, Data Structures for Text Sequences: https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.48.1265&rep=rep1&type=pdf https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.48...
It explores the space from a different angle: the paper doesn't mention ropes, but it promotes a data structure called a piece table (or sometimes piece chain, piece tree, ...). These two data structure approaches are orthogonal, in that ropes can be used to implement the piece tables' descriptor sequences.
Some salient points from the paper about the advantages of the piece table:
* All buffers used are either read-only or append-only, so they are easy to cache and work well over a network.
* It follows that items never move once placed in a buffer, which is nice as pointers to items never need updating.
* Implementing undo is easy.
EDIT: this blog post is also nice: https://code.visualstudio.com/blogs/2018/03/23/text-buffer-reimplementation https://code.visualstudio.com/blogs/2018/03/23/text-buffer-r...