3 ms·
I agree—I love pushing shell to its limits as much as anyone, but I had so many shell scripts that grew and grew till the point I got annoyed and rewrote them i
by __david__ 9y ago
I agree—I love pushing shell to its limits as much as anyone, but I had so many shell scripts that grew and grew till the point I got annoyed and rewrote them in perl/ruby and every time I thought it came out better (shorter, more comprehensible). Finding that point where it's better to be a "real" language is a bit of an art form though. For me it's heuristics like needing arrays or hashes or parsing command line arguments.
- chubot 9y agoYup, that is exactly the point of Oil. In fact I promised I would write an "elevator pitch" but I haven't done that yet [1]. In short: It's the "upgrade path" from bash. That is, the ONLY language you can automatically convert shell to. Rewriting even a 30 line bash script in Perl/Ruby/Python isn't trivial, and of course there are many 1000+ lines bash scripts laying around. People even write new ones today (e.g. for setting up clusters and Linux distros.) I'm current looking at running the 2500 line 'abuild' shell script which builds and deploys Alpine Linux packages [2]. Although many people like to avoid shell, if you use Unix, it's at the foundation of everything you do. The bash clone OSH is actually close to done (although it's slow). But I still have to work on the new Oil language [3] which you can convert shell to. Hopefully that won't take as long as OSH :) [1] http://www.oilshell.org/blog/2017/07/31.html http://www.oilshell.org/blog/2017/07/31.html [2] https://git.alpinelinux.org/cgit/abuild/tree/abuild.in https://git.alpinelinux.org/cgit/abuild/tree/abuild.in [3] http://www.oilshell.org/blog/2017/02/05.html http://www.oilshell.org/blog/2017/02/05.html