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

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

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ā€¦?]

The tech is independently intriguing:

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:

8 Likes
2 Likes

I am using code-server and while the Live Share is great for live co-editing, still the editing is active only while host is in session, looking for a way to get it permanently.
Also,I believe , the guest doesā€™r jave access to the fun tion in the codeā€¦

zed looks super cool and the conversation is very intersting : thank you for the link !

1 Like

Is that mature enough for daily use of Julia programing?

Itā€™s an open issue. Zed does not support Julia yet

No. I tried it last month, and even the basic syntax highlighting is not supported for Julia.

But please do comment / thumbs up on that open issue, to express your interest. That might nudge developers into prioritizing (or not) Julia support sometime in the future.

1 Like
6 Likes

Great! Maybe I induced someone to make that Julia PR, or at least you giving the link to it. It was less trivial than I thought, with many files added e.g. non-trivial ā€œcrates/zed/src/languages/julia.rsā€ and Scheme files (those seemed though rather trivial).

If only I could also influence someone making the Zed Linux port (for me; and Windows port, those are non-Julia specific, and already open issues on)

1 Like

If only I could also influence someone making the Zed Linux port (for me; and Windows port, those are non-Julia specific, and already open issues on)

For context, the PR was developed only on Linux because I donā€™t have access to a mac. So Zed on Linux is already a thing (although with rough edges).

4 Likes

The Zed team moved all open language issues (including the Julia one mentioned above) to the extensions repo this morning. I fear your PR wonā€™t be merged into the main repo.

Would you mind wrapping the tree-sitter grammar into an extension and adding the LSP later?

3 Likes