One of our inspirations for modeling text operations in this way was atjson, a rich text format which stores formatting spans alongside a plain text sequence.
Never seen this atjson
library but this is really cool-- would be interested to see what is possible if syncing this syntax with a tool like Cambria.