Why Sponsor Oils? | blog | oilshell.org
Now that I've released the code, let's take a minute to look back. Here are the blog posts so far grouped into five general themes:
#
character
has five different meanings inside ${}
, and the /
character has three
meanings. I found an example of the latter in the
wild.()
vs. grouping { }
. Some
tokens that look like operators aren't actually operators.${a[0][1][2]}
.Future posts on shell trivia:
FOO=bar
and 2> /dev/null
$ myvar=123 > name=var > echo $((my$name * 2)) # name of a variable is dynamically constructed 246
The osh
language is mostly identical to bash
, and requires two tokens of
lookahead to parse.
It can be automatically be converted to the oil
language, which is still yet
to be defined. But I've given a sneak peek of oil
in some posts:
${var/pat/replace}
, discussed here@
splice operator, discussed heredo {}
and shell {}
Oil won't be just a shell, because Shell, Awk, and Make should be combined (example code).
Static Parsing is parsing up front, in a single pass, which is aided by lexical state.
Future post: oil
parses regexes statically, but other shells don't.
osh
requires
thirteen different modes!$((
more uniformly, which allows osh
to be parsed
with two tokens of lookahead instead of arbitrary lookahead.Future post: Shell should be parsed with a top-down algorithm. Bash uses yacc, which uses a bottom-up algorithm. This has implications for both static parsing and completion engines.
These five themes have been covered fairly thoroughly, although I've made note of a few more posts that would be nice to have. Tomorrow I'll outline some new, bigger themes for the blog.