3 ms·
FWIW the Oil project was partly (negatively) inspired by the very helpful description of bash's architecture: https://aosabook.org/en/bash.html https://aosaboo
by chubot 6y ago
FWIW the Oil project was partly (negatively) inspired by the very helpful description of bash's architecture:
https://aosabook.org/en/bash.html https://aosabook.org/en/bash.html
The maintainer expresses some regret about the parser architecture. I referenced this in several 2016-2017 blog posts:
OSH Parses Shell Scripts Up Front in a Single Pass. Other Shells Don't - http://www.oilshell.org/blog/2016/10/13.html http://www.oilshell.org/blog/2016/10/13.html
OSH Can Be Parsed With Two Tokens of Lookahead - http://www.oilshell.org/blog/2016/11/17.html http://www.oilshell.org/blog/2016/11/17.html
The Thinner Waist of the Interpreter - http://www.oilshell.org/blog/2017/01/26.html http://www.oilshell.org/blog/2017/01/26.html
Word Evaluation - http://www.oilshell.org/blog/2017/03/09.html http://www.oilshell.org/blog/2017/03/09.html
----
This principled architecture ended up paying off in a couple unexpected ways, which I wrote about earlier this year:
Oil Uses Its Parser For History And Completion - http://www.oilshell.org/blog/2020/01/history-and-completion.html http://www.oilshell.org/blog/2020/01/history-and-completion....
Oil's Parser Doesn't Worry About Aliases and Prompts - http://www.oilshell.org/blog/2020/01/alias-and-prompt.html http://www.oilshell.org/blog/2020/01/alias-and-prompt.html
Summary: in addition to the regrets expressed by the maintainer in the article, bash actually has multiple ad hoc, incorrect parsers for its own language! They are incorrect to the point that a separate project (bash-completion) has code to paper over the errors.
Oil uses the same parser for all use cases. Moreover, its parser isn't littered with orthogonal concerns like the interactive prompt and expanding aliases.
----
However I still need help finishing the project -- see what I've cut here: http://www.oilshell.org/blog/2020/08/risks.html http://www.oilshell.org/blog/2020/08/risks.html
And feel free to contact me (address on home page and in profile)