Urgent.News

What's breaking now, across thousands of outlets.

Tech

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 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…

A novel approach to code reuse on desktop, mobile, and web platforms hinges on Rust, a programming language that enables sharing core components across diverse applications. Tunc, an independent alternative to Google Docs, exemplifies this method by leveraging Tunc WebSocket communications for real-time co-editing features within its native Hub interface and web-based browser version.

The Rust codebase underpins the Tunc Doc document editing service and its desktop and mobile applications, ensuring consistent editing rules for all users.

Tunc Hub's shared Rust logic operates efficiently in web browsers through WebAssembly, an intermediary that translates Rust into a language understandable by web browsers. This compatibility allows the same editing features to function seamlessly across platforms, from web-based Tunc Doc editing to desktop and mobile applications.

However, managing stale state and conflicts remains a challenge. Large agent changes necessitate a more deliberate approach, often requiring storage of changes until the next save or reopening, rather than immediate delivery. Despite these complexities, the Rust programming language and its library maintainers have paved the way for this innovative reuse strategy.

Their efforts have democratized the development process, enabling different applications to harness the same underlying codebase and sharing the benefits of real-time communications and data resilience. A demonstration of this service is available for the public to explore at https://tuncdoc.com/.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

We lost our own benchmark the first time. Web search vs. one API call on 25 companies

If you build an agent that onboards suppliers or customers, sooner or later it has to check that a company is still registered, and that it isn't sanctioned or insolvent.

  • API call outperformed web search for 25 companies from 10 countries
  • API method fixed four bugs before second test, improving accuracy
  • Web search excelled in harder cases and well-known companies

Logistics Report Retention: Browser-to-Object Storage with Presigned Uploads

Short answer: for a logistics report that must survive an ordinary customer connection, use a presigned PUT for a small object and a presigned multipart workflow for a large one; use POST when a form…

  • Employ presigned PUT for small objects, multipart workflow for larger ones
  • Maintain upload privacy and accessibility until authenticated and validated
  • Browser transmits bytes directly to object storage, application manages report state

More from Sunday 15 November →