Skip to content

Commit 4e3c3b5

Browse files
authored
Improve readme with CTM info
1 parent 26ce303 commit 4e3c3b5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
# diffsync
2-
This implements a simple collaborative editor for the web
32

4-
It implements collaborative text editing via git's [recursive 3-way merge algorithm](https://public-inbox.org/git/20050826184731.GA13629@c165.ib.student.liu.se/). This is how git merges big commits of source code. I bet you never thought it could be used for merging single-keystroke edits together!
3+
Diffsync is a radical re-interpretation of git's [recursive 3-way merge algorithm](https://public-inbox.org/git/20050826184731.GA13629@c165.ib.student.liu.se/) applied to collaborative text editing. Git uses this algorithm to merge entire commits of edits. Here we show this is actually a *great* algorithm to merge keystrokes together in realtime!
54

6-
It's actually remarkable fast, too, because it uses the amazing Myer's algorithm for the diffing!
5+
This algorithm is remarkably fast, because:
6+
1. We use the amazing [Myer's algorithm](https://www.nathaniel.ai/myers-diff/) for the diffing.
7+
2. We're able to *prune old edit history* away!
8+
9+
How are we able to prune history? Well, because this algorithm isn't your normal OT or CRDT algorithm... it's actually a generalization of both, called a [Collapsing Time Machine](https://braid.org/time-machines). CTMs have a bunch of cool properties, such as making history modular — so that different peers can prune different regions of it, while still guaranteeing perfect consistency!
710

811
See the index.html file for an example usage.
912

10-
We [hypothesize](https://stackoverflow.com/a/48652362/440344) that this algorithm actually can be proven to be a CRDT, by observing that each recursive merge creates a least-upper-bound within a semilattice.
13+
If you're curious, you can also read up on our early [hypothesizing](https://stackoverflow.com/a/48652362/440344) about the relationship between version controll systems and OT and CRDT algorithms. This was one of our earliest experiments into finding a universal synchronization algorithm and framework, which has now led to the [CTM theory](https://braid.org/time-machines) and the interoperable [Braid synchronization protocols](https://braid.org).

0 commit comments

Comments
 (0)