Live data from Hacker News

Zx 3.0

github.com

21–30 of 169 posts

Re: Zx 3.0

#21
I personally find Ruby's built-in shell features more ergonomic:

    `cat package.json | grep name`

    branch = `git branch --show-current`
    `dep deploy --branch=#{branch}` if $?.success?

    [
      "sleep 1; echo 1",
      "sleep 2; echo 2",
      "sleep 3; echo 3",
    ].map { |cmd| Thread.new { %x(cmd) } }.each(&:join)

    name = 'foo bar'
    `mkdir /tmp/#{name}` if $?.success?

Re: Zx 3.0

#23
post #15

I feel like the await keyword everywhere is a bit verbose. One might use something like the gpp preprocessor (hopefully the macros could be defined in a separate file): #!/usr/bin/env zx #define _ await $ #define __ await Promise.all #define _1 process.argv[1] #define _2 process.argv[1] #define _3 process.argv[1] _`cat package.json | grep name` let branch = _`git branch --show-current` _`dep deploy --branch=${branch}…

I don't think it is very relevant to critique the Javascript syntax on a post about a specific library

This is a node package, so using async/await would have been a specific design decision of the library.

Re: Zx 3.0

#25
I'm having a hard time believing that Google uses this much internally. Is github.com/google just a place where Googlers can put personal projects to get additional exposure?

Re: Zx 3.0

#27
post #8
post #3

Earlier quoted context omitted.

Wow, plumbum, despite it's unfortunate name, looks awesome. I will definitely try it next time I write a script.

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.

Re: Zx 3.0

#28

I'm having a hard time believing that Google uses this much internally. Is github.com/google just a place where Googlers can put personal projects to get additional exposure?

The copyright of the thing Googlers build on their oswn time are usually owned by Google and so it ends up on the Google org if they want it on GitHub. They usually have a disclaimer like "this is not a official Google product..."

Re: Zx 3.0

#29

I'm having a hard time believing that Google uses this much internally. Is github.com/google just a place where Googlers can put personal projects to get additional exposure?

I was under the impression that `github.com/google` was largely projects being worked on by googlers where the code is owned by google, but the code isn't always being used by google. Say 20% time work, side projects built using google resources, etc.

Re: Zx 3.0

#30
post #2

Zx is good if JavaScript is only language you know. If you have ability to program or learn other programming languages, Python with packages like Shell and Plumbum might be better choices for shell scripting tasks that outgrow shell. - Python code with Shell is easier to read ana write - No nees to carry async/await keywords thru the code - Powerful plain text manipulation in the stdlib https://pypi.org/project/pyth…

> Python code with Shell is easier to read and write That is pretty subjective

Yes. I started programming in JavaScript in 1999 and Python in 2003, so it is my subjective opinion based on mastering the both languages. There are some factual and objevtive features making Python syntax more friendly, but it is a worth of a blog post to explore. And in the end there is no point, as JavaScript maximalists would not care.
Post reply on HN