167 points by lagertha90 6 months ago flag hide 18 comments
tnyznik 6 months ago next
Fantastic write-up! I’ve been experimenting with CRDTs in my projects lately. They offer such a robust solution to consistency issues without requiring a central authority. Real-time collaborative text editors are, of course, the perfect use case. I’m curious about your experiences building in WebAssembly. How has that worked for you?
jmtommi 6 months ago next
WebAssembly has been a game changer for real-time collaboration. I was initially skeptical because of its limitations, but it's exceeded my expectations. It's so easy to optimize performance using WebAssembly. I recommend setting up a build pipeline for ahead-of-time compilation, which significantly improves the startup experience. Debugging is a treat as well, especially when using browser debuggers! The wasm-bindgen library is also a pleasant addition to the ecosystem, smoothing out the Rust/JavaScript integration process. Definitely check it out!
goingbasync 6 months ago prev next
Nice! I’ve been using the Rust and WebAssembly combo for a while. In fact, the new async/await feature makes it even easier to create responsive and smooth collaborative text editors. I am interested in seeing this showcase. We recently added CRDT support in our product, and it made our application shine. Great job! DM me the link if it's not linked in the post.
jmitchel 6 months ago prev next
The real-time collaborative tool that I built in-house at my company has been a massive success! In fact, it's a CRDT-powered text editor just like yours, and my team can't get enough of it. I wish we had known of this implementation earlier! However, there's one thing I would suggest: throttling the communication during idle times. Besides the offline-first approach provided by CRDTs, it can noticeably improve collaboration efficiency, especially when multiple users are interacting simultaneously. Cheers to your work!
rapham 6 months ago next
Wow, that's an awesome setup you've got there! I like the tip you mentioned about throttling. It's smart and makes perfect sense. I feel like it’s one of those little optimizations that can genuinely improve the experience for a team. Is your CRDT implementation open source by any chance?
cyberfloyd 6 months ago prev next
WebAssembly and CRDTs; that sounds fantastic! I wonder what the potential impact on collaborative real-time 3D modeling could be. I see a lot of similarities between 3D modeling systems and this text-based approach.
zachleat 6 months ago prev next
This is a perfect reason to learn WebAssembly! CRDTs can be a powerful tool for resolving conflicts, which I’ve learned can be tricky with traditional approaches. Have you wrote any blog posts about using this tech stack or building a similar collaborative editor? I’d love to read it!
jmtommi 6 months ago next
@zachleat I actually wrote a quick blog on the topic! Check it out: [CRDTs and WebAssembly: A Fresh Take on Real-time Collaboration (yourblog.com)](https://yourblog.com).
masterypika 6 months ago prev next
Thanks for the detailed insights into using CRDTs and WebAssembly! I'm especially impressed at how well this works for real-time collaboration in text editors. How do you address metrics and analytics, though? Think usage patterns, predictive analysis, and so on. Just curious to hear your thoughts!
tnyznik 6 months ago next
@masterypika We've been experimenting with integrating Keen.io and Honeycomb, which has allowed us to monitor usage patterns, identify latencies, and make improvements along the way. I recommend using an ETL (Extract, Transform, and Load) process to preprocess your data before loading it into the desired analytics tool. This allows you to clean up, reorganize, and extract needed insights before examining trends to make data-driven decisions.
sabesan 6 months ago prev next
Hey there, I just noticed a critical bug in the WebAssembly code generation. It appears when using the toString operator, and I’ve been facing challenges trying to debug it. Any ideas?
danorig 6 months ago next
@sabesan Many have come across similar issues when dealing with WebAssembly bindings and conversions. When using JavaScript objects, you must be cautious about direct conversions or use add-on libraries like wasm-bindgen, which simplifies the conversion process. I recommend reviewing your code and re-examining theToString operations. If you want more personalized support, consider direct messaging me, and we can dig into the details.
paceaux 6 months ago prev next
really impressed with this implementation and the article. It's well-researched, informative, and written at a level that is approachable. And while I don't have extensive experience with Rust and WebAssembly, I found the post accessible and engaging. I hope you'll work on more content like this!
solateor 6 months ago prev next
I've been following this thread and helped build a collaborative code editor internally. We've been using CRDTs, with fantastic results. I think there's a gap in collaborative editors for live language interpreters, like Python. I’m curious if you've seen open-source projects addressing this?
zephreal_ 6 months ago next
@solateor That's a great idea! I haven't explored anything like a live-interpreted CRDT-based collaborative editor. However, I've seen Orchestrate.io, which is a real-time multi-user collaborative IDE using Github's Easel, which is a CRDT-based replication library. As far as I'm aware, it uses a custom server setup providing a shared context between remote users. You should check it out!
prabiro 6 months ago prev next
CRDTs and WebAssembly for real-time text collaboration is an innovative combination. Now, I'm curious about one more thing: are you using a similar mechanism for real-time video and audio collaboration as well? I'm planning a Google Meet-style collaborative platform, and I can't seem to wrap my head around it. I’d appreciate any pointer or idea.
slavauniverse 6 months ago next
@prabiro For real-time video and audio collaboration, you might want to explore Jitsi. I had success using this open-source platform for a project. Take their FPGA hardened platform and add in some WebRTC for browser support to create a service like Google Meet. Hope this helps get you started!
loganhoellein 6 months ago prev next
CRDTs have the potential to replace traditional synchronization methods for real-time collaboration. I've worked on WebRTC lately, and I believe it makes an excellent complement for CRDT. I'm confident we'll see even more incredible innovations in this space. Thanks for sharing your journey and experiences.