spacejam / automerge-rs

Rust implementation of automerge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Automerge

docs crates Build Status

This is a rust implementation of automerge. Currently this repo contains an implementation of the "backend" of the Automerge library, designed to be used via FFI from many different platforms. Very soon there will also be a frontend which will be designed for Rust application developers to use.

Using automerge-backend-wasm with automerge

This backend is tracking the performance branch of automerge

To build the wasm backend

  $ cd automerge-backend-wasm
  $ yarn release

Once it is built set the new default backend in your js application like this.

  const wasmBackend = require(path.resolve(WASM_BACKEND_PATH))
  Automerge.setDefaultBackend(wasmBackend)

Backend? Frontend?

Automerge is a JSON CRDT, in this sense it is just a data structure with a set of rules about how to merge two different versions of that data structure. However, in practice one often needs two separate roles when writing applications which use the CRDT:

  • A very low latency process, usually running on some kind of UI thread, which records changes made by the user and reflects them in the UI
  • A less latency sensitive process which executes the complex logic of merging changes received from the UI and over the network and send diffs to the frontend to apply

More details can be found here.

Note that the performance branch of automerge is under active development and is changing quickly.

Community

Development of automerge rust is currently beeing coordinated at our slack channel. Come say hi. =)

About

Rust implementation of automerge

License:MIT License


Languages

Language:Rust 89.7%Language:JavaScript 7.5%Language:C 2.1%Language:Shell 0.5%Language:Makefile 0.2%