What is funny is that a shell script does a pretty good job at giving you a nice, programmable way to invoke software. But, that is too complicated :-)
What is funny is that a shell script does a pretty good job at giving you a nice, programmable way to invoke software. But, that is too complicated :-)
In fact I mention the spaces issue in the The Simplest Explanation of Oil:
https://www.oilshell.org/blog/2020/01/simplest-explanation.h...
More: http://www.oilshell.org/blog/2021/01/why-a-new-shell.html
You can use it right now as a dev tool. If you use ShellCheck to statically check it, then running your script under Oil is complementary (and it also has some static checks): https://www.oilshell.org/why.html
The cloud is basically built on top of Linux distros, so that part is easier to change and is rapidly evolving.
You could say that the = issue is deliberate, but I'd say the core problem is that shell didn't start out as a programming language, or at least it was a very impoverished one without variables.
The original paper from the 70's on the Thompson shell shows that. Shell had "goto" but no variables! So name=value had to be grafted on later without breaking too many things. Words were already split by spaces, so I guess they just made
name=value
a "pseudo-word" that becomes an assignment, whereas name = value
remained 3 words.I remember one project that started out with simple XML config, then I added conditionals. when I was starting o work on loops and reusable variables I realized that I was writing a programming language in XML. So I started to write config in C# and compiled that dynamically instead.
I implemented a simulation framework once, where the core simulation process took in all parameters as command line options. A runner program would read a YAML file describing the parameters in arbitrarily complex ways, and invoke the sim process potentially thousands of times (doing parameter sweeps). The intent was for the underlying sim process to always be directly runnable for debugging just by copy/pasting the generated list of options, regardless of how complex the config file got. It was a year or so before somebody started passing in an intermediate config file to the sim process by command line argument...
For example, there was an ANT library for JRuby that worked super well for using ANT constructs/libraries but in a sane language.
What's old is new again :)
Ha, I agree, although I also think shell is a bit impoverished. It works but there are valid reasons people don't use it.
I hope to add the "missing declarative part" to shell in https://www.oilshell.org :
https://lobste.rs/s/6oxpe3/s_lot_yaml#c_mje209
Prediction: we'll see a lot more shell embedded in YAML in the coming years, with the same examples shown in the original article (Github Actions, didn't know about Helm Charts)
IMO we should get rid of the YAML!
https://lobste.rs/s/v4crap/crustaceans_2021_will_be_year_tec...