Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I know I'm late to the party, and that a lot of work has gone into the Steel plugin system, but I only learned about Helix recently, and I had an idea for a different way to implement the plugin system. I'm a big fan of minimal software, and the idea of embedding a Steel interpreter in Helix is not my cup of tea. Though, with the plugin system I'm proposing, it would be possible to write a plugin which loads Steel-based plugins, so that plugins which are written in Steel could depend on this Steel-loader plugin to load them.
Design
This is very much a work in progress, but it's much simpler, and possibly more versatile than the Steel plugin system. It was inspired by the Hyprland plugin system, and loads plugins as dynamic libraries. Plugins can be configured in TOML and can respond to config reloading. Plugins can have access to all Helix internals simply by adding the relevant projects as dependencies. Maybe there could be a helix-lib crate which re-exports everything for ease of use and compiles to a dynamic library so that plugins can share it.
In terms of plumbing with Helix, I think I will aim to use the
PluginSystem
interface as implemented in the Steel plugin system.Sandboxing
There's been some talk about sandboxing plugins. I don't think it's necessary to sandbox plugins, but it wouldn't really be possible with this plugin system.
Distribution
Plugins are defined by their TOML file
hx.toml
. They can be binaries or source code. Among other things, the TOML file can specify build dependencies for the plugin to get built when Helix loads up. Otherwise it can point to a pre-built binary. Users can specify a list of plugin sources in their config, which could be Git repos, GitHub releases, or other arbitrary HTTP URLs. After fetching from a source, Helix would read it'shx.toml
and do what's appropriate to load the plugin.Plugin examples
Can be found at https://github.com/zacoons/helix-plugins