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!
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.
> https://www.oilshell.org/blog/
I think the point is that, it did evolve, as your link shows—and there are lots of other sane alternative shells, too. The problem isn't that they don't exist; it's getting people to adopt them in sufficient numbers.
Just wanted to point out that Hacker News runs on FreeBSD[0] :) Some people like the BSDs, and would appreciate it if everybody stopped designing for the Linux monoculture (well, monoculture if you disregard Windows and macOS).
[0] https://docs.freebsd.org/en/books/handbook/introduction/
"What HN uses" doesn't say much about tech trends :-)
Edit: You probably want to use Netflix as a better example. I think it's used by their CDN layer.
99.99% of everything is internet connected and auto-updates. New distro versions come out every 2 years.
There's no real reason why bash couldn't have been evolved into a sane language with sane parsing and with modern constructs. By sane, I mean... read this:
https://www.oilshell.org/blog/
At least these articles:
https://www.oilshell.org/blog/2021/01/why-a-new-shell.html (especially this one)
https://www.oilshell.org/blog/2016/10/20.html
https://www.oilshell.org/blog/2016/10/28.html
https://www.oilshell.org/blog/2016/11/06.html
If freaking Javascript could "use strict;" and turn a page, bash could have definitely have done the same.
It's just that there's no real commercial interest and FSF doesn't have the manpower (or desire) to do this.