News for hackers. Stuff that matters.
Re:Are CRDTs suitable for shared editing? by cryptonector on Monday August 17, 2020 @11:59AM (#24188447)
Also, if the monoids used in a CRDT implementation do not align with the mental model users have for what they're doing (hint: they do not), then the result will be artifacts the users don't like. Single user text editing is amenable to using ropes and monoids internally because none of that leaks into the UI/UX, but multi-user text editing is not amenable to representation as monoidal interactions because in the multi-user case the monoidal interactions will become evident and confusing.

Or at least that's the lesson I took from all the xi blogs I've read.

Re:Are CRDTs suitable for shared editing? by hinkley on Monday August 17, 2020 @12:41PM (#24188900)
This is a problem we need to solve with code editors and version control as well.

Patches are always a little bit garbage, and can cause extra problems with 3 way merges because of it.

Re:Are CRDTs suitable for shared editing? by Chris2048 on Wednesday August 19, 2020 @10:37AM (#24210801)
In feel this is probably a language-level problem, and solving it only at editor/VC level will be complicated.

At the same time, changes to the lang level would require changes at editor/VC level too.

As en example: a MIX type syntax can separate classes and class-methods into different files, and combine them back again. This way moving a class method around in a class won't be seen as removing a method and creating a new one: the file give the specific method an identity, and a method of differentiating between code movement and code alteration.

Re:Are CRDTs suitable for shared editing? by dnautics on Monday August 17, 2020 @03:07PM (#24190644)
I think it's important to note that "they do not yet". CRDTs are an active area of research, relatively young, and it is not unreasonable to expect that new datastructures which DO align to users' mental models will appear in the not-too-distant future.
Re:Are CRDTs suitable for shared editing? by cryptonector on Monday August 17, 2020 @03:40PM (#24191050)
CRDT is very well understood. The basics of the theory is utterly trivial. The only question is whether we can design new monoids that line up better with human understandings of their own intent -- of this I am skeptical because our mental models of what we're doing are not at all monoidal, though because CRDTs are so elegant and so simple, I would be ecstatic if indeed we find/design such monoids.
Re:Are CRDTs suitable for shared editing? by dnautics on Monday August 17, 2020 @04:41PM (#24191789)
what do you think of Martin Klepmann's research, e.g: https://martin.kleppmann.com/2020/07/06/crdt-hard-parts-hydr...
Re:Are CRDTs suitable for shared editing? by cryptonector on Monday August 17, 2020 @05:45PM (#24192556)
I'll watch it and let you know. Sounds very interesting!
Re:Are CRDTs suitable for shared editing? by cryptonector on Tuesday August 18, 2020 @12:17PM (#24200562)
I'm part of the way through. Here are some thoughts.

- Is there a way to materialize all of the past up to some point, throwing out history in the process, so as to reduce the overhead of CRDT?

- Some CRDT algorithms (really, representations of operations) are better at modeling a user's intent -- rather than "insert 'H' at 101, insert 'e' at 102, ..." and so on, it's "insert 'Hello' between ...". As I'm not familiar with OT, I wonder whether this begins to approach OT... In any case, some of the better CRDT algorithms for text editing tend to require more overhead, which is why the preceding thought.

- I'm much more interested in CRDTs for distributed relational databases, where it's much easier to reason about intent. "Relational" really means "has a well defined, enforced schema", while "text" means "anything goes" -- it's necessarily easier to reason about the former than the latter! Even so, a set of related updates to a relational database may be the complex result of a simpler abstraction -a simpler operation that the user intended- and eventual consistency semantics may ruin that result. One way to deal with that is to centralize certain kinds of operations, but those had better be less essential to business continuity.

Re:Are CRDTs suitable for shared editing? by dnautics on Tuesday August 18, 2020 @03:55PM (#24203559)
thanks for those thoughts!

- I'm with you on point #1. Obviously could be a source of good research, but also, it probably depends on policy. How many undos do you want to preserve? Even a one-headed VSCode instance only saves so many undos. You could probably hybrid CRDT with a consensus algorithm like raft to perform compactions.

Re:Are CRDTs suitable for shared editing? by cryptonector on Tuesday August 18, 2020 @05:50PM (#24204773)
Right, if it's about undo history, screw that, at some point you don't care anymore -- you might build a sort of VCS into the text editor so you can keep track of changes in a less granular way. If it's about knowing when you have all the history before some point in time, then that's doable.

And thanks for the link!