From: Ergus <spacibba@aol.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Qiantan Hong <qhong@mit.edu>,
fmfs@posteo.net, bugs@gnu.support, npostavs@gmail.com,
emacs-devel@gnu.org, kfogel@red-bean.com,
monnier@iro.umontreal.ca
Subject: Re: Question collaborative editing.
Date: Thu, 1 Oct 2020 01:11:59 +0200 [thread overview]
Message-ID: <20200930231159.q6h6etboucwkjcfe@Ergus> (raw)
In-Reply-To: <83a6x7i1d0.fsf@gnu.org>
On Wed, Sep 30, 2020 at 09:08:27PM +0300, Eli Zaretskii wrote:
>> From: Qiantan Hong <qhong@mit.edu>
>> CC: Ergus <spacibba@aol.com>, Fermin <fmfs@posteo.net>,
>> Jean Louis
>> <bugs@gnu.support>, Noam Postavsky <npostavs@gmail.com>,
>> Emacs developers
>> <emacs-devel@gnu.org>,
>> Karl Fogel <kfogel@red-bean.com>,
>> Stefan Monnier
>> <monnier@iro.umontreal.ca>
>> Date: Wed, 30 Sep 2020 17:48:13 +0000
>>
>> > I'm sorry, I probably miss too much background information here,
>> > because I don't really understand what is the issue you are describing
>> > here. E.g., why is user intent important, when all you need is to
>> > keep buffer text synchronized between several sessions?
>>
>> That’s the baseline for collaborative editing, there’s apparently
>> solution that satisfies this single property (convergence property)
>> but are extremely bad — e.g. the effect of some user input takes
>> no effect, or a trivial program displaying an empty buffer for
>> every user. Actually if we only want this property there’s much
>> simpler way than CRDT/OT, e.g. let the server (or one client)
>> send the whole buffer periodically.
>>
>> One example of diff not preserving user intent is:
>> suppose in the buffer there is
>> “one two one”
>> And users agree that this sentence should always end in “one”.
>> Now user A deleted the first two words “one two “
>> user B inserted “three” between the first “one” and “two”
>> However, the diff have no idea about users’ agreement
>> and what exactly user does (unless we get it from modification
>> hooks). For user A, the diff just see “one” after and assume
>> that A delete the suffix “two one”. The CRDT then does it job
>> correctly and gives final synchronization result “one three”.
>> Clearly, user intent is violated.
>
>I understand all that, but (a) you can overcome that by techniques
>different from CRDT, and (b) unless we mean very different things by
>"user intent", the intent is not important here. What is important,
>AFAIU, is to specify the changes in a way that will produce the
>desired result even if the buffer in the other Emacs was meanwhile
>modified.
Hi Eli:
I will probably describe the obvious, but it seems that there is a miss
communication here.
The CRDT algorithm works in a way that every single character in the
buffer has a unique ID if you have "ab" then a could be zero and b could
be 1... Inserting a char between them (acb) will make c be 0.5; adding
another (acdb) will make d=0.75 (this is just a simplified example)
So adding a letter only needs to contain the new number and the char to
insert {0.5; c} {0.75; d}. And to insert "c" we only need to find which
char in the buffer are x < 0.5 and x+1 > 0.5.
If I understood the Qiantan idea; his approach is to add such ID as a
text property within the emacs buffer. To modify the buffer it is only
needed to search (go to) the property ID of text chars/words whatever in
the emacs buffer and perform the action. So the error probability is
smaller because the IDs ARE in the text itself.
This will reduce undetected errors inserting in the wrong positions when
translating form the CRDT ID to the real "global" buffer position to do
an "insert". Which could happen in some corner cases... (lets say
basically synchronization errors between local modifications (which
modify local absolute positions) and processing remote ones using
outdated information (translating to global indices)...
Said that; the external library approach seemed to work with tandem
https://github.com/jscheid/tandem-emacs
I am not sire how well it did.
My previous concerns about the internal storage and performance was
because the linear search of text properties in a long linear buffer may
be very expensive as described in the refereed paper; so using a two
steps search improved performance as described there... There are also
other optimizations like grouping operations or remove redundant ones
that with the C approach could reduce the operation that arrive to
emacs. Probably in our case the improvement may be to use a bisection
search and position hints.
Any way. I am pretty sure that the Qiantan lisp only implementation
could work; but performance is something that needs to be tested
(hopefully performance issues will be negligible compared to network
latency).
The C library implementation was my utopic ideal implementation in order
to make it efficient, portable and reusable with other editors... But it
will somehow require to start a completely independent project from
scratch and would require much more time to implement (algorithm,
network handling, json, synchronization between clients and with
emacs)... And basically emacs provides all that. Maybe this time simple
is not better, but more realistic.
next prev parent reply other threads:[~2020-09-30 23:11 UTC|newest]
Thread overview: 151+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200921120518.35d56p747pr5mhta.ref@Ergus>
2020-09-21 12:05 ` Question collaborative editing Ergus
2020-09-21 13:35 ` Stefan Monnier
2020-09-21 16:24 ` Ergus
2020-09-21 20:25 ` Karl Fogel
2020-09-24 1:36 ` Ergus
2020-09-24 21:41 ` Fermin
2020-09-25 0:22 ` Ergus
2020-09-25 10:34 ` Fermin
2020-09-26 16:33 ` Ergus
2020-09-29 16:01 ` Qiantan Hong
2020-09-29 21:46 ` Ergus
2020-09-30 9:52 ` Jean Louis
2020-09-28 0:43 ` Ergus
2020-09-29 0:00 ` Fermin
2020-09-29 1:01 ` Noam Postavsky
2020-09-29 8:25 ` Jean Louis
2020-09-29 12:45 ` Ergus
2020-09-29 15:58 ` Qiantan Hong
2020-09-29 16:29 ` Stefan Monnier
2020-09-29 16:33 ` Qiantan Hong
2020-10-27 5:10 ` Qiantan Hong
2020-10-27 12:46 ` Jean Louis
2020-09-29 17:35 ` Karl Fogel
2020-09-29 21:58 ` Ergus
2020-09-29 23:40 ` Qiantan Hong
2020-09-30 0:13 ` Ergus
2020-09-30 0:47 ` Qiantan Hong
2020-09-30 7:40 ` Karl Fogel
2020-09-30 13:19 ` Ergus
2020-09-30 17:00 ` Karl Fogel
2020-10-02 18:48 ` Emacs + Etherpad compatibility? (was: Question collaborative editing.) Karl Fogel
2020-10-02 20:34 ` Emacs + Etherpad compatibility? Stefan Monnier
2020-10-03 10:01 ` Michael Albinus
2020-09-30 13:46 ` Question collaborative editing Eli Zaretskii
2020-09-30 13:43 ` Eli Zaretskii
2020-09-30 15:47 ` Qiantan Hong
2020-09-30 16:19 ` Eli Zaretskii
2020-09-30 17:00 ` Qiantan Hong
2020-09-30 17:04 ` Qiantan Hong
2020-09-30 17:20 ` Eli Zaretskii
2020-09-30 17:48 ` Qiantan Hong
2020-09-30 18:08 ` Eli Zaretskii
2020-09-30 23:11 ` Ergus [this message]
2020-10-01 13:40 ` Eli Zaretskii
2020-10-01 15:21 ` Qiantan Hong
2020-10-01 23:10 ` Karl Fogel
2020-10-01 15:55 ` Ergus
2020-09-30 17:08 ` Stefan Monnier
2020-10-01 14:11 ` Jean Louis
2020-10-01 16:01 ` Ergus
2020-10-01 16:44 ` Pankaj Jangid
2020-10-01 16:53 ` Ergus
2020-10-01 17:29 ` Yuri Khan
2020-10-02 3:00 ` Pankaj Jangid
2020-10-02 7:30 ` Michael Albinus
2020-10-02 7:35 ` Eli Zaretskii
2020-10-02 10:01 ` Pankaj Jangid
2020-10-02 11:33 ` Ergus
2020-10-02 12:13 ` Michael Albinus
2020-10-04 17:54 ` Question collaborative editing - Wikipedia reference Jean Louis
2020-10-04 18:45 ` Caio Henrique
2020-10-04 19:48 ` Jean Louis
2020-10-04 23:59 ` Qiantan Hong
2020-10-05 0:05 ` Qiantan Hong
2020-10-05 1:08 ` Karl Fogel
2020-10-05 4:40 ` Karl Fogel
2020-10-05 5:48 ` Jean Louis
2020-10-05 6:18 ` Qiantan Hong
[not found] ` <EC602765-9F1A-4269-9F2E-4F05C50AE1E7@mit.edu>
2020-10-05 8:07 ` crdt.el collaborative real time editing for Emacs Jean Louis
2020-10-05 8:22 ` Qiantan Hong
2020-10-05 14:03 ` Jean Louis
2020-10-05 17:05 ` Qiantan Hong
2020-10-05 18:17 ` Jean Louis
2020-10-05 14:11 ` Jean Louis
2020-10-05 9:39 ` Eli Zaretskii
2020-10-05 8:51 ` Jean Louis
2020-10-05 3:53 ` crdt.el - collaborative " Jean Louis
2020-10-05 4:02 ` Question collaborative editing - Wikipedia reference Jean Louis
2020-10-05 4:11 ` Qiantan Hong
2020-10-05 5:34 ` Jean Louis
2020-10-05 5:58 ` Eli Zaretskii
2020-10-05 6:15 ` Stefan Monnier
2020-10-05 6:51 ` Eli Zaretskii
2020-10-05 7:31 ` Ergus via Emacs development discussions.
2020-10-05 8:44 ` Jean Louis
2020-10-05 13:20 ` Stefan Monnier
2020-10-05 17:20 ` Karl Fogel
2020-10-06 1:03 ` Qiantan Hong
2020-10-06 1:41 ` T.V Raman
2020-10-06 8:52 ` Jean Louis
2020-10-06 17:32 ` Jean Louis
2020-10-20 16:15 ` Ergus
2020-10-20 17:11 ` Qiantan Hong
2020-10-20 18:51 ` Jean Louis
2020-10-26 20:36 ` Qiantan Hong
2020-10-27 21:54 ` Mathias Dahl
2020-10-27 22:45 ` Qiantan Hong
2020-10-29 16:21 ` Ergus
2020-10-28 16:29 ` Question collaborative editing - tools to connect Jean Louis
2020-10-28 16:40 ` Qiantan Hong
2020-10-28 17:13 ` Question collaborative editing - crdt.el, does it use SSL? Jean Louis
2020-10-28 21:51 ` Qiantan Hong
2020-10-28 22:36 ` Jean Louis
2020-10-28 23:08 ` Qiantan Hong
2020-10-29 5:43 ` Jean Louis
2020-11-02 9:47 ` Robert Pluim
2020-11-02 10:02 ` Jean Louis
2020-10-28 17:20 ` Question collaborative editing - torify emacs Jean Louis
2020-10-28 18:01 ` Qiantan Hong
2020-10-28 18:56 ` Jean Louis
2020-10-29 4:57 ` Question collaborative editing - tools to connect Richard Stallman
2020-10-31 4:16 ` Qiantan Hong
2020-10-31 5:33 ` Jean Louis
2020-10-20 18:21 ` Question collaborative editing - Wikipedia reference Jean Louis
2020-10-06 18:20 ` Karl Fogel
2020-10-07 0:00 ` Qiantan Hong
2020-10-09 1:50 ` Yuan Fu
2020-10-09 1:58 ` Yuan Fu
2020-10-09 2:12 ` Qiantan Hong
2020-10-09 2:42 ` Yuan Fu
2020-10-09 7:04 ` Qiantan Hong
2020-10-09 8:36 ` joakim
2020-10-09 13:33 ` Joe Corneli
2020-10-09 15:33 ` Qiantan Hong
2020-10-11 17:49 ` Qiantan Hong
2020-10-11 18:21 ` Eli Zaretskii
2020-10-11 18:26 ` Qiantan Hong
2020-10-11 18:56 ` Eli Zaretskii
2020-10-11 19:57 ` Qiantan Hong
2020-10-12 2:26 ` Eli Zaretskii
2020-10-12 3:22 ` Qiantan Hong
2020-10-12 14:40 ` Eli Zaretskii
2020-10-12 16:53 ` Qiantan Hong
2020-10-13 13:31 ` Yuan Fu
2020-10-11 18:40 ` Joe Corneli via Emacs development discussions.
2020-10-09 17:46 ` Jean Louis
2020-10-09 17:50 ` Qiantan Hong
2020-10-09 20:31 ` Karl Fogel
2020-10-10 17:09 ` Qiantan Hong
2020-10-09 7:09 ` Qiantan Hong
2020-10-05 5:50 ` Eli Zaretskii
2020-10-05 3:10 ` Richard Stallman
2020-10-20 16:37 ` Aurélien Aptel
2020-10-20 18:41 ` Jean Louis
2020-10-26 19:47 ` Eli Zaretskii
2020-10-26 20:26 ` too many Jean Louis
2020-10-28 4:45 ` Question collaborative editing - Wikipedia reference Richard Stallman
2020-10-28 15:08 ` Eli Zaretskii
2020-10-28 16:20 ` Jean Louis
2020-10-28 16:33 ` Eli Zaretskii
2020-10-28 16:59 ` Jean Louis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200930231159.q6h6etboucwkjcfe@Ergus \
--to=spacibba@aol.com \
--cc=bugs@gnu.support \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=fmfs@posteo.net \
--cc=kfogel@red-bean.com \
--cc=monnier@iro.umontreal.ca \
--cc=npostavs@gmail.com \
--cc=qhong@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).