Rust: My secret weapon for code reuse in desktops, mobile, and web
My own independent alternative to Google Docs reuses Tunc WebSocket communications to deliver co-editing features in native Hub and the browser. Tunc Rust code rebases anchored changes and reports explicit conflicts. The
My own independent alternative to Google Docs reuses Tunc WebSocket communications to deliver co-editing features in native Hub and the browser. Tunc Rust code rebases anchored changes and reports explicit conflicts. The same editing rules support people and agents contributing to a draft.
WebAssembly runs shared Rust logic in the browser, with adapters for its APIs. It means that much of the Tunc codebase is shared between web-based Tunc Doc document editing and Tunc Hub desktop and mobile applications. That shared code covers real-time communications and data resilience; the same code runs in the web browser as WebAssembly, and also powers desktop and mobile on all platforms. All thanks to Rust.
We still have to handle stale state and conflicts carefully. Large agent changes can take an atomic storage path and appear after the next save or reopening, rather than arriving live.
Explore the service during the soft opening: https://tuncdoc.com/
The language and library maintainers make this reuse practical. Their work deserves credit alongside the service built on it.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.