Builtin, Prompt, and Syntax Plugins
I've a few ideas for what we could do in regards to plugins. We could have a directory for Ion at ~/.config/ion/, and in this directory we can have a plugins directory. Within the plugins directory we could have a prompts, builtins, and syntax directory that each would store dynamic Rust libraries.
When the shell is launched, libraries in the builtins directory could be scanned to import additional builtins into the shell as the
Shell struct is created.
We could have an extra variable,
PROMPT_PLUGIN, that when set to a value, will attempt to execute a library of that name to get the prompt string.
We could perhaps get some inline plugin action, similar to Rust macros, by designating some grammar for invoking a plugin and letting the plugin evaluate that expression how it sees fit. Perhaps something like the following, where a library named
map is invoked.
echo #![map x -> x + 5, @integers]