3 ms·
It's literally impossible to write robust programs in it. Right, that's the whole point of Oil! You can make those programs robust without rewriting them ent
by chubot 7y ago
It's literally impossible to write robust programs in it.
Right, that's the whole point of Oil! You can make those programs robust without rewriting them entirely. Run them with Oil, and then flip a few switches to enable stricter behavior.
Here are a few examples:
Oil's Stricter Semantics Solve Real Problems
http://www.oilshell.org/blog/2019/08/16.html http://www.oilshell.org/blog/2019/08/16.html
But there are a dozen more. The key point is that bash's codebase has kind of "topped out" in the sense that it's hard to add anything without breaking something else. On the other hand, the Oil interpreter is reasonable, small, and you can add features to it, and fix things.
Anyone who knows about programming languages might be able to read the type definitions in osh/runtime.asdl (and frontend/syntax.asdl) and learn a lot about how shell works.
- ashkankiani 7y agoAt that point, just use an actual programming language instead of a shell...
- coldtea 7y agoThat misses the whole point - that there shouldn't be any difference. Shells already behave like programming languages just bad ones. The reason people use them over a "bona fide" programming language is their command line editing, easy process handling, first class support for job control, access to environment and pipes. One could use a non-shell programming language, but then he'd have a much harder time with all the later - even though he'll have a much better time with abstraction, programming correctness, error handling, first class data structures, and so on. So we're in an either (shell+easy command line use+process handling/job control/pipes etc) or (programming language+better syntax-cohesion-correctness-better error handling-libraries-first class data structures-and on on). There are things in IT that can't be combined because one is a tradeoff to the other. This is not such a case - this is just a historical accident: crappy language features in shells and crappy job control features in programming languages. But there's no reason one can't have all those latter things in a proper programming language. Which is what Oil is.