2 ms·
attacking the problem of improving shell scripting while attempting to keep the syntax (Oil author here) Slight correction, The project has two parts (1) OSH
by chubot 5y ago
attacking the problem of improving shell scripting while attempting to keep the syntax
(Oil author here) Slight correction, The project has two parts
(1) OSH (bin/osh) will run your existing scripts, so in that sense it does keep the syntax
(2) The Oil language (bin/oil) is an upgrade from OSH, but it can also be thought of as a clean slate language:
https://www.oilshell.org/release/latest/doc/oil-language-tour.html https://www.oilshell.org/release/latest/doc/oil-language-tou...
It's really the same interpreter with a few parse time and runtime options. There were surprisingly few compromises (probably the biggest one is the shell-like string literal syntax, which I mention.)
The biggest changes are that we take over ( ) and { } , so you can write stuff like:
if (x > 0) {
echo 'positive' | tac
}
Rather than
if test "$x" -gt 0; then
echo 'positive' | tac
fi
We add a Python-like expression language between () and surprisingly few things need to change to make it feel like a "new language".
Thanks for mentioning Oil :)