Live data from Hacker News

Zx 3.0

github.com

51–60 of 169 posts

Re: Zx 3.0

#51
post #38
post #28

Earlier quoted context omitted.

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..."

This isn't correct: if a Googler writes some code from scratch, which is unrelated to their work, on their personal time, and using their personal laptop... then it's definitely not owned by Google. There could be gray areas where code ownership could be disputed, but in general your employer owns only the intellectual property it paid for. Source: I'm a Googler (until next month).

There is very little code that a Googler could write that is unrelated to their employer’s business. You’re almost certainly going to need an explicit carve-out, as other Googlers in the thread have pointed out.

Re: Zx 3.0

#52

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?

How do you do shell escaping of #{name} if it comes from user input?

Re: Zx 3.0

#53
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…

There is also xonsh[0] if you want an similar experience to zx to mix bash and python.

[0] -- https://github.com/xonsh/xonsh

Re: Zx 3.0

#54
post #38

Earlier quoted context omitted.

This isn't correct: if a Googler writes some code from scratch, which is unrelated to their work, on their personal time, and using their personal laptop... then it's definitely not owned by Google. There could be gray areas where code ownership could be disputed, but in general your employer owns only the intellectual property it paid for. Source: I'm a Googler (until next month).

Not true. You need explicit permission (there is a process for obtaining it, and it is very lightweight as I've done it myself). The general idea is that you get permission without much hassle if you develop something that doesn't compete with Google. You need to argue your case otherwise. Source: I'm a Googler that went through the process before. Edit #1 for all Googlers reading this: search "IARC" internally and y…

Btw, Google actually publishes this documentation externally.

https://opensource.google/docs/releasing/

Re: Zx 3.0

#55
post #54

Earlier quoted context omitted.

Not true. You need explicit permission (there is a process for obtaining it, and it is very lightweight as I've done it myself). The general idea is that you get permission without much hassle if you develop something that doesn't compete with Google. You need to argue your case otherwise. Source: I'm a Googler that went through the process before. Edit #1 for all Googlers reading this: search "IARC" internally and y…

Btw, Google actually publishes this documentation externally. https://opensource.google/docs/releasing/

They removed the `go/iarc` mirror recently, now seemingly only available on the wayback machine: https://web.archive.org/web/20210710210932/https://opensourc...

Re: Zx 3.0

#56
post #55
post #54

Earlier quoted context omitted.

Btw, Google actually publishes this documentation externally. https://opensource.google/docs/releasing/

They removed the `go/iarc` mirror recently, now seemingly only available on the wayback machine: https://web.archive.org/web/20210710210932/https://opensourc...

Well that interesting. Thanks for pointing that out. Wonder why they did that.

Re: Zx 3.0

#57

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?

What I don’t like about backticks in Ruby is that they “ignore” errors in commands you run. It’s up to the program author to remember to check $? for the last executed command’s exit status. And guess how many times the average Ruby script using this feature implements error handling? Usually it’s totally forgotten.

To be safe, abstractions that make it easy to shell out must also:

- escape all variable interpolations by default using “shellwords” or similar.

- throw exceptions on error by default.

Backticks in Ruby are very easy to use, but aren’t safe.

Re: Zx 3.0

#58
post #57

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?

What I don’t like about backticks in Ruby is that they “ignore” errors in commands you run. It’s up to the program author to remember to check $? for the last executed command’s exit status. And guess how many times the average Ruby script using this feature implements error handling? Usually it’s totally forgotten. To be safe, abstractions that make it easy to shell out must also: - escape all variable interpolation…

Ruby noob, but surely there's a way to metaprogram and change this to default to throw on non-zero exit?

Re: Zx 3.0

#59

Earlier quoted context omitted.

Maybe but Python is sloooow and its type annotation situation is pretty poor. I would recommend using Deno. It has the following advantages: * Uses Typescript which gives you a great static typing system. * Runs via V8 so it's about a million times faster than Python. * Single statically linked binary with no project setup files required (package.json/dependencies.txt) makes it about a million times easier to deploy…

I’ve found Python is just fine performance-wise for CLI tools. What bad experiences have you had with it? I’ve mostly used click.

Python interpreter by itself is fast, it spawns in a few milliseconds, but it can slow to a crawl if you need libraries, and easily take a few seconds.

However, situation is similar with nodejs.

Re: Zx 3.0

#60
post #38

Earlier quoted context omitted.

This isn't correct: if a Googler writes some code from scratch, which is unrelated to their work, on their personal time, and using their personal laptop... then it's definitely not owned by Google. There could be gray areas where code ownership could be disputed, but in general your employer owns only the intellectual property it paid for. Source: I'm a Googler (until next month).

Not true. You need explicit permission (there is a process for obtaining it, and it is very lightweight as I've done it myself). The general idea is that you get permission without much hassle if you develop something that doesn't compete with Google. You need to argue your case otherwise. Source: I'm a Googler that went through the process before. Edit #1 for all Googlers reading this: search "IARC" internally and y…

Many companies make claims over their employees' intellectual property. How much of a claim they actually have legally is a different question, which depends on the country (and sometimes state) where the employee works, and companies routinely attempt to claim more than they legally can.

Compare e.g. https://thebusinessprofessor.com/en_US/property-law/californ...

I bet Google lacks the copyright for many of the projects they claim.

Post reply on HN