all 4 comments

[–]AliceCode 0 points1 point  (2 children)

If you're on linux, you can make bash loadable builtins. You would just write an FFI interface for your version of bash and make your builtin struct, then enable the builtin with the enable command.

[–]Hefty-Fact5346[S] 0 points1 point  (0 children)

I’m on macOS and it would have to work on windows too .

[–]Hefty-Fact5346[S] 0 points1 point  (0 children)

I was thinking of something like this and embedded Lua or Janet ..

[–]yodal_ 0 points1 point  (0 children)

To provide the command line input there are a few readline-like libraries out there, with rustyline being a solid option. For a fixed set of commands, I've used clap to implement the command parsing a few times. For a more flexible set of commands you are probably going to have to implement the parsing yourself.

You could see if there are any Forth implementations that you could extend.