22 comments

[ 2.7 ms ] story [ 69.3 ms ] thread
Looks nice and clean! Also feels very snappy in two tabs.

However, you're breaking the back button with your redirect to a unique room. Once in a room, pressing back will join a new room. History replace instead of push should be a better choice.

Thanks! And good catch, I'll fix that right away.
I really like the architectural decisions made in the project. OperationalTransform library may need some work like testcases and add more powerful constructs. Is there any theory behind it? Maybe add a link to it.

I believe this project can become a popular opensource project. It is really fast.

Thanks! Operational transformation is the same technology that powers Google Docs. It's been studied in academia for real-time collaboration since the 1990s and has eventual consistency guarantees. See the Wikipedia article: https://en.wikipedia.org/wiki/Operational_transformation

The Rust operational-transform library was not written by me, but it's listed on crates.io by spebern, and it's worked wonderfully so far. It seems to be a very close port of ot.js (https://github.com/Operational-Transformation/ot.js). The text transformation algorithm isn't very complicated (<700 SLOC including tests), but there's probably room for optimization!

Congratulations on shipping, what you have is very slick.

Quick question, not trying to start a flame war just genuinely curious. Why did you pick OT over other approaches to realtime collaborative editing such as CRDTs?

I'm not the author but I've written a lot of OT code. OT works great when you have a centralised server. Its fast and simple. I (and others) are working on it but there aren't many production quality, fast CRDT implementations in rust and other languages yet.
I'm also curious about CRDTs, but after making this project, I agree that OT seems to "just work" performance-wise and are super simple.
Stuck at connecting to server on iOS Safari.
What version of iOS? It works for me on my iPhone 8 running iOS 14.4.2.
6S running 14.5.1 works fine.
Thanks for making this, I have been looking for a worthy replacement of Etherpad for a long time, that is easy to use and has the option to be self-hosted.
Glad you like it! Etherpad is a big inspiration for me, and I hope to read into the code someday. They have a more sophisticated OT algorithm for rich text.
what do you see as the advantages of rustpad over etherpad?

can etherpad documents be exported, converted to rustpad?

Could end-to-end encryption be added (see cryptpad), or does operational transformation or some other design aspect require a central server?

What also comes to mind when editing source code is a non-browser participant which can actually run and test the code (or for other non-interactive backends, such as en external spellcheck).

Good question! I'm not aware of any end-to-end encryption scheme that commutes with OT, so probably can't do it as long as you have a central server doing transformations like Rustpad.

That said, if you use a sequence CRDT-based editor like Yjs, this avoids the central server problem entirely. Rustpad is a small branch-off of a longer-term project / product I've been working on which requires collaborative editing, so having a central server was part of the equation from the start.

(comment deleted)
Really nice and lightweight!

Some feedback:

1. I was not able to change color when setting user name. (Was it some browser extension blocking it?)

2. I was not able to run your docker image on pi (arm). The error is: standard_init_linux.go:219: exec user process caused: exec format error

Works fine otherwise on other platforms.

I'm not sure why you weren't able to change color. It shouldn't be blocked by a browser extension; it's just a button.

Unfortunately the Docker image is built on an x86_64 platform.

nice, is there any way to disable the auto-suggest dropdown box when you're typing?
It's hard to tell from the readme; can you expose an entire project directory (with terminal perhaps?) for collaboration?
Very cool! Thanks for sharing. Was binding Monaco particularly challenging?

I’m curious what the larger project/product is, if you are able to share.

I’ve used ShareDB (from @josephg in this thread) for a collaborative coding project with Jupyter as the execution backend. I just geek out seeing OT/CRDT projects in the wild :)