News for hackers. Stuff that matters.
Re:Jeffrey Snower was originally demoted over PowerShell by rektide on Sunday May 08, 2022 @11:50AM (#31305122)
Curl, jq is the good answer here.

More from the fringe, I'm quite enjoying zx, a really nodejs powered scripting environment. https://github.com/google/zx

Covered somewhat in ZX 3.0 https://news.ycombinator.com/item?id=28195580 (189 points, 8 months ago, 163 points)

Re:Jeffrey Snower was originally demoted over PowerShell by jiggawatts on Sunday May 08, 2022 @04:39PM (#31307942)
These are only vaguely comparable. It’s like saying assembly language is a substitute for something elegant in Haskell.

Technically true in some sense, but not really.

Re:Jeffrey Snower was originally demoted over PowerShell by rektide on Sunday May 08, 2022 @10:52PM (#31310004)
Zx really intends to be a scripting language (and i think it does a good job) that happens to be javascript.

Personally I feel like thenbiggest missing piece ZX would beed to be a good straight up competitor to bash or zsh would be better interactive modes. A node repl.os ok, uses libreadline & has lots.of capabilities, but zx feels biased towards scripting, not am actual shell.

I dont see why you think zx couldnt be a substitute. Particularly & especially in the context of a discussion on powershell, where we are clearly already opening the gates of heterodoxy already.

Re:Jeffrey Snower was originally demoted over PowerShell by jiggawatts on Monday May 09, 2022 @12:14AM (#31310548)
One of the other responses mentioned Nushell, which is a direct substitute for PowerShell in a meaningful sense: an interactive shell, structured pipelines, formatting as the final step of a pipeline, etc...

Anything else tends to be either a random bag of unrelated tools sticky-taped together, OR a heavyweight programming language.

The equivalent of JavaScript or Python is C#, CS-Script, or F# Interactive. Those are also full-featured programming languages.

I can process files in just a couple of lines of C#, but I still reach for PowerShell when doing this kind of thing unless I really need higher throughputs or complex processing.

Re:Jeffrey Snower was originally demoted over PowerShell by rektide on Monday May 09, 2022 @06:17PM (#31320562)
I feel like ZX has these features already. Rather than choosing to believe there is a meaningful unbridgeable hard fast line, I think it's beneficial to consider case-by-case what features & capabilities are important & what enables smooth, light operation.

Node still isnt `perl -pie` level easy & hybrid, but again I think it's altogether pretty slick & simple with zx today.

The interactive repl doesnt look like a shell but it has quite advanced editing, comes out ahead in many ways (value previews). There's no ability to generate new autocompletion capabilities in the built in repl, but one could potentially yse an IDE and LSP with a repl. The potential for non-monolithic shells is interesting, that a shell might be separated into editor, engine, & plugins.

There is pretty ok pipeline handling via streams, which finally have decent & well embraced standards. https://github.com/google/zx/blob/main/docs/pipelines.md

Formatting as final step Im not as familiar with but it sounds like one could easily map or swizzle their stream output pretty easily. Particularly with better ndjson I think the potential here is high.

Overall I think there are distinctions, characterizations between shell and other languages, but it's less inherent to me; we simply havent spent much effort identifying what it is that makes operating the command line easy, flexible, and have even less work trying to port those ideas & riff off them. Even an early simple thin standard library like zx achieving so much success at becoming putty or glue, alike a shell, so quickly, indicates to me that it's worth doubting our long held certainty that these things are absolutely apart & different.