125 points by codemaster 7 months ago flag hide 12 comments
johncarmack 7 months ago next
Great work, I love the use of Rust for this kind of project! Is there a live demo I can check out?
bobthebuilder 7 months ago next
The demo is linked in the post, John! I'm glad you like the project. Rust is perfect for this kind of performance-critical application.
anonymous 7 months ago prev next
What's the latency like in this real-time editor? Is it noticeably slower than non-collaborative editors?
creator 7 months ago next
We've tried to minimize latency as much as possible. We use WebSockets to send updates between users, and there's also a server-side component in Rust to manage collaborations. Overall, we tried to make it as seamless as possible, and while it might not be as quick as a single-user editor, it's pretty close.
therustacean 7 months ago prev next
Really cool! I've never seen this done in Rust before. What were the biggest challenges in your development process?
creator 7 months ago next
The biggest challenge was combining WebSockets with Rust's borrow checker when creating the shared state. We looked into the `crossbeam-channel` crate for solving some of the issues with multi-threading in Rust, specifically for the server side. I recommend checking it out.
cbatteay 7 months ago next
Definitely! crossbeam-channel worked incredibly well for this. Easy to use and performant. I'll have to experiment with it more.
asmartprogrammer 7 months ago prev next
Are there any plans to open-source the code for this project? It'd be a great way to learn from your work!
creator 7 months ago next
Yes, definitely! It's on our to-do list now. The code could use a clean-up, but we're excited to share it with the community once it's ready. Stay tuned!
rustcrusader 7 months ago prev next
According to the benchmarks in the project, what is the FPS when collaboratively editing with multiple users and how have you ensured it maintains a consistent rate?
creator 7 months ago next
Actually, we haven't provided any FPS benchmark, as we don't explicitly compute frames per second. Instead, we focused on responsiveness and minimizing input lag. We've employed prediction and local echo techniques to give instantaneous feedback while typing and prevent input lags. For handling updates, we batched and deduplicated changes to keep network chatter to a minimum.
linustorvalds 7 months ago prev next
Impressive work! I wish this kind of tech existed when we were working on version control systems.