Operational Transformation code from Google Docs

848 views
Skip to first unread message

Andy Hochhaus

unread,
Sep 4, 2010, 9:12:26 AM9/4/10
to closure-lib...@googlegroups.com
Hello,

I'm under the impression that the closure-library based Google Docs
now includes a client side operational transformation component [1].
Will this OT code eventually be added to closure-library? I'm sure
that many users would be interested even if we needed to reimplement
the server side portion.

Out of curiosity, how similar is the Google Docs OT to Google Wave protocol [2]?

Thanks,
Andy

[1] http://www.codecommit.com/blog/java/understanding-and-applying-operational-transformation

"""
What’s more, Google Docs recently revamped their word processing
application with a new editor based on operational transformation.
While there hasn’t been any word from Google on how exactly they
handle “compound OT” cases within Docs, it looks like they followed
the same route as Wave and Pulse (the tell-tale sign is a perceptible
“chunking” of incoming remote operations during connection lag).
"""

[2] http://www.waveprotocol.org/whitepapers/operational-transform

Andy Hochhaus

unread,
Sep 4, 2010, 9:14:00 AM9/4/10
to closure-lib...@googlegroups.com

Nick Santos

unread,
Sep 7, 2010, 1:01:06 AM9/7/10
to closure-lib...@googlegroups.com
For a number of reasons, I don't think we'll be able to discuss the
implementation of non-open-source google projects on this mailing
list. sorry. :)

i don't know of any effort to add an OT client library to
closure-library, though.

Nick

ps--that's a good blog post!

Daniel Nadasi

unread,
Sep 7, 2010, 1:23:16 AM9/7/10
to closure-lib...@googlegroups.com
I have spoken to the Docs team, and they have said that the Docs OT code is substantially similar to the Wave code. In other words, if you want a reasonable idea for how the docs code might work, look at the existing Wave implementation. Unfortunately, as Nick said, since the code isn't currently open, we can't go into more detail than that.

As for the other question, it would seem unlikely to me that an OT client library would be released as part of Closure. Part of the Wave OT code's magic is that GWT allows cross-compilation into JS so that the client and server have exactly the same code, which is necessary for OT to work. Therefore having a pure JS library for OT seems tricky at best.

Daniel

Andy Hochhaus

unread,
Sep 7, 2010, 10:35:44 PM9/7/10
to closure-lib...@googlegroups.com
Thanks for the feedback Nick and Daniel.

> On Tue, Sep 7, 2010 at 3:01 PM, Nick Santos <nicks...@google.com> wrote:
> For a number of reasons, I don't think we'll be able to discuss the
> implementation of non-open-source google projects on this mailing
> list. sorry. :)

Not a problem. :) Leaving the Google Docs implementation out of it...

A good chunk of the code required to do OT is open sourced in the
wave-protocol project. However, the client portion of the code [1] is
built on GWT.

My real question is, does/will a closure-library based alternative to
this client side code exist?

My reason for asking is that my project is built on closure-library
(not GWT). We could try to mix closure and GWT in order to get the
wave OT, but I was hoping a cleaner solution existed.

> i don't know of any effort to add an OT client library to
> closure-library, though.

This answers my question. Thanks.

On Tue, Sep 7, 2010 at 12:23 AM, Daniel Nadasi <dna...@google.com> wrote:
> As for the other question, it would seem unlikely to me that an OT client
> library would be released as part of Closure. Part of the Wave OT code's
> magic is that GWT allows cross-compilation into JS so that the client and
> server have exactly the same code, which is necessary for OT to work.

I agree that having GWT cross-compilation makes the implementation
easier. However, to me, it seems that the client and server using the
exact same source code is not a requirement of OT. Rather the client
and server just need to be written to work together (but they could be
implemented in different languages/code bases).

> Therefore having a pure JS library for OT seems tricky at best.

Thanks,
Andy

[1] http://code.google.com/p/wave-protocol/source/browse?repo=io2010#hg/gwt_src/org/waveprotocol/wave/examples/fedone

Daniel Nadasi

unread,
Sep 8, 2010, 12:06:45 AM9/8/10
to closure-lib...@googlegroups.com
On Wed, Sep 8, 2010 at 12:35 PM, Andy Hochhaus <ahoc...@samegoal.com> wrote:
Thanks for the feedback Nick and Daniel.

> On Tue, Sep 7, 2010 at 3:01 PM, Nick Santos <nicks...@google.com> wrote:
> For a number of reasons, I don't think we'll be able to discuss the
> implementation of non-open-source google projects on this mailing
> list. sorry. :)

Not a problem. :) Leaving the Google Docs implementation out of it...

A good chunk of the code required to do OT is open sourced in the
wave-protocol project. However, the client portion of the code [1] is
built on GWT.

My real question is, does/will a closure-library based alternative to
this client side code exist?

I would honestly not be surprised if someone (not necessarily at Google) was working on this - but I don't know of specific plans at the moment.
 

My reason for asking is that my project is built on closure-library
(not GWT). We could try to mix closure and GWT in order to get the
wave OT, but I was hoping a cleaner solution existed.

> i don't know of any effort to add an OT client library to
> closure-library, though.

This answers my question. Thanks.

On Tue, Sep 7, 2010 at 12:23 AM, Daniel Nadasi <dna...@google.com> wrote:
> As for the other question, it would seem unlikely to me that an OT client
> library would be released as part of Closure. Part of the Wave OT code's
> magic is that GWT allows cross-compilation into JS so that the client and
> server have exactly the same code, which is necessary for OT to work.

I agree that having GWT cross-compilation makes the implementation
easier. However, to me, it seems that the client and server using the
exact same source code is not a requirement of OT. Rather the client
and server just need to be written to work together (but they could be
implemented in different languages/code bases).

My (admittedly primitive) understanding of OT is that while the server and client don't have to share code, they do have to apply the same transformations and be able to rely on said transformations having exactly the same result in both places. It just so happens that the easiest way for Wave to do this was with shared code and GWT.

Andy Hochhaus

unread,
Oct 27, 2010, 12:59:05 PM10/27/10
to closure-lib...@googlegroups.com
In case it is helpful to others with a similar use case, I recently
found google-diff-match-patch which offers differential
synchronization in pure javascript (no need to pull in GWT).

http://code.google.com/p/google-diff-match-patch/

-Andy

Reply all
Reply to author
Forward
0 new messages