News for hackers. Stuff that matters.
Re:CRDTs make multiplayer text editing part of Zed's DNA by nathansobo on Thursday December 01, 2022 @04:43PM (#33823278)
We honestly don’t solve it yet, but haven’t found it that big of an issue in practice. Would be curious to see the best resource on it.
Re:CRDTs make multiplayer text editing part of Zed's DNA by josephg on Thursday December 01, 2022 @05:12PM (#33823688)
I remember reading about it in one of Martin Kleppmann’s papers, though I can’t remember which one.

It’s an ordering problem that comes from some of the simpler ordering algorithms. For Diamond types I’m using a variant of Yjs’s ordering. But even RGA doesn’t have this problem because each character’s insert location is specified by naming the character immediately to the left when that character was typed.

This repository implements a few different list CRDTs using an insertion sort approach, where the algorithm scans for the appropriate location every time an insert happens. This is the scanning function for RGA (automerge’s algorithm):

https://github.com/josephg/reference-crdts/blob/fed747255df9...

And this is an interactive visualisation of how diamond types works (which uses Yjs’s algorithm instead), complete with run-length encoding: https://home.seph.codes/public/diamond-vis/

Re:CRDTs make multiplayer text editing part of Zed's DNA by Horusiath on Friday December 02, 2022 @02:22AM (#33827829)
I've described this issue in my blog post together with CRDT variants that address and solve it: https://bartoszsypytkowski.com/operation-based-crdts-arrays-...

In practice, many CRDT libraries nowadays (eg. Yjs and Automerge) are using structures that don't come with interleaving issues.