3 ms·
Well this doesn't make much sense. If you rightfully find bash inadequate at some point, just switch to the next most natural tool - Python. Nobody's going to
by Mawr 3y ago
Well this doesn't make much sense.
If you rightfully find bash inadequate at some point, just switch to the next most natural tool - Python. Nobody's going to be surprised when they see a Python script.
If you start feeling Python is inadequate too, then:
1) You're wrong, just stick to Python
2) If you're so bent on doing away with familiarity, at least get as much leverage as you can in return and use a "proper" language, like Go / Rust. You get static typing and easy to deploy binaries, which are solid benefits.
Trying to use JS here is the worst of both worlds. Nobody expects to see JS in this context and it doesn't bring much to the table.
- mattlondon 3y agoPython has been banned in many places for this sort of thing in my experience. There is just too much shite and baggage associated with python environments for it to be reliably portable between systems. Anaconda that, pip this, 2.x, 3.x, string support. It's a dumpster fire. I am not saying JavaScript is any better, but python is actively considered harmful for this use case in many places I have been.
- vincnetas 3y agoin my case im usign groovy scripts with grape dependencies. script is always selfcontained single file. max portability in JVM world. no need to fiddle with dependencies.
- drowsspa 3y agoHonestly this looks better than Python. I hate all the subprocess.run([...], check=True, universal_newlines=True) and then you have the manage the dependency hell of virtualenvs. At least with node the node_modules is right there.
- ambigious7777 3y agoYes, but this isn't made for general scripting. This project seems to be aimed at JavaScript projects, for example calling zx from package.json/scripts/start If I had a JavaScript project, and I wanted to migrate my scripts away from Bash, I wouldn't pick Python. Not only would it be another language, I would also have to configure Python to run correctly, ie add it to my Docker image. Simply installing another NPM package, rather than include an entire other language is a much better and simpler solution.
- Sammi 3y agoWhy should a nodejs dev have to pull in python? That is a heavy solution when you can script well in js already.
- IshKebab 3y agoPython's ok for this as long as you need 0 third party dependencies and it's a single file. As soon as you want to split into multiple files or import something that isn't part of the standard library then it becomes a total disaster. I think Deno is a really good option here - better than ZX. You can use third party libraries easily, it works with IDEs, and it's trivial to install.