Collaborative editing: Zed editor and conflict-free replicated data type (CRDT) abstract data type

Palli
Mon, 19 Feb 2024 18:44:47 +0000
Offtopic

zed.dev – 2 Dec 24

We Have to Start Over: From Atom to Zed - Zed Blog

Thorsten interviews co-founders Nathan, Max, Antonio in about the vision and the technological choices behind Zed, how they went from Atom and Electron to Rust and GPUs with Zed.

Zed editor from the people that made Atom editor (at the time the main Julia editor):

Zed

Zed - Code at the speed of thought

Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Save time and keystrokes by generating code with AI. Zed supports GitHub Copilot out of the box, and you can use GPT-4 to generate or refactor code by pressing ctrl-enter and typing a natural language prompt.

The Zed editor is very intriguing, supports many languages, most recently adding for Zig and OCaml, but the Julia issue for LSP is still open. You can still edit Julia without LSP support, as text, but it would be better to have it, and it may be an easy addition.

It will support Linux and Windows, but right now only supports macOS so I can’t try it, and it IS open source by now. It’s unclear to me if it provides VS Code compatibility, for extensions, or ever will e.g. Julia’s. Extensions are a TODO, so would you miss many from VS Code, or just a few? Which?

If you look at the site for Zed editor you will see benchmark claims, very fast, and low memory use, compared to other IDEs (not low mem use really versus editors e.g. vi).

It’s based on very intriguing tech, e.g. CRDT and more, and if you only need to edit locally it may be overkill. VS Code, and others already have AI features, but to work collaboratively CRDT seems very intriguing. I hadn’t heard of that class of (distributed) data types, only eventual consistency, though maybe it is overkill over consensus or other tech?

[Do you really need editors built like games, at 120 FPS…?]

Zed

Zed - Code at the speed of thought

Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

The tech is independently intriguing:

Conflict-free Replicated Data Types

About CRDTs • Conflict-free Replicated Data Types

Resources and community around CRDT technology — papers, blog posts, code and more.

arxiv.org

1805.06358.pdf

151.25 KB

conflict-free replicated data type (CRDT) is an abstract data type, with a well defined interface, designed to be replicated at multiple processes and exhibiting the following properties: (i) any replica can be modified without coordinating with another replicas; (ii) when any two replicas have received the same set of updates, they reach the same state, deterministically, by adopting mathematically sound rules to guarantee state convergence

https://inria.hal.science/inria-00555588/document

Replication is a fundamental concept of distributed systems, well studied by the distributed algorithms community. Much work focuses on maintaining a global total order of operations[24] even in the presence of faults [8].
[…]
An alternative approach, eventual consistency or optimistic replication, is attractive to practioners [37, 41].
[…]
In this paper, we study a simple, theoretically sound approach to eventual consistency. We propose the concept of a convergent or commutative replicated data type (CRDT), for which some simple mathematical properties ensure eventual consistency. A trivial example of a CRDT is a replicated counter, which converges because the increment and decrement operations commute (assuming no overflow). Provably, replicas of any CRDT converge to a common state that is equivalent to some correct sequential execution.
[…]
Since, by design, a CRDT does not use consensus, the approach has strong limitations; nonetheless, some interesting and non-trivial CRDTs are known to exist. For instance, we previously published Treedoc, a sequence CRDT designed for co-operative text editing [32].

Previously, only a handful of CRDTs were known.

https://zed.dev/blog/ai-continues-to-impress

Gemini 1.5 AI can now read very large codebases, so AI is very important going forward:

20 posts - 14 participants