Status Update: March 2024

Published on to joshleeb's blog

G’day! This month the focus has continued on building concept pieces for a code editor which now has a name. Ica. As in short for Icarus… the last guy that tried to build an editor and got burnt along the way.

Following on from last month, I added a new concept that takes the learnings from the CPU-rendered glyph atlas and renders on the GPU using skia with the Metal backend.

There’s a multi-line, editable textbox that supports smooth scrolling, and UAX#14 line wrapping thanks to the xi-unicode crate. And although there aren’t a lot of components being drawn to the window I also played around with texture caching.

Here’s a screenshot, and here’s the code

Figure 1. Screenshot of the concept for a GPU rendered glyph atlas and editable textbox. The font used here is MonoLisa.

The next pieces I wanted to figure out were layout, resizing, and how to structure components for building up a more feature-complete interface.

One of the ideas with Ica is for it to essentially be a terminal editor built as a GUI. For the interface to be heavily text and keyboard-centric and to avoid elements of other graphical editors that personally I find distracting. Much more like Emacs than VSCode.

The architecture I settled on is close to that of an immediate-mode GUI. And in the process I took inspiration from egui, though a key difference is that widgets and views aren’t constructed new for each frame.

Here’s a video, and here’s the code. The grey box on the left represents the sidebar, and the green bar represents the status bar. The colorful windows are buffers which are managed by a binary-space partitioning (BSP) container.

Figure 2. Screengrab of the concept for layout and resizing with binary-space partitioned buffers.

The main challenge here was figuring out how to nicely connect the BSP tree into the rest of the architecture to support layout and resizing. And while it works, the code is a mess. But conceptually it’s close to what I imagine the actual implementation will look like.

I am stoked that these concepts got to a demo-able state this month. But in thinking of where to go next, there are so many other pieces needed for an editor that it’s overwhelming. I am unsure if I should get started on Ica proper, or whether there are more concepts I should work on first: LSP-client and code diagnostics, vim-like bindings, text highlighting, Magit-inspired git client, and so on and so on.

But there’ll be time for me to figure that out next month.

That’s all for now, see you then!