Splice stream #3

Closed
Raynos opened this Issue Aug 27, 2012 · 5 comments

Projects

None yet

2 participants

@Raynos
Contributor
Raynos commented Aug 27, 2012

A crdt.Set / crdt.Seq matches the splice-stream idea.

We should have some way to turn a Set and a Seq into a splice stream. splice streams are to array as delta streams are to object.

@dominictarr
Owner

there is a problem with splice, it's non-monotonic.

https://github.com/dominictarr/presentations/blob/master/crdt.md#the-hard-thing

Basically, the order of splices affects the meaning of other splices,
so it can't do concurrent updates, with out tracking a whole lot more
information,
like either a commit histroy, or a vector clock.

I implemented a commit history style in http://github.com/dominictarr/snob
but it's really complicated, that style works well for git but it's not
suited to realtime stuff.
it's better for situations where the document converges and then stops
changing.

it could be made to work, of course...
also see:

https://github.com/dominictarr/adiff

That is why I was going on about lists.
instead of splices, it would work better to say insertBetween [after, before]
or just rely on an sort key generated with between.

That would assume that the objects have a unique id, and a _sort,
or some sort. This might sound like a heavy assumption,
but after exploring this problem area for a while I realized that such an
assumption
makes it managably simple.

On Mon, Aug 27, 2012 at 2:53 AM, Raynos notifications@github.com wrote:

A crdt.Set / crdt.Seq matches the splice-streamhttps://github.com/Raynos/splice-streamidea.

We should have some way to turn a Set and a Seq into a splice stream.
splice streams are to array as delta streams are to object.


Reply to this email directly or view it on GitHubhttps://github.com/dominictarr/crdt/issues/3.

@Raynos
Contributor
Raynos commented Aug 27, 2012

@dominictarr We can look at this problem differently.

A crdt Set / Seq can still have unique ids for each object and a _sort property or a sort key or whatever.

We can then represent a Set / Seq as a splice stream for emitting local changes on the Set/Seq and for sending local changes back to the Set/Seq.

Then we can send those changes over the wire properly in the crdt format.

We are never sending splice streams directly over the wire.

But if you have a better suggestion for a List stream feel free to make one.

@dominictarr
Owner

the only thing I can think of that you would want to synchronize locally
would be gui elements, agree?

On Mon, Aug 27, 2012 at 9:21 AM, Raynos notifications@github.com wrote:

@dominictarr https://github.com/dominictarr We can look at this problem
differently.

A crdt Set / Seq can still have unique ids for each object and a _sort
property or a sort key or whatever.

We can then represent a Set / Seq as a splice stream for emitting local
changes on the Set/Seq and for sending local changes back to the Set/Seq.

Then we can send those changes over the wire properly in the crdt format.

We are never sending splice streams directly over the wire.

But if you have a better suggestion for a List stream feel free to make
one.


Reply to this email directly or view it on GitHubhttps://github.com/dominictarr/crdt/issues/3#issuecomment-8048605.

@Raynos
Contributor
Raynos commented Aug 27, 2012

@dominictarr yes. I mainly want to use splice-stream & delta-stream for turning GUI elements into streams

@Raynos
Contributor
Raynos commented Sep 1, 2012

@dominictarr splice-stream is broken as hell. It doesn't work even in a single process and is completely broken cross process.

I will deprecate it and create list-stream which is a scuttlebutt representation of an array which uses numeric keys from 0 to 1 (using between) and pretends the object is an array.

Eventaully crdt.Set and crdt.Seq will be based on list like abstractions

@Raynos Raynos closed this Sep 1, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment