Ropes, an Alternative to Strings [pdf] (1995)
TruffleRuby is an implementation of Ruby that uses ropes instead of character arrays for strings, if you want to see a modern implementation in practice.<p>It works brilliantly for mostly string concatenation workloads, like rendering web page templates.<p>Gets tricky when you decide to flatten it if people are repeatedly mutating single characters or indexing.<p>Cool thing is that it can provide a char* interface to a rope data structure, in order to support C extensions not expecting ropes.<p><a href="https:&#x2F;&#x2F;rubybib.org&#x2F;#menard2018" rel="nofollow">https:&#x2F;&#x2F;rubybib.org&#x2F;#menard2018</a>