Editor Written in Rust

This is complementary to development in SAFE, for sure:

Actually, it has two parts (three if you count future plugins): A back-end written in Rust and a front-end in whatever development language is native to the platform, with plugins written in anything. The interface between the parts is JSON-RPC.

I came across this while looking for an alternative to Sublime Text 3, which is very good in most respects but has some niggling aspects.

I love the stated goals of Xi, which are exactly what I wish for. They will probably be successful although the project is only a few weeks old, so only partly built. The back-end compiles on my Linux machine but there’s nothing to see when it runs, no front-end yet for Linux, and I’ll have to wait for them to publish some more clues.


This is still a project in its early stages. The Mac build has basic editing functionality (it was used to write this README), but looks very spare and is still missing essentials such as syntax highlighting and auto-indent. At the moment, it’s expected that its main community will be developers interested in hacking on a text editor.

Call me old-school, but I can play around just fine with vim and my own personal dotfiles. Mosh is looking better and better these days BTW.

JSON. The protocol for front-end / back-end communication, as well as between the back-end and plug-ins, is based on simple JSON messages. I considered binary formats, but the actual improvement in performance would be completely in the noise. Using JSON considerably lowers friction for developing plug-ins, as it’s available out of the box for most modern languages, and there are plenty of the libraries available for the other ones.

#####^This is very good reasoning

That’s how you create a protocol people. Phew.

1 Like

I’m still hazy on RPC, and whether the JSON piping in this project is something else.

There is a (very) basic Linux front-end now, at xi-glium (also in Rust).

I have used Sublime Text 3 for a while. I never liked the mass of shortcuts that Vim required me to memorize, since I didn’t use it often enough for them to become automatic.

1 Like

New information about its internal communications protocol: https://github.com/google/xi-editor/blob/master/doc/frontend.md

The front-end starts the core process and communicates to it through stdin and stdout. At the outer layer, messages in both directions have a binary framing protocol, consisting of an 8-byte length in little-endian order prepended to the message. Currently, the message is JSON, and encoded in UTF-8.

When the front-end quits, it closes the stdin pipe, and the core is expected to quit silently.

This is excellent news for me, well-versed as I am in shell scripts. It really is piping in the sense I’m familiar with.

This solidifies what was merely an intuition for me: that this ground-breaking project is worth following by SAFE app developers because it has parallels with the SAFE ecosystem: back-end written in Rust, front-ends written in user-interface specific languages, and plug-ins that might have all kinds of purposes. And the communication between them to be adapted by experience to make it both efficient and developer-friendly.

I don’t expect it to be a replacement for Sublime Text any time soon; that’s not the point.