09:16Yeah, I think Automerge is
probably one of the most advanced
09:20CRDT implementations right now.
09:22And as you've mentioned, you
built your first versions, not in
09:26Rust as it is written today, but
there were predecessors to this.
09:31So given that this is now such a.
09:33Such a long journey.
09:35I think it's, if it's fair to say, , that
you've been working on this for 10
09:38years, I'd be very interested in hearing
your reflections on the history and
09:44the process of taking Automerge from
the beginnings to where it is today.
09:50Yeah.
09:50So when I started working on CRDTs, there
was no CRDT for JSON data, for example.
09:55So there were existing data types
for sets and maps and counters and
10:00registers and things like that.
10:01So just these kind of little
atomic data types, but nothing
10:05that really composed them together.
10:07Uh, oh, and lists as well.
10:08I mentioned that there
were data types for lists.
10:11And so in a way, JSON is simple, you
know, it's just, you can put maps
10:14inside lists and maps and lists inside
maps and compose them arbitrarily.
10:19But there's still interesting
questions you have to answer, which
10:22is like, for example, what if one user
deletes an object while another user
10:26makes an update inside that object?
10:28How do you merge those things?
10:29And so one of the first research papers
I wrote was an algorithm for doing
10:34a CRDT for JSON data, which answered
exactly this kind of questions.
10:38And then Automerge started out sort of
conceptually as an implementation of
10:43this paper, although we ended up actually
choosing different behavior for Automerge
10:47than the paper chose, but you know, after
examining a bunch of applications and
10:52what sort of behavior they would want, we
came to the conclusion that a different
10:55behavior was better, but that was
basically the genesis of the whole thing.
11:00So I can't remember which
year that JSON CRDT came.
11:03paper came out, but yeah, I was
working on it like in 2015, 2016 ish.
11:08And then, I think it was about 2017,
Peter van Hardenberg got in touch with me.
11:12So I knew Peter from back in my
startup days because he was running
11:17the Heroku Postgres team at the time.
11:20And our company, which was called
Reportive, was one of the bigger customers
11:25of, uh, Heroku Postgres at the time.
11:28And so We had, like, talked to Peter as
part of, like, just scaling our database.
11:33years later, I hear from Peter again,
because he had read my JSON CRDT paper
11:38and went like, Hey, we want to try
actually building some apps with this.
11:41Have you tried actually
building some apps?
11:43And I went, Oh, no, no, no.
11:45I just do theory.
11:46You know, I just write a paper and I have
this extremely janky Ruby implementation
11:51that actually only does half of what
the, what was says in the paper.
11:55So then, , it got together
with, , Peter and Ink & Switch.
11:58And I think Ink & Switch was
quite new still at the time.
12:01And we did, , this project
together in which we essentially
12:05built a adjacent CRDT.
12:07That actually worked in JavaScript.
12:09In fact, Orion Henry wrote the first
version of that and brought it to me.
12:13And I went like, yeah, nice API, but
no, those algorithms are totally wrong.
12:17And so then we worked together to
make the algorithms right as well.
12:21And it was a great collaboration because
you know, the Ink & Switch folks were.
12:25Just much better, like API design and
also UI design and general app development
12:32than I was, whereas I sort of brought
the like more mathematical style of
12:35thinking of analyzing the algorithms
and making sure that they were correct,
12:39and that was just a great collaboration.
12:41So yeah, we've, we first
wrote this library.
12:43We originally called it Tesseract,
but then there was already a
12:46JavaScript library of that name.
12:47So we renamed it to Automerge
and that name has stuck since.
12:51So yeah, I think Automerge
started around 2017.
12:54And then a few Ink & Switch
projects used it, but it was very
12:58much research quality software.
13:00You know, it was extremely slow.
13:02It had bugs.
13:03The file format was extremely inefficient.
13:05So it was kind of impractical
to use for most things.
13:10As a vehicle for doing
research, it worked quite well.
13:13But then at some point, like
it became clear that, okay, we
13:16actually want to start building
more ambitious software on it.
13:19And it's not really acceptable
if it takes three minutes to
13:22load your document off disk.
13:24So, you know, okay, we have to make the.
13:26figure out a new file format to make
the file smaller and, , figure out new
13:31algorithms to make the whole thing faster.
13:34And then also we decided that the
Rust implementation would be better.
13:37Um, not so much because Rust is
faster than JavaScript, but rather
13:40because it's more cross platform.
13:42And so we can compile Rust to
WebAssembly for the web, but we can
13:45also compile it to native libraries
for iOS and Android, for example.
13:49And so Orion did a lot of
work on the port to Rust.
13:53Uh, again, and a few others
contributed to that, and Alex
13:57Good got involved with that too.
13:59But then at some point, two years
ago or so, we then made the call to
14:03make the Rust implementation, the
primary implementation of Automerge.
14:07So all of that JavaScript, I had, I'd been
maintaining the JavaScript implementation
14:10as this research code over the years, but
we decided to just completely deprecate
14:15that, throw away all of my old code.
14:16And I've done, actually no work on
the Rust code of the implementation.
14:20So that's all been done by Alex
and Orion and other people now.
14:24And I've just moved into more of an
advisory role, which suits me really well.
14:28You know, I'm very happy to be
the one not writing the code.
14:32Other people are much better at writing
the code than I am, but I know I can
14:34think about the algorithms and the
protocols and the data structures.
14:38And that's what I find fun.
14:39And so then, About a year
ago or so, we then declared
14:43Automerge to be production ready.
14:44So at that point, then, you know, the
Rust implementation was mature and fast.
14:50and we got a sponsorship thing going
with GitHub sponsors, which allowed
14:56people who were commercially using, or
companies that were commercially using
14:59Automerge, to sponsor its development.
15:01And that is now supporting the
work of Alex Goods, who's now
15:04professionally maintaining Automerge.
15:06And that is just such
a good arrangement now.
15:07I'm really pleased with how that's
working because it means that we have
15:11high quality software that's being
professionally maintained, but at the
15:14same time, you know, we haven't had to
go out and raise venture capital, which
15:18we feared that that's, you know, might be
at odds with the values of local-first.
15:23And so this way by Essentially
bootstrapping it off of
15:26the sponsorship revenue.
15:28I think that aligns everybody's
interests very well.
15:30And so that has allowed the
project to do very well.
15:33That is an incredible journey.
15:35And I mean, this is for
an open source project.
15:38Particularly, I think most people use
right now, Automerge still in a JavaScript
15:43context for a JavaScript library, where I
think you're thinking more in terms of dog
15:49years, Automerge is really a monumental
project and it has come incredibly far.
15:54So I'm super excited for that.
15:57So where's the project today?
15:58You've mentioned that it's
reached production readiness
16:02around about last year.
16:03Does that mean it's the APIs are
final, the research behind it is
16:08concluded and now it's just performance
optimizations or what is left to do?
16:13And I just, there's so much, so
much we still want to do with it.
16:17So what we mean with production
ready is like, there are no egregious
16:20bugs that we know about and the
performance is good enough that.
16:24You know, it's plausibly usable in
real software, which some of the
16:28research code definitely was not,
but it's got much, much better, but
16:31in terms of features, like it, I
think we've only really just started.
16:36So what Automerge started with is a
basic JSON model, so you can have maps.
16:41Where the keys are strings and the values
can be either nested maps, or they can
16:45be nested lists, or arbitrary recursion
of those things, or primitive values
16:50like strings and numbers and booleans.
16:53And that's it.
16:53Then, okay, we, we added counters
because actually counters are
16:56actually not very useful, but
everyone seems to use them for demos.
17:00So we include the counters so
that we can have the demo as well.
17:03Then, a big thing we added was rich text.
17:06So that's something that a
lot of applications need is.
17:10text with formatting.
17:11And the first version of that is
released and implemented, though the
17:16first version only supported inline
formatting, such as bold and italic
17:20but not block elements like headings
or bullet points or things like that.
17:24And so there's an updated version
of that coming soon, which adds
17:28support for block elements too.
17:29So this is now nice.
17:31You can put rich text
anywhere inside a document.
17:33So.
17:33You know, it's, if you want to make
a Google Docs equivalent thing,
17:36you can do that, but you could
also have, for example, a vector
17:39graphics software that has some rich
text just inside the text boxes.
17:42And the rest is a drawing consisting
of like arrows and lines and
17:48freeform, whatever you want.
17:50And so the JSON type document model
has allowed extension in those
17:54directions very well, but there's
so much more we still want to do.
17:58So.
17:58Like an obvious missing thing is undo in
collaborative software is actually quite
18:02subtle in terms of the behavior you want.
18:06And so in particular, it's not generally
the case that you want to undo the
18:09most recent operation, the most recent
change to the document, because the most
18:13recent change to document might've been
made by somebody else in a part of the
18:16document that you're not looking at.
18:17And so.
18:18Undoing somebody else's change in
a completely different part of the
18:20document is definitely not what you
intended when you hit command Z.
18:24So actually doing undo well requires,
inspecting the editing history of
18:30the document, which we can do because
Automerge keeps the editing history
18:33anyway, but actually surfacing
that and making the right APIs
18:37the right underlying algorithms,
that's still some work in progress.
18:40Another thing that we've long Try
to add as a move operation so that,
18:44for example, you could reorder items
in lists or if you have a, say a
18:49file system tree, you could drag a
directory from one location to another.
18:54That is also quite subtle to
implement because you have to answer
18:57questions like, what happens if
two users can currently move the
19:01same item to two different places?
19:03You don't want to duplicate it.
19:04In that case, you want to just.
19:06pick one of the destinations.
19:07Or you get weird things where like you
have A and B which are siblings and one
19:12user moves A to be a child of B while
concurrently another user moves B to be a
19:16child of A and now if you're not careful
you could end up with a loop between A
19:20and B and That would be a mess as well.
19:22So to move operation very carefully
has to handle those kinds of cases.
19:26You know, we wrote the research
paper about it several years ago, but
19:29actually turning that into the kind
of production quality code as part of
19:33Automerge is still ongoing project.
19:35And so those are kind of the
near term things that we want to.
19:39Features, examples of features
that we want to add to Automerge.
19:42Other stuff we want to do better
are, for example, synchronizing
19:45large collections of documents.
19:47So at the moment, Automerge really
just deals with one document at a time.
19:50But in many apps, you know, you might have
a collection of 100, 000 documents and
19:54most of them don't change most very much.
19:57So we need a protocol for efficiently
figuring out which of those many documents
20:00have changed and then synchronize
only those which have changed and