Live data from Hacker News

Zx 3.0

github.com

141–150 of 169 posts

Re: Zx 3.0

#141

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.

Many container base images won't have perl by default (e.g: alpine).

For servers it's less common, but enterprise systems never cease to amuse me.

Re: Zx 3.0

#142
post #122

Earlier quoted context omitted.

Bash just sort happened to be the lowest common denominator in most unix style environments. Because it just sorta ended up being the default. Unix ended up being this different thing where each distro seems to be kind of unique. Then on top of that they are very easy to customize. So while one distro you can assume a particular python level the next disto python is totally optional. Mix in containers and docker imag…

I thought that was sh (i.e. bourne shell). As far as i remember bash is not the default shell on a lot of unices.

My understanding is that sh is a specification, not an implementation.

Most images will either have bash or ash installed. ash, being lightweight, is the choice of alpine and related distros.

Re: Zx 3.0

#143
post #117

Is this a typo? console.log(`Files count: ${count}`) missing $

No, this is an untagged template literal[1], which just generates a string. The other ones are tagged, which means that the template string and the parameters are (separately) passed to the $ function.

[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Re: Zx 3.0

#144
post #131

Earlier quoted context omitted.

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.

I do think JS would be much better than python. It's more to do with familiarity.

Re: Zx 3.0

#145
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?

It is _a_ perfect choice. I know a bit of bash, but I'm always looking up how to do things I know are simple in JS. I would love to be able to write scripts in JS because I'm faster with it, and I find it easier to read.

in case anyone is looking to do this, it's as easy as doing the following

  #!/usr/bin/env node
  console.log("Hello World!");

Re: Zx 3.0

#146
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.

As a front-end dev who works with JS all the time and never writes shell scripts, every time I have to deal with shell scripts I think "I'd really rather use JS for this".

Re: Zx 3.0

#147
post #77

Earlier quoted context omitted.

Or more charitably, while the UX/DX distinction isn't very meaningful for this project, there are lots of products (e.g., payments) that target both (non-developer) end users and developers. It helps to be able to separate the personas.

I don't think this holds. As the rule goes, there are only three cardinal numbers: zero, one, many. What are the chances you product has only two meaningful personas - "users" and "developers"? Take that payment system. People who buy things are obviously users, people who write CMS plugins for that system are obviously developers. But what about, say, analysts studying reports from that system? Accountants making su…

It's perfectly reasonable (and quite common) to have acronyms for your major personas, and generic terminology for the tail.

Re: Zx 3.0

#148
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.

I am also a frontend dev. My experience has been completely opposite from yours. Node.js is my go-to tool for writing automation scripts.

I think these are some reasons why our mileages differ:

- I need my scripts to work in both Windows and Linux.

- I am not very experienced with bash or other shell.

- Most of my "automation work" only involves reading text from a file, transform it, and write to another file. (Generating SQL commands, doing stats about town names, etc.)

Re: Zx 3.0

#149

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?

It is definitely noticeable even when you run a command once. But it really becomes a problem when your command is run lots of times as part of some other system.

For example if you're using Python to process a lot of files via Make (something my work's build system does unfortunately) then it can end up costing 10s of seconds which is kind of insane.

Re: Zx 3.0

#150

> await await await await Oh yeah, right, because the first thing that comes to mind when writing bash scripts is "I sure wish there was more 'await' noise in all this code!" Anyways: 'async' in the Python and Javascript sense was a mistake, future generations will think we were insane to adopt it. https://journal.stuffwithstuff.com/2015/02/01/what-color-is-...

Shameless plug; might wanna look into zxpy :)
Post reply on HN