by josephg · 3y ago · 0 comments
I use it as my standard test when trying out a new programming language. It was unexpectedly ugly in go because of go’s lack of enums & unions, and that’s one of the big reasons I never got in to programming Go.
Can you recommend any learning resources for implementing an OT? (Ideally typescript, python, or rust)
https://github.com/Operational-Transformation/ot.js/blob/mas...
and this is a good post outlining the basics of OT, from the creator of CodeMirror:
https://marijnhaverbeke.nl/blog/collaborative-editing-cm.htm...
I also reimplemented it in a surprisingly tiny amount of OCaml [1] which was a fun way to learn that language :)
[0]: https://github.com/jahfer/othello [1]: https://github.com/jahfer/othello-ocaml
Just for clarification, while OT for plain-text (linear model) might be simple to implement, OT for typical rich-text editors (like Google Docs) that need to rely on a tree-structured data model is a whole different story: https://ckeditor.com/blog/lessons-learned-from-creating-a-ri....
I'm actually part of the team that built real-time collaboration for CKEditor 5. As the article says, we use a tree-structured representation for rich-text data and decided (many years ago) to go with OT. My guess always was that GDocs also uses a tree structure as the internal data model or that at least Google Wave did. I think I based this on a comment from a Google employee who summed up their OT implementation as hard to stabilize, even over many years.
I know it's possible to kind of represent rich-text data in form of a linear structure. This makes the implementation of the OT much much simpler. But then the editor itself becomes much more limited or you need to combine multiple instances of its model to represent more complex data. E.g., AFAIK Quill (mentioned in the other comment) does not offer stable tables implementation. Something that wasn't that big of a deal for us.
How do I know? I work on Zoho Writer - a google docs alternative and we use the same technique :)
Glad to meet you. Huge fan of CKeditor's modular architecture of the editor. Making something with that level of customization and supporting realtime collaboration is not an easy feat at all!
What are your thoughts on CRDT generally? Will CKeditor ever look into adopting CRDTs in the future?
(i was the cto at a startup which used this to create a multi-user text editor with rich text support in 2015ish)