Main Greg Channel!

Text CRDTs from scratch, in code!


Listen Later

Want to know how google docs would work, if it was decentralised and therefore better? Lets make one!

In this video I implement a text CRDT (That is, a conflict-free replicating data type) for collaborative text editing, from scratch. And I explain how it all works along the way.

Which CRDT? FugueMax! Which is the gold standard for text editing. And instead of doing it the tree way, like in the paper, I show how to implement it as a list - which is essential if you want to optimise the algorithm.

Here's the code I wrote on camera: https://github.com/josephg/crdt-from-scratch

The FugueMax paper is here: https://arxiv.org/abs/2305.00583

And here's the blog post talking about how to make this algorithm go really fast: https://josephg.com/blog/crdts-go-brrr/

00:00:00 Intro

00:05:01 How do CRDTs work?
00:13:12 Project setup
00:19:11 Add items
00:34:04 Understanding integrate
00:40:41 Testing
00:45:05 Document versions
00:50:57 Merging documents
00:59:16 Testing
01:02:56 Deletion
01:10:22 Moer tests
01:12:47 Editor
01:21:58 It works!
01:25:36 recap & end

...more
View all episodesView all episodes
Download on the App Store

Main Greg Channel!By