Thurbox v2 - part 3
The challenge of keeping a consistent interface.
Keeping Consistency
v2 should not remove cool features from v1 and it should keep what we tried to keep as much as possible in v1. That is to say keyboard shortcuts, mouseless navigation and features like global search should be preserved.
Thurbox should be responsible of keeping a functional and accessible TUI. A bad plugin should not fully deteriorate user experience. Thurbox kernel should clearly expose functionality for error messaging, shortcut configuration, pane navigation, reactive layout, focus and themes. Documentation should also provide tips and best practices.
Plugins
Retained implementation are nodes that we can compose with. Extensive nodes choices should allow plugin developer to add almost anything. Default primitives such as box, scrollbars, text will be supported. But also more complex ones: PTY, Custom animations...
Planned plugin implementation should support thurbox-doom!
Unlike harcoded TUI, plugins brings a new complexity: getting TUI layout and thurbox events.
In-process vs out-of-process
I might have mentioned already that I wanted to use typescript for plugin development. Neovim and other famous TUI are mainly using Lua. True question here is not really about language to use (one misleading argument is that LLM is better at coding typescript) instead it is about in-process vs out-of-process.
Out of process is adding by default extra overhead: bun, deno or quickjs must run. This extra overhead combined with inter process communication means performance issues. And for larger dependencies like bun it can also mean security issues because we are adding even more dependencies (more CVEs).
In-process brings improved performances by nature and can be lightweight, however typescript is not a good fit for this use case. Also sandboxing seems harder to setup but Luau (Roblox language) was designed to run untrusted code and seems to be a very good fit combined with mlua for in-process with thurbox. Furthermore, other TUIs are mainly choosing Lua when it comes to module/plugins. Neovim or yazi both very popular TUI did choose Lua for their custom plugins. Luau seems better on paper than Lua (gradual typing and security). Following same practice seems natural for thurbox TUI.
Did you enjoy this article?
Recommend it — Standard Reader surfaces well-loved writing to more readers across the network.