unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Yuan Fu <casouri@gmail.com>
To: Arne Babenhauserheide <arne_bab@web.de>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: A new collaborative editing package (maybe tangent)
Date: Sat, 30 Dec 2023 12:09:36 -0800	[thread overview]
Message-ID: <A3FC8242-B4CE-4753-998B-88A96B2612CB@gmail.com> (raw)
In-Reply-To: <trinity-7d21227a-7162-4973-bf80-ef40c718d947-1703926590659@3c-app-webde-bap33>



> On Dec 30, 2023, at 12:56 AM, Arne Babenhauserheide <arne_bab@web.de> wrote:
> 
> Yuan Fu wrote:
>> My goal for collab-mode is for it to be a p2p, cross-editor, real-time
>> collab editing package (Emacs collab with Vim!). It works kind of like
>> language servers (LSP): a local “collab server” (called collab
>> process) talks to the editor over JSONRPC, and collab processes talk
>> among themselves over the internet. Most of the hard work is done by
>> the collab process and the editor end should be relatively easy to
>> implement.
> 
> This sounds pretty interesting!
> 
>> As of right now, collab-mode has these features:
>> - Sharing a plain text file
>> - Sharing a directory (still have rough edges)
> 
> Does it work well with editing modes? Plain text can be a loose definition with Emacs :-)

Plain text as opposed to rich text (which is usually stored in some internal tree structure).

> 
> Example: When I run a plantuml code block in an org file in a shared directory, will the other side see the generated diagram inline?
> 
>> - Undo & redo (linear)
>> - Builtin NAT traversal
> 
> How do you achieve NAT traversal?
> (that's interesting to me from a technical / sharing techniques viewpoint; would love to pass it on to students in a lecture in spring)

I used webrtc. Rust has a native implementation for it, other languages probably have bindings to libwebrtc. Specifically, webrtc uses ICE (and STUN and TURN) protocol for NAT traversal, and webrtc itself defines a data channel abstraction on top of them.

The stack roughly looks like this:

-------------------------------------
Data channel protocol
-------------------------------------
SCTP - congestion and flow control
-------------------------------------
DTLS - security
-------------------------------------
UDP & ICE - transport & NAT traversal
-------------------------------------

> I've seen that you use a signaling server, does this manage to enable direct connections between two NAT'ed computers?

Right.

> 
>> |🧚 No shared docs, not here, not now.                      |
>> |Let’s create one, and here’s how!                          |
> 
> I would suggest "here is how" instead of "and here's how".
> That better matches the rhythm of the first line :-)
> 
>> |🧚 Your file is shared, and here’s the link                |
>> |Anyone can connect with just a click!                      |
> 
> Anyone -> All
> (also for rhythm)
> 
> Though that's less precise, since if "All" tried to connect, they would likely break something.
> 
>> Help with rhymes
>> ================
>> 
>> I hope you don’t find the fairy and her bad rhymes annoying. I’m not
>> very good at rhymes, chatgpt is even worse. If you can come up with
>> better ones, please do send them along :-)
> 
> I hope the suggestions help :-)

Thanks, they help a lot :-)

> 
> How could I run a signaling server myself?

In the repo there are actually two binaries. One is collab-mode, the other is collab-signal, the signaling server.

You can run the signaling server by 

    make signaling

Or equivalently 

    cargo run --bin collab-signal -- run --port <port>

Yuan


  reply	other threads:[~2023-12-30 20:09 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-30  4:22 A new collaborative editing package (maybe tangent) Yuan Fu
2023-12-30  5:28 ` Karl Fogel
2023-12-30 10:56   ` Philip Kaludercic
2024-01-02  3:16     ` Richard Stallman
2023-12-30 19:49   ` Yuan Fu
2023-12-31 15:33     ` T.V Raman
2024-01-01  4:35       ` Yuan Fu
2024-01-01 15:49   ` Richard Stallman
2024-01-02  3:54     ` Yuan Fu
2024-01-05  4:22       ` Richard Stallman
2023-12-30  8:56 ` Aw: " Arne Babenhauserheide
2023-12-30 20:09   ` Yuan Fu [this message]
2024-01-01  3:32     ` Richard Stallman
2024-01-01  4:53       ` Yuan Fu
2024-01-01 23:09         ` Stefan Kangas
2024-01-02  3:45           ` Yuan Fu
2024-01-04  3:59         ` Richard Stallman
2024-01-04  8:02           ` Dr. Arne Babenhauserheide
2024-01-05  0:33             ` Yuan Fu
2024-01-06  4:33               ` Richard Stallman
2024-01-06  7:14                 ` Yuan Fu
2024-01-08  3:48                   ` Richard Stallman
2024-01-09  2:49                     ` Richard Stallman
2024-01-06  4:33               ` Richard Stallman
2024-01-06  7:17                 ` Yuan Fu
2024-01-08  3:48                   ` Richard Stallman
2024-01-07  4:28             ` Richard Stallman
2024-01-07  4:28             ` Richard Stallman
2024-01-07  7:06               ` Yuan Fu

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=A3FC8242-B4CE-4753-998B-88A96B2612CB@gmail.com \
    --to=casouri@gmail.com \
    --cc=arne_bab@web.de \
    --cc=emacs-devel@gnu.org \
    /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).