What news from AWS re:Invent last week will have the most impact on you?
Amazon Q, an AI chatbot for explaining how AWS works.
Super-fast S3 Express storage.
New Graviton 4 processor instances.
Emily Freeman leaving AWS.
I don't use AWS, so none of this will affect me.
Frontend Development / Software Development

Zed: A New Multiplayer Code Editor from the Creators of Atom

Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter. David Eastman takes the beta for a spin.
Apr 8th, 2023 5:00am by
Featued image for: Zed: A New Multiplayer Code Editor from the Creators of Atom
Image via Zed

“We bypass all this nonsense that occurs on the web. Keystroke to pixels!”

I was amused to hear this on a recent episode of The Changelog podcast. Nathan Sobo was talking about work on his company’s new code editor project, Zed. This is described as a “high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.” The term “multiplayer” tickles my game developer bones, but we’ll come to what it means (and the other bits) shortly.

As part of the games developer community, I don’t think looking for onscreen responsiveness is in any way exceptional behavior. For decades, however games were built, developers needed to squeeze updates onto the screen before a refresh cycle was complete. And the habit sticks. Back in the day, I worked next to a very early IDE project for game development (it ran on an Apricot PC), and speed was everything.

The web was always dependent on hardware improvements taking up the slack. So the decision of the Zed developers to develop their own UI framework is natural enough. As the developers correctly point out, a code editor requires a much smaller library of graphical “primitives” (i.e. lines, circles, etc.) to drive it.

You might have seen Warp recently, and this is also a rethinking of basic tooling — this time the terminal. (It happens that the founder of Zed worked on Warp for a short while.) But what most interests me is that Zed is the vision within a business.

Rather surprisingly, Zed is coming out of the blocks early thinking about a subscription model and a staffed company. At first, this seems an odd way to support an editor, but actually, it means they will have the resources to move forward with their direction of travel. Over the years, we have seen underfunded groups having to tack away from their original direction in the prevailing winds.

Under normal circumstances, I would ignore a startup that only targeted MacOS (as Zed does now) as being little more than a personal project, but as they have raised funds it seems reasonable to assume that this will be on Windows soon enough. But if you want to start on one platform for professional developers, MacOS is hardly a problematic choice. There is often a strong reason to get in early with new tools, to help guide their community and possibly move yourself into an early deal.

The history of Zed is interesting, as the idea for a perfect editor always seemed to be with Nathan Sobo while working with Atom at GitHub, but then it seemed like a dead end when Microsoft purchased it. Electron is now the most popular “cross-platform desktop application built with web technologies”.

I’ve often thought of Visual Studio being the jewel in Microsoft’s development offering, and no one would think of Visual Studio as being highly responsive. But in my mind, an IDE has a right to be a bit of a water buffalo, rather than a springbok — since it is carrying the bulk of developer effort.

But in professional use, it isn’t always possible or even desirable for an IDE to control the entire build pipeline; it is just required that with the right plugins, an IDE can reach into it. For example, I specifically don’t do any revision control on Visual Studio. Across an organization, mandating one tool to do everything is a recipe for revolt. And I am perfectly happy to use Sublime as my ancillary editor, especially to deal with JSON or HTML.

Anyway, back to Zed:

The shape of the editor is as expected — there hasn’t really been any innovation here for some time — but note the shell as a default window.

Running Zed is interesting. I fixed a minor error by making sure it runs my shell zsh correctly, which was easy enough to do.

In the config/zed/settings.json file,

Zed has a “sign-in” button top right, and while many developers may still find that a bit odd, many of the bigger products already do this — either for license reasons or just because they can.

Either way, I wanted to look at the collaboration features, so I signed in. This pushed me to GitHub; which as a first approximation is ok. They will have plenty of time to wonder if relying on a Microsoft gateway or a Google authenticator will guarantee them a safe route.

The idea of a built-in online collaboration is a good one. With the increase in remote working, the friction of simply opening the same version of the same file becomes significant. Yet, again, knowing that this will be a direction within a staffed company is encouraging.

I did want to test the collaborate features out by, er, collaborating with myself, but trying to sign in as a different user on the same Mac — even in a different Zed session — was beyond me. To really assess this I would probably want to do it “under fire” with another real collaborator trying to actually fix some code. But the available videos are pretty straightforward — you get straight to the code sharing without all the Zoom handshakes. Valuable.

Autocompletion is sensible and quick. Given access to some strong AI, this stuff will only get better. (Looking at their advertised jobs listing, they are trying to bring an LLM specialist on board) — and again I value that they will focus on getting the right engine and tuning it to their specifications.

The language ability is brought in from their OS project, “Tree-sitter”: “Regular expressions are the wrong tool for analyzing context-free languages.”

This statement hurts me deeply — but it is, of course, 100% correct. Grammar trees work in compilers, and they work well here to analyze a language without being language specific.

Right now, Zed doesn’t have language support for C# or Java. But again, that is because they are not challenging the big boys… yet. As I mentioned, I always run a simple editor to use for data text like JSON, so this is still ok for me. It quickly spotted trailing commas in my JSON.

Another throwback for me is that this is definitely aimed at typists, not mouse users. Now, for many (probably most) developers, that is hardly even worth commenting on. If you are paid based on your efficiency, obviously you type quickly. Visual Studio has to be kind to mouse users, given that it is a flagship product from the guys who commoditized WIMP (Windows, Icons, Menus and Pointers).

Multiple cursors works nicely, and give you the ability to make parallel changes in place, without having to do a search and replace. The one innovation that is worth talking about in detail is multi-buffers. The concept is simple enough: if you search for a term throughout your project, it will give you all the results in one page, but with separate active buffers (i.e. you can edit directly as if you were editing your file in a tab).

I opened my Blazor project and searched for “NavMenu”:

So, not only are the file dividers indicating different buffers, but those three ellipses on the left also mark separate buffers within the same file. So the search has created four buffers based on the code in and around the search term “NavMenu”. This means I can fix problems directly without changing tabs. And yes, those little arrows on the right will transport you to the tabs and position of the code. This is extremely useful.

So should you switch from Sublime? Probably the wrong question, as Sublime is not fixed in stone. But I think Zed marks out a possibly strong future for your “other” code editor. So at least give the beta a try.

Group Created with Sketch.
THE NEW STACK UPDATE A newsletter digest of the week’s most important stories & analyses.