Earlier quoted context omitted.
One (admittedly obvious) difference is that it runs on Node/V8 instead of Bun/JSC.
can you elaborate the difference, besides the different names of the runtime?
ZX – A tool for writing better scripts
91–100 of 143 posts
Re: ZX – A tool for writing better scripts
#92It looks like people don’t get it. This isn’t “better” than your tool of choice. This is a tool for JavaScript developers to write non-trivial scripts in a portable way without getting lost in POSIX hell. Who came up with this stuff? https://stackoverflow.com/a/13373256 If you can write shell code, Perl, Python, COBOL, suit yourself. This is for JavaScript developers in JavaScript projects.
Here's an example: https://gitlab.com/vincenttunru/penny/-/blob/main/scripts/bu... That used to be a shell script. But this I can way more easily read (even after not touching it for a long time), I get autocompletion, and I can use the APIs I'm already familiar with. It's a pretty neat QoL improvement for me specifically.
Re: ZX – A tool for writing better scripts
#93It looks like people don’t get it. This isn’t “better” than your tool of choice. This is a tool for JavaScript developers to write non-trivial scripts in a portable way without getting lost in POSIX hell. Who came up with this stuff? https://stackoverflow.com/a/13373256 If you can write shell code, Perl, Python, COBOL, suit yourself. This is for JavaScript developers in JavaScript projects.
Re: ZX – A tool for writing better scripts
#94Well 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" lan…
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.
Re: ZX – A tool for writing better scripts
#95Very nice. You need three clicks to get tho the documentation, yet they don't explain anything. What does the const line do ? The best thing however is that it is not supported by Google.
To declare variables?
> The best thing however is that it's not suppported by Google
That's the case with many things like zx.
Re: ZX – A tool for writing better scripts
#96Earlier quoted context omitted.
Here's an example: https://gitlab.com/vincenttunru/penny/-/blob/main/scripts/bu... That used to be a shell script. But this I can way more easily read (even after not touching it for a long time), I get autocompletion, and I can use the APIs I'm already familiar with. It's a pretty neat QoL improvement for me specifically.
What’s with all the await-stuff? Couldn’t it be written just straight forward?
[1] https://journal.stuffwithstuff.com/2015/02/01/what-color-is-...
Re: ZX – A tool for writing better scripts
#97Earlier quoted context omitted.
Likewise! I use TypeScript everywhere possible, and zx is a godsend. Unfortunately, I've recently dealt with gobs of Python for ML software. After years of writing TypeScript, it's been a...sobering reminder of many painful coding issues that I'd forgotten even existed. Made me deeply appreciate what TS gives us haha.
Would a python developer feel the same in reverse?
But the Python equivalent of TypeScript is mypy, and I don't think it's controversial to say (even among Python developers) that it's way behind TypeScript, generally.
Re: ZX – A tool for writing better scripts
#98"[For writing complex scripts] JavaScript is a perfect choice". Not sold on that. Why should I choose it over Python, PHP or others?
Because you (i.e. I) already use it and have the full toolchain set up for your project?
Use whatever you're proficient in. For A LOT of devs that means js.
Why spendtime pulling python into my js project?
Re: ZX – A tool for writing better scripts
#99"[For writing complex scripts] JavaScript is a perfect choice". Not sold on that. Why should I choose it over Python, PHP or others?
Js definitely has become a pleasant language to script in. And it's sooooo much faster that python and Ruby.
Re: ZX – A tool for writing better scripts
#100I just feel relieved that the majority here also seems to think this doesn’t make sense