Re:ShareJS – Live concurrent editing in your app
by ilaksh on Wednesday May 02, 2012 @06:10AM
(#3918306)
Based on the amount of trolling, 'penis' and other garbage inserted into that textarea, Hacker News readership must include a fairly large number of idiotic children.
Re:ShareJS – Live concurrent editing in your app
by Inviz on Wednesday May 02, 2012 @10:51AM
(#3919325)
Always wanted to ask: Isn't google's diff-match-patch library suitable for the same thing? It can apply patches to altered input pretty nicely.
Is there a conceptual difference? Diffs support all types of operations - insert, remove, replace. I'm really curious about realtime collaboration, but can't decide which is the right tool for the job.
Re:ShareJS – Live concurrent editing in your app
by tarr11 on Wednesday May 02, 2012 @12:05PM
(#3919769)
Operational transform is not the same as diff-match-patch.
DiffMatchPatch gets confused pretty easily around similar content. It uses lexical similarity to determine the patch. It often fails, and the API actually tells you that it was unable to apply a patch. For example, if you make a huge change to a file, diffMatchPatch will be unable to generate a patch file.
Operational Transform, on the other hand, uses some an ordered sync to ensure that changes are applied in a consistent way across all clients. It woudln't fail in the same way and is resilient to more kinds of changes.
Re:ShareJS – Live concurrent editing in your app
by jhealy on Wednesday May 02, 2012 @09:25AM
(#3918887)
We're using ShareJS in production for the authoring side of http://theconversation.edu.au - it's brilliant and solved most of our collaborative editing pain.
Re:ShareJS – Live concurrent editing in your app
by josephg on Wednesday May 02, 2012 @09:31AM
(#3918918)
[ShareJS author] I've considered rewriting ShareJS in C a couple times.
For science, I ported the core operational transform algorithm code from coffeescript into C and got a ~10% reduction in code size and an 8x performance boost. The networking and database code won't translate anywhere near as well, but it may still be worth doing at some stage.
The architecture for Wave is really difficult to get a handle on, though.
Relative ease of use is a major benefit of ShareJS, though I can't fully vouch for its algorithmic correctness. I've been meaning to contribute some additional tests to the project.
Re:ShareJS – Live concurrent editing in your app
by pie on Wednesday May 02, 2012 @01:00PM
(#3920056)
I know - but having developed an OT library and read the ShareJS code thoroughly, I think there MAY be 2 edge cases where conflict resolution is not symmetrical for some data types. Or I could be totally wrong.
As I mentioned, I hope to contribute tests to show that everything's peachy. Not trying to talk trash about this great library.
Re:ShareJS – Live concurrent editing in your app
by nornagon on Wednesday May 02, 2012 @10:11PM
(#3922072)
I'd be keen to know what those edge cases are. For JSON OT in particular I'm not entirely convinced it's correct (I wrote it), but it IS highly tested and fuzzed.
Re:ShareJS – Live concurrent editing in your app
by pixdamix on Wednesday May 02, 2012 @09:38AM
(#3918947)
This would be a great way to enable collaborative email sharing. I always wanted a way to let someone spellcheck, review or edit a mail I was writing (Inside Gmail)
For now it's Google-docs, then copy/paste, but sharing the mail on the go would be so useful.
Re:ShareJS – Live concurrent editing in your app
by lenart on Wednesday May 02, 2012 @07:16AM
(#3918467)
Great work man! What I think it needs next is some sort of cursor indicator - preferably with some sort of user id. Something similar to how Google Docs did it. Keep it up!
This is why we can't have nice things.
I got several popups (alerts) with the word Faggot in them in my browser after I let the page sit for 10 minutes.
Is there a conceptual difference? Diffs support all types of operations - insert, remove, replace. I'm really curious about realtime collaboration, but can't decide which is the right tool for the job.
DiffMatchPatch gets confused pretty easily around similar content. It uses lexical similarity to determine the patch. It often fails, and the API actually tells you that it was unable to apply a patch. For example, if you make a huge change to a file, diffMatchPatch will be unable to generate a patch file.
Operational Transform, on the other hand, uses some an ordered sync to ensure that changes are applied in a consistent way across all clients. It woudln't fail in the same way and is resilient to more kinds of changes.
If only it wasn't written in node....
For science, I ported the core operational transform algorithm code from coffeescript into C and got a ~10% reduction in code size and an 8x performance boost. The networking and database code won't translate anywhere near as well, but it may still be worth doing at some stage.
http://incubator.apache.org/wave/
The architecture for Wave is really difficult to get a handle on, though.
Relative ease of use is a major benefit of ShareJS, though I can't fully vouch for its algorithmic correctness. I've been meaning to contribute some additional tests to the project.
As I mentioned, I hope to contribute tests to show that everything's peachy. Not trying to talk trash about this great library.
For now it's Google-docs, then copy/paste, but sharing the mail on the go would be so useful.
Maybe for editing a textarea with rich formatting.
But ShareJS supports much more than that. You can sync custom objects etc. Look at their examples!