From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ergus Newsgroups: gmane.emacs.devel Subject: Re: Question collaborative editing. Date: Wed, 30 Sep 2020 02:13:33 +0200 Message-ID: <20200930001333.g6b3mqa4mdsoxiue@Ergus> References: <20200925002239.fgg3vw2nylltcoyp@Ergus> <219042AC-556D-48CC-8920-82D9BF2BD3AA@aol.com> <3A81FB67-A558-4281-8285-CDD9B01033E3@posteo.net> <1C949FC9-6023-467E-99EC-75D57B08AFB0@gnu.support> <20200929124513.fd745r2txowwbiir@Ergus> <87blho7af9.fsf@red-bean.com> <20200929215849.zg4wzytbrwx2b7ih@Ergus> <84B86B7C-81F0-42DF-894C-BF577E4B3D6E@mit.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8856"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Karl Fogel , Emacs developers , Fermin , Noam Postavsky , Jean Louis , Stefan Monnier To: Qiantan Hong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Sep 30 02:14:57 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kNPlo-0002Ac-W9 for ged-emacs-devel@m.gmane-mx.org; Wed, 30 Sep 2020 02:14:57 +0200 Original-Received: from localhost ([::1]:39108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kNPln-0002An-V6 for ged-emacs-devel@m.gmane-mx.org; Tue, 29 Sep 2020 20:14:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47808) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kNPkq-0001iu-4G for emacs-devel@gnu.org; Tue, 29 Sep 2020 20:13:56 -0400 Original-Received: from sonic302-3.consmr.mail.bf2.yahoo.com ([74.6.135.42]:33756) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kNPkj-000659-Q2 for emacs-devel@gnu.org; Tue, 29 Sep 2020 20:13:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1601424824; bh=Le9tAF6POBeFLR4XaLoAfL1dFomJwhTzJuoGsnd6XCM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=OrRvo8m+/4Cggbdj+yAo8T7UUqIZQn5aVMPZyVdCRg79TWUo2i49t8Ts7+FiGl4BSF0vpUDG0iZt5yIM6KrDS4KG4kAdd0x1HMEHCYjDhEukiYltXX8+171SsOf4kdWzYubSfVSBSGHERVl7sd2uN9wnAi3j+p0NYQd69JTMyF0psR6+2zs9v7psBQVRofJ8Sk0/oISv1qOjeELvgbKJCC1DG7OvLBhJNBXIORagdqjQdf2L7YxX38e3p8adKwVdfmoHm2xYuKEG0MwKusPY/NfrAKlGkslNZT35VInD2w5vSF7rbT3I7PV8rb3mIao5m3Am0+v7nEK4d/E5NF+Jbg== X-YMail-OSG: xXSIjEYVM1m0uSy2o9uB705F.G1to9YJAzLAnBdbeAa5DzgQayOQsLeMghgfbLD 5ZlFyi7cTi_d3AR72u8HcI5OrFVVDX1kP.Gk9O57BWSjENskhlWloQpNhNMPPlTCRRSYuN3xLCJL y.mCG0TE5kBDwmnB3jvG34Te4N5q5_qbyvQ7AU3oGq9Wp4fShqmV9SnUGtvqNCih2JGA3yt5X8Un DfyQA1lN.2dCjEc49iofnn8GiQCLvAP4TbkHOjtcmU5eHR_c19Fnj_LHcx93YZdTPQbPRcTFkWdg FyXnPoCKZnXpzn2k2gxNfNA2Pv3AksL2A9HIceR0eVDLbphJlQ9G0SUPdvL70tVjHXU8CSz9gObg fVMWxL3eiojxlAC3ElU.0JgpDQ_HX_c8ivZHYqHAw5I2sX4t_LWH8yZhdpAJarv1h5l4MiWy_pf. wtQyxtKVhK7AjqxsNER1xh_S4sbGq7yekqH9N.c3Mff5NWtJmursuv9T0rBbFs2XFauI.p1Omewq nvD_6cnLE15E5EICXvW3p57v0WiEFaylFmhsQ8.tg42uG27nvpYuvOOBzcFg9.Ic55wzqgGV9INx 7GlkMQguAkId8dsAI0AZQuYLX_gtBIDbHmQzFYL..h6IRjyxD_hiuHWK22gsWJQe..l7hlYFPRvA dCroVp1WWwmrWtHDnLJnuYjKCi3Xmu_BytwFP64MnA6oh.uEMScqJYsLVBns4i2Mz9N.REdLMjZr 9dEVIZO7Hh4FWkUQxLMbXRLlTTUbrqvlyvY8WXbN.ki1vX4MCqVykRMjk9L1PegVdyAKPMK2w8kA 8AZMv9dufh0TmKikEJSAC5zrKbt1kEdJyT4ATMkv.r Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.bf2.yahoo.com with HTTP; Wed, 30 Sep 2020 00:13:44 +0000 Original-Received: by smtp411.mail.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID d35803f4a415a72053141788c6249910; Wed, 30 Sep 2020 00:13:42 +0000 (UTC) Content-Disposition: inline In-Reply-To: <84B86B7C-81F0-42DF-894C-BF577E4B3D6E@mit.edu> X-Mailer: WebService/1.1.16718 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol Apache-HttpAsyncClient/4.1.4 (Java/11.0.7) Received-SPF: pass client-ip=74.6.135.42; envelope-from=spacibba@aol.com; helo=sonic302-3.consmr.mail.bf2.yahoo.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/29 20:13:44 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.614, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:256737 Archived-At: On Tue, Sep 29, 2020 at 11:40:53PM +0000, Qiantan Hong wrote: >> In the library level we could (and maybe should) implement both (OT and >> CRDT). This will only require a hint from the server side (or the >> connection starter client) to inform the client's libraries "what to use >> this time". Then practice will say what's better. >> >> ATM we could start with a C library in order to provide a nice free >> back-end editor agnostic. Because IMO the most interesting part of this >> will be to open emacs to interact with other editors with a free >> infrastructure emacs-centric. > >I’m not sure if it’s easy (or worth the effort) to provide CRDT in an >editor-agnostic way from C-level. Seems that the most natural >choice is to tag characters with CRDT data structures. Emacs has >text property which is very suitable for this, and I’m implementing >it in this way as an Elisp library. However, this relies on the particular >data structure for buffer/text emacs uses. > Oh; I get it. I would be concerned about the performance (but I am paranoid about Emacs performance anyway so don't worry for that). AFAIR emacs buffers are stored in a contiguous way (I may be wrong) and in that case the search with CRDT may be expensive. At least as it was explained here (in the optimization section): https://conclave-team.github.io/conclave-site/ Unless some extra optimizations are implemented of course. >If implemented as a separate C library, I imagine the CRDT library >need to have its own buffer/text data structure and somehow keep >in sync with Emacs’ .. doesn’t sound so clean. Agree. That was exactly my idea. Keep all that in the library and emacs just processes the final translated outputs with absolute char positions from the json. I took Tandem as the starting point in my considerations... But you may be right. If it is easier to implement and works; it may be fine and simpler than what I had in mind. Best, Ergus