Re:Slimmer and faster JavaScript strings in Firefox
by jahewson on Tuesday July 22, 2014 @03:17AM
(#8067699)
1, 2. Grapheme clusters are not normative in Unicode, they can be tailored for specific languages. There's a default cluster finding algorithm but it's not suitable in all cases. There's no "one size fits all" approach.
3. Forward and backward are likewise language and tailoring dependent because they depend on graphemes. There may also be application-specific tailoring such as the handling of combining marks, in some scripts "forward" and "backward" are not clearly defined.
1. Opaque cursors pointing somewhere in the conceptual sequence of code points, with constant-time dereferencing,
2. Ranges, defined by starting and ending cursors, and
3. The ability to move cursors forward or backward by either code points or composed grapheme clusters.
This would be a saner interface than any other I've seen, and it puts very few constraints on the underlying encoding.