Friday, November 30, 2018

I like the Windows Power shell

I have not looked far into it, but I get the basic concepts and keep the framework in mind.  We need a GNUPowerShell, and I give it these specific requirements:

  • Combine standard argument syntax for commands with scripting controls to make one general parse that produces command line sequences of the form:   cmd arg1 arg2 ..;
  • Deliver arguments in a full duplex argument list of type void * argv[].Upgrade arguments to first class variables so that the command can be sub classed while keep most of the call structure.
  • The shell maintains its own environment variables.  Subcommands are free to access system variables.
The shell is disconnected from subsystems, it is just a full duplex channel. Hence, leave it in c, the inheritance is informal, the code base not likely to exceed 1500 lines, a single package, easy to compile.  Then use the dynamic loader to get specific subsystem commands into the system, as needed.  Dynamic loading here works fine because the call interface does not change, the older versions of a sub shell still functions at the shell level and problems easily diagnosed.

Existing commands can be easily adapted at the subsystem level. If they cannot accept the call format, the the subsystem easily reconstructs the format it needs.  But most commands need to decompose the arguments into system calls anyway and would prefer the arguments pre-parsed by the shell.

My shell is mostly an incomplete version of this, just enough implemented to get me through testing join.  Join needs a full command and control channel, no other option here. The GNUPowerShell idea needs to move forward as an open source project.

No comments: