3 ms·
Yes 'use strict;' is a great analogy! I mentioned that here with regard to Perl 5: https://www.oilshell.org/blog/2020/07/blog-roadmap.html#the-unix-shell-shou
by chubot 5y ago
Yes 'use strict;' is a great analogy! I mentioned that here with regard to Perl 5:
https://www.oilshell.org/blog/2020/07/blog-roadmap.html#the-unix-shell-should-evolve-like-perl-5 https://www.oilshell.org/blog/2020/07/blog-roadmap.html#the-...
It turns out that bash's "shopt" can be co-opted for this, and that's exactly what Oil does. For example, after 'shopt --set parse_paren', you can do this:
if (x > 0) { # parens are now Python-like expressions, not subshell!
echo "$x is positive"
}
Yes I agree bash could have done this. But the bash codebase is very fragile and things often break. The maintainers are very concerned about breakage.
Oil is written in a way to make breakage less likely: with principled parsing and a detailed code representation using algebraic data types. I'm surprised at how much language evolution this style has enabled. It makes me optimistic about the project's future!
Although we still tons of work to do with the C++ translation -- writing a shell is hard either way!
- oblio 5y ago> Yes I agree bash could have done this. But the bash codebase is very fragile and things often break. The maintainers are very concerned about breakage. True, but that's not a good reason for such a used application. It has been around for 40 years, I think it literally has trillions of runtime hours. It's used on billions of systems, most likely. It's exactly the place where you'd create a super comprehensive test suite that covers <<everything>> (see SQLite) and then re-architect it to make it robust. I wonder if it's due to lack or money or due to something else.