Live data from Hacker News

Zx 3.0

github.com

131–140 of 169 posts

Re: Zx 3.0

#131
post #119

Earlier quoted context omitted.

What is the nature of your outrage exactly? Bash is very difficult as a language to write code in. JS is very familiar to a lot of developers and its syntax is orders of magnitude easier to understand than Bash.

The prejudice against JS developers is that they are seen as low class janitorial code monkeys by ‘real programmers’. It hurts these people even more because the language just succeeds and succeeds despite all the hate.

I think definitely there are better alternatives to JS in command line world like python but if someone decided to use something other than bash as a programming language that’s a win in my book. It has its place for basic scripts and general command line trickery but anything beyond that is using a hammer to do brain surgery.

Re: Zx 3.0

#132

Earlier quoted context omitted.

Assuming Python or Perl are installed by default in any server is an invite to a world of pain. At least that's my anecdotal experience.

I've seen instances of some Unix systems not having Perl installed, but that's very rare. Basically everything directly or indirectly depends on Perl, so you really have to run your scripts on a minimal install of RHEL of FreeBSD with 0 ports in order to get into such a situation.

And for that situation you can always break out http://p3rl.org/App::staticperl.

Plus of course if you want to use (pure perl) cpan dependencies I wrote http://p3rl.org/App::FatPacker and http://p3rl.org/Object::Remote to make that easier.

Re: Zx 3.0

#133
post #125
post #111

> Bash is great, but when it comes to writing scripts, people usually choose a more convenient programming language. JavaScript is a perfect choice um… what?

yeah same. As a front-end webdev who writes JS frequently, I've _never_ written shell scripts and thought "Wow, I'd really rather use JavaScript for this"! Not saying it doesn't happen, just that it hasn't been my experience.

You’ve never written a bash script and needed to parse, format, concat lots of strings? What about arrays of strings? All of which is easier in just about any modern language.

Re: Zx 3.0

#134
post #67

I suppose it's easy to poke fun at combining the "best" of shell scripting and JS. But, the examples of using await() with child processes and pipes are pretty nice, and less verbose than the Perl or Python equivalents. It does seem well designed for anything where you're orchestrating parallel runs of commands.

For Perl, there is now Future::AsyncAwait.[0] Mojolicius has already adopted it, so things are moving forward at the speed of the magnetic poles shift. :) [0] https://metacpan.org/pod/Future::AsyncAwait

Plus while Mojolicious' support for running external processes is extremely limited because it's not really a goal of the project, http://p3rl.org/IO::Async::Process (by the author of the async/await system) is a gloriously complete interface and you can run Mojo::IOLoop and IO::Async::Loop code in the same process just fine.

Re: Zx 3.0

#135
post #8

Earlier quoted context omitted.

how is the name unfortunate? from the site: > Plumbum (Latin for lead, which was used to create pipes back in the day)

And yet it sounds like a thicc ass.

I confess to being quite amazed that you saw an innuendo somewhere I didn't.

Re: Zx 3.0

#136
post #8

Earlier quoted context omitted.

how is the name unfortunate? from the site: > Plumbum (Latin for lead, which was used to create pipes back in the day)

Yes, but the name choice was quite intentional and probably giggle inducing. This is about as toilet humor as it can get.

I guess if you've never learned about the word 'plumbing' before?

Re: Zx 3.0

#137

Earlier quoted context omitted.

Startup time is very slow. I just tested on my system and cold startup was 1 second (!) and hot 180ms. Vs 80ms and 64ms for Node. Also it obviously depends what your CLI tool is doing. Just because something is a CLI tool doesn't mean it doesn't do much stuff and therefore performance doesn't matter. For example Scons is a CLI tool. It's a build system written in Python. Everybody abandoned it because it was dog slow…

How much difference does 180 ms vs. 64 ms make for your use case?

In scripts designed to be run directly at a bash prompt by humans, the difference would absolutely be noticeable.

Re: Zx 3.0

#138
post #107

await $`dep deploy --branch=${branch}` … await $`mkdir /tmp/${name}` Code like this[1] looks prone to shell injection [1] https://github.com/google/zx

That example is immediately followed by two sentences of text, of which the second sentence is:

> The zx package provides useful wrappers around child_process, escapes arguments and gives sensible defaults.

lit-html and at least one SQL generating package I've seen use the template string custom interpolation mechanism to auto-escape things - it's a pretty established pattern at this point in javascript land ... but also, yes, until you learn that, it totally does look prone to injection. I've got in the habit of going and finding the template string interpolation function and double checking, because otherwise I find it hard to convince my brain to believe it isn't prone to injection and it interferes with my skim reading the code ;)

Re: Zx 3.0

#139

First impression is that I wouldn't go near it until it settles down a bit — it was on v1.7 in May and now on version 3 already. Great that it's under active development, but changes to my scripts are infrequent and slow. I wouldn't want to be touching an old script on a server somewhere saying "How do I do X in ZX again?" and everything I find online is now for v15 while I'm still on v3. Maybe if it had plans around…

[deleted]

Re: Zx 3.0

#140
post #111

> Bash is great, but when it comes to writing scripts, people usually choose a more convenient programming language. JavaScript is a perfect choice um… what?

js kids thse days.
Post reply on HN