-
Notifications
You must be signed in to change notification settings - Fork 249
Scripting support #48
Comments
I can do the first (I have done it in the past, and removed it). Ios_system is already scanning the $PATH for script files. Arguments might be tricky but seem feasible. |
Is is written in stone that Not saying you should do this work, but do you see some roadblocks that make it extra hard compared to python and latex that you managed to port? This would add support for
Both fish and bash are GPL but zsh and tcsh looks to be compatible with the app store from a licensing standpoint. |
There are no strong objections to embedding a regular shell, beyond a) it was hard to compile every time I tried and b) it would work better with interactive connections with the terminal. Except for running script files, of course. I didn't think of that. By the way, there are variables in iOS_system (access with setenv / unsetenv). |
There are definitely things that could work better, by building out shell functionality to match the UI setting instead of plugging in a legacy shell, but it just seems like such a gigantic task. |
Some thoughts on scripting in OpenTerm: This may sound crazy, but I'm currently considering writing a scripting programming language for this purpose. It would be similar to The Lioness Programming Language. The implementation of Lioness uses bytecode, but for the purpose of this scripting language, compiling to an AST and "walking" it would suffice. What do you think? |
I agree that file-based scripts sounds the most useful. No matter how the scripting language is, there will be some users that would really want their existing scripts to work with no modifications. They will push for 100% compatibility with |
Awesome feedback guys, happy to see that my scripting support PR was merged. Some thoughts here:
The scripting & command running architecture in that change is designed to be extended (it's just a protocol to conform to). If anyone wants to add support for a different scripting language, it should plug in nicely. |
Both Lua and Python would fit the scripting goals (loops, variables, control statements, interpreted...) and are already ported. Lua is more standalone, Python requires a bunch of packages to be installed. Both can call shell commands (using system()). |
I'm gonna go ahead and create a new language specifically for scripting in OpenTerm. In theory we could support multiple languages, so Lua and Python are still future options. |
So now that Cub and SavannaKit are out I would like to have an open discussion about how script are supposed to work in OpenTerm. Creating and editing scripts Running scripts Also: I currently haven't required Cub script files to be executable (so no need for |
Fyi: I've pushed a working scripting prototype to the |
Awesome stuff, @louisdh!
Unless we think that users would need scripts in a directory hierarchy, then letting them place the scripts anywhere might be better. I personally think keeping them all in a single directory is fine, that way we don't have to implement a search path & recursively search for scripts in the container. Keeping them in the
Assuming that we are only planning on a single scripting language, then I don't think we need a cub command, and can instead make scripts run like any other command. Here's the options:
I prefer the last option. |
Additionally, I have some comments to your changes in the branch. Perhaps open a PR, so I can review? |
PR: #75 |
Since this app is taking the route of writing its own shell (instead of trying to recompile bash/zsh/fish/etc), it'd be great if that shell would support scripting. I have a few proposals:
File-based scripting
For example. I would like to write a script to create a new directory and cd to it:
In order for the above to work, a few features are required:
GUI-based scripting
While file-based scripting is closest to what other shells do, since this app is geared towards touch screen users on iOS, it might be a better experience to create a GUI, similar to the existing History panel, that contains user-defined scripts.
The text was updated successfully, but these errors were encountered: