TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Operational transform for realtime collaborative editing in JS/Flow

56 pointsby c0daover 8 years ago

4 comments

tmail21over 8 years ago
The basic problem with OT (and current &quot;real-time&quot; collaborative editing approaches) is that they can only achieve eventual consistency.<p>While this sounds great, eventual consistency DOES NOT mean semantic consistency. This rules it out for many applications where semantic correctness is important.<p>Even for simple text documents you can get eventually correct but semantically incorrect results.<p>For example, consider the sentence<p>&quot;The car run well&quot;<p>This has an obvious grammatical error.<p>Now imagine two collaborative editors.<p>Editor 1: Fixes this to<p>&quot;The car runs well&quot;<p>Editor 2: Fixes this to<p>&quot;The car will run well&quot;<p>Depending on the specific ordering of character inserts and deletes this could easily converge to<p>&quot;The car will runs well&quot;<p>Obviously this statement is both grammatically incorrect as well as semantically ambiguous. (However, both editors see the same result and it is hence eventually consistent). Worse, OT collaborative editing will silently do this and carry on.<p>Now, for non-critical text where errors like this are ok, this may not be a big problem. But imagine contracts or white papers, or trying to use this on something like a spreadsheet where semantic correctness is critical and one can see why the current scope of collaborative &quot;real-time&quot; editing is very limited.<p>In general current &quot;real-time&quot; editing approaches like OT are outright dangerous.
评论 #13289784 未加载
评论 #13290548 未加载
评论 #13286446 未加载
juliendorraover 8 years ago
Great! I like the format of the post a lot: demo, code example and super clear explanation all combined in a good starting point on the subject.<p>(You could also have cited Etherpad as a common implementation in addition to Docs. Etherpad was a direct predecessor to character by character OT in Docs —the team was acquhired— and it is still widely used by many organizations. But then there is so many examples and libs, I understand that you wanted to just give context!)
Leftiumover 8 years ago
Wow! Front-end only is actually a great advantage for me. I actually tried to modify [ShareDB] to be front-end only[1]. (ShareDB uses WebSockets or any other full duplex stream; it&#x27;s a great reference if you want to implement true client&#x2F;server.)<p>I guess my use case is quite unique: [Todo.taskpaper] needs to sync multiple &quot;views&quot; of a single document in the same web app. Right now it uses very naive syncing; I&#x27;m going to try to upgrade it to blue-ot.js.<p>[ShareDB]: <a href="https:&#x2F;&#x2F;github.com&#x2F;share&#x2F;sharedb" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;share&#x2F;sharedb</a><p>[1]: <a href="http:&#x2F;&#x2F;stackoverflow.com&#x2F;q&#x2F;40616650&#x2F;117030" rel="nofollow">http:&#x2F;&#x2F;stackoverflow.com&#x2F;q&#x2F;40616650&#x2F;117030</a><p>[Todo.taskpaper]: <a href="https:&#x2F;&#x2F;todo-taskpaper.leftium.com" rel="nofollow">https:&#x2F;&#x2F;todo-taskpaper.leftium.com</a>
theaustinsevenover 8 years ago
This is cool! I&#x27;ve been working on something similar in Go, but I haven&#x27;t spent much time on it recently. Is this a purely front-end application, or is there a server associated with it?
评论 #13283111 未加载