tl;dr I used Python for prototyping; it will be removed.
Consider it an implementation detail -- building and running Oil does not require Python, as a portion of the interpreter is bundled in the tarball. Python 2 vs. 3 doesn't really matter. It was in Python 3 at one point.
More discussions here:
https://www.reddit.com/r/ProgrammingLanguages/comments/7tu30...
> I encountered a nice blog post, Replacing Shell Scripts with Python, which, in my opinion, inadvertently proves the opposite point. The Python version is more difficult to write and maintain.
Here's the link: https://medium.com/capital-one-developers/bashing-the-bash-r...
I think, roughly speaking, the fact that Python 3 is much closer to a sane language for engineering means that it's less suited for scripting.
What is A=$(cmd) in bash is an absolute pain in python.
def _call(cmd_str): return subprocess.check_output(shlex.split(cmd_str)).decode("utf-8")
Definitely a verbose monstrosity compared to doing it in bash, but more than worth avoiding the garbage fire that is Bash. And it only works for simple cases
They work well, if a bit magically, until you need to background a process.
Xonsh is an awesome fishy she'll that's a Python superset. $() is built right in.
_("ls -la") | _(lambda x: x.split()[-1]) | _(lambda x: os.path.splitext(x)[1])
I wonder if there's a complete version of something like this out there. You can probably get pretty far staying in Python-land, plus, everything else is free (data types, standard library, adoption, etc).A = !cmd
In an effort to understand the reasons for actively choosing against 3, does anyone know what problems those would be?