News for hackers. Stuff that matters.
Re:Loro: Reimagine state management with CRDTs by aatd86 on Monday November 13, 2023 @02:27PM (#38254145)
Can someone explain to me what happens when there is a destructive update on one side while the other side is still relying on some old version?

Can this even be reconciliated?

Or is it append only?i.e. No delete operation.

UIs have delete operations in general.

Re:Loro: Reimagine state management with CRDTs by allenu on Monday November 13, 2023 @07:56PM (#38257459)
I don’t know about the link’s strategy but I’ve implemented something CRDT-like and for object deletion, I’ve had to use tombstones. (In my case I timestamp the tombstone state in case I want to bring the object back).
Re:Loro: Reimagine state management with CRDTs by ablob on Monday November 13, 2023 @08:05PM (#38257540)
You can implement delete operations by marking fragments as deleted. That way you can still refer to them from a positional perspective, but they will eventually disappear. The exact behavior depends on the implementation, the only requirement is that every "user" reaches the same state eventually.

  A: delete Line 4@marker
  B: append to the end of line 4@marker "abcd"

could then result in either line 4 with only "abcd", or "abcd" at the beginning of line 5 (as long as both sides resolve to the same state). You're right in that this is tricky to get right, as that is inherent to the complexity of asynchonous mutation from multiple sources.
Re:Loro: Reimagine state management with CRDTs by aatd86 on Tuesday November 14, 2023 @02:18AM (#38260094)
I guess my question is of whether the state that is being reached is a legit one in this case.

What is the source of truth eventually?

I think there must probably be a hierarchy that decides it. It's probably a kind of race condition/byzantine general problem.

Re:Loro: Reimagine state management with CRDTs by lann on Tuesday November 14, 2023 @09:03AM (#38263383)
The answer depends on the specific CRDT algorithm in use. For complex data structures like the ones behind collaborative text editing your intuition that the updates end up looking hierarchical is generally correct.
Re:Loro: Reimagine state management with CRDTs by two_handfuls on Tuesday November 14, 2023 @10:07AM (#38264137)
These systems are based on the idea is that rather than directly editing the shared document, each program sends a stream of “update objects.” An example would be “create new line $xyz after line $abc.”

These “update objects” can be combined to get the current document state.

They have the property that if two programs receive the same set of uodate objects, regardless of the order they get them in, then they have the same current document state.

They define any state resulting from applying the operations as “legit.” In order for that to feel “legit” to the users you want to very carefully choose your operations and their semantics.