News for hackers. Stuff that matters.
Re:Crush: A command line shell that is also a powerful moder... by moonchild on Friday August 07, 2020 @04:12AM (#24079554)
I think that these 'improved shell' projects (incl. crush and nushell) that try to copy powershell somewhat miss the point of the shell in the first place. If I want a high-level language that's tightly integrated with the unix environment, I already have perl and tcl. Little more power (maybe less integration, but greater capacity to build new integration) and I can use raku or lisp. The point of shell is that it interoperates freely with all programs and all programs share a language. If now, suddenly, I can only use commands that have been explicitly rewritten to support your environment; or regular commands are second-class citizens and need support code to interact with your environment's higher-level functionality——

Then your environment is useless to me. Because I have better programming languages which, despite being able to interact with the system and its commands, don't pretend to be one with the system. As a result, the core high-level language constructs mesh better, because they're not trying to serve two goals at once. It's not possible for something that's not a 'real' shell (including fish, zsh, even csh) to integrate with the system the way a real shell does, because the system itself was designed around the shell.

Re:Crush: A command line shell that is also a powerful moder... by chubot on Friday August 07, 2020 @12:32PM (#24083764)
Right, I'm often asked this about Oil [1]: Why do you want to write programs in shell?

That's not the idea of shell. The idea is that I write programs in Python, JavaScript, R, and C++ regularly, and about 10 different DSLs (SQL, HTML, etc.) And I work on systems written by others, consisting of even more languages.

I need a language to glue them together. A language to express build automation and describe deployed systems. Most big systems consist of more than one language.

Shell is the best language for that, but it's also old and crufty, with poor implementations.

When you program in shell, gcc, git, pip, npm, markdown, rsync, diff, perf, strace, etc. are part of your "standard library".

[1] http://www.oilshell.org/

Re:Crush: A command line shell that is also a powerful moder... by chubot on Friday August 07, 2020 @04:33PM (#24086155)
Update: also see the philosophy for structured data in Oil below: https://news.ycombinator.com/item?id=24083931
Re:Crush: A command line shell that is also a powerful moder... by pritambarhate on Friday August 07, 2020 @05:50AM (#24080184)
Not many young people know Perl or Tcl (or even lisp for that matter).

>> The point of shell is that it interoperates freely with all programs and all programs share a language.

Also doesn't mean people should stop trying to come up with these new shells. May be some "new" shell will catch up and tomorrow's "all" programs will be compatible with that shell. For example, now on Mac OS X, now ZSH is the default shell.

Re:Crush: A command line shell that is also a powerful moder... by _jal on Friday August 07, 2020 @10:33AM (#24082288)
> Not many young people know Perl or Tcl

There are more young people who know Perl or Tcl or Lisp than know Crush. I've never understood this reasoning - "Hardly anyone knows X. Let's replace it with something nobody knows." At most, you're making an argument about a lack of sunk cost.

> May be some "new" shell will catch up and tomorrow's "all" programs will be compatible with that shell

Think of it like transitioning to life in a wheelchair. You can't "catch up" with your house - it just wasn't designed for wheelchair use. Renovating all the narrow corridors, random steps, tight angles and vertical reaches probably costs more than rebuilding.

In this comparison, the mobility mode is your shell.

Re:Crush: A command line shell that is also a powerful moder... by Riverheart on Friday August 07, 2020 @11:15AM (#24082752)
"Hardly anyone knows X. Let's replace it with something nobody knows."

Because there's a value proposition. Just like TCL, Perl, and Lisp had value propositions over other available languages. It's fine if you don't see the value proposition in Crush but progress sometimes forces us to learn new things instead of sticking with what we have.

Re:Crush: A command line shell that is also a powerful moder... by jwilber on Friday August 07, 2020 @12:51PM (#24083995)
Crush has been around < 1 year. Perl has been around for 32. Of course more people know Perl.

If I’m being honest, you’re not adding anything constructive at all here - it seems you’re in a competition with yourself as to how much you can degrade Crush for whatever reason.

You act like it’s a choice between Crush and Perl. People don’t have to learn Crush. People don’t have to learn Perl. Will picking between the two have any substantial effect on one’s career outcomes these days? Probably not, as candidates will have already learned the important languages for getting a job anyway.

Re:Crush: A command line shell that is also a powerful moder... by _jal on Friday August 07, 2020 @01:04PM (#24084137)
If I'm being honest, I have no idea where you got the belief that either I'm some big Perl partisan or that I have something against Crush, or why you're getting so personal.

But it is cute to couch it in a complaint about not being constructive; points for shamelessness.

Re:Crush: A command line shell that is also a powerful moder... by pritambarhate on Friday August 07, 2020 @01:31PM (#24084445)
>> Hardly anyone knows X. Let's replace it with something nobody knows

By that logic no one should make anything new to replace the incumbent.

In case of Perl, PHP came and it replaced Perl as mainstream web development language.

In sysadmin stuff where Perl used to be mainstream, now significant chunk is taken away by Python.

These days JavaScript appeals to younger people more. Times change and with it the tools people use also change.

There is no guarantee that any new project will succeed but you won't know unless you try.

Re:Crush: A command line shell that is also a powerful moder... by moopling on Friday August 07, 2020 @01:34PM (#24084479)
The original point was "why would I learn a new thing, when I already know something which works". The response "some people don't have something they already know" is valid.

You're really bringing up a separate point which is "should we be reinventing the wheel?", I think that's a fair point, but it's not a response to the original commentator.

Re:Crush: A command line shell that is also a powerful moder... by oblio on Friday August 07, 2020 @06:54AM (#24080519)
It only took Zsh 29 years (initial release year: 1990, adoption in Mac OS: 2019) to become the default shell on one of the major nixes, while being POSIX compatible and having just an extension layer on top.

I wouldn't hold my breath for something else to replace sh/bash as the default shell on the major nixes within this century. Pessimist? More like realist :-)

Re:Crush: A command line shell that is also a powerful moder... by robin_reala on Friday August 07, 2020 @07:33AM (#24080768)
That wasn’t even driven by zsh’s actual benefits, but by the fact that bash changed to GPL3. If it had continued on GPL2 we’d 100% still have bash as a default.
Re:Crush: A command line shell that is also a powerful moder... by Fnoord on Friday August 07, 2020 @09:16AM (#24081429)
And the fact Apple doesn't like GPLv3.
Re:Crush: A command line shell that is also a powerful moder... by pjmlp on Sunday August 09, 2020 @11:28AM (#24100198)
Most other major UNIXes, before of BSD/Linux takeover weren't on sh, rather tsch and ksh.
Re:Crush: A command line shell that is also a powerful moder... by heresie-dabord on Friday August 07, 2020 @01:54PM (#24084682)
Many young people don't know history, science, other languages, or even the grammar of their native language. That is why we teach.

The "ecosystem" of programming languages is healthy. There are many options, some to master, some to consider. But not knowing how to use a tool -- especially a widely-used and powerful tool -- is no badge of honour or discernment.

Re:Crush: A command line shell that is also a powerful moder... by cat199 on Friday August 07, 2020 @02:54PM (#24085262)
> That is why we teach.

but what if people don't know how to learn?

instead of getting wrapped up in all of this 'knowledge preservation' nonsense, shouldn't we just mimic what they are already doing and assume it to be better, because the activity occurs in a year number that is higher than the previous behavior pattern?

now that would be real progress.

or, not.

Re:Crush: A command line shell that is also a powerful moder... by heresie-dabord on Friday August 07, 2020 @03:39PM (#24085712)
Sarcasm duly noted. (o;

Societal results sadly noted.

Re:Crush: A command line shell that is also a powerful moder... by mywittyname on Friday August 07, 2020 @11:39AM (#24083049)
> Not many young people know Perl or Tcl (or even lisp for that matter).

I don't know perl and I'm not young, but I do understand and appreciate the role perl -e plays as an extension of bash. When I run into an issue where I need more than bash, but less than python, I'll search around SO for a perl -e command for what I need.

This is often how people decide to learn a tool: they have a problem for which it is the best solution. They get some exposure to the capability and slowly expand on their knowledge.

Re:Crush: A command line shell that is also a powerful moder... by esoterae on Friday August 07, 2020 @01:09PM (#24084188)
I think that means you're using SO as a tool..?
Re:Crush: A command line shell that is also a powerful moder... by Shared404 on Friday August 07, 2020 @01:38PM (#24084516)
Don't most of us? That doesn't mean he's not using Perl as well.
Re:Crush: A command line shell that is also a powerful moder... by moonchild on Friday August 07, 2020 @06:09AM (#24080300)
I explicitly included zsh. The point is not the language of the shell itself; that has never been the point. The point is that zsh interoperates with the other programs on your system in a way that crush doesn't and can't.
Re:Crush: A command line shell that is also a powerful moder... by viraptor on Friday August 07, 2020 @07:56AM (#24080922)
> a way that crush doesn't and can't

What do you mean by can't? If it misses some mode of interaction, that can be always added.

Re:Crush: A command line shell that is also a powerful moder... by ori_b on Friday August 07, 2020 @09:27AM (#24081540)
Consistent behavior when piping through all commands. A lack of modes of operation to consider. Simplicity.
Re:Crush: A command line shell that is also a powerful moder... by viraptor on Friday August 07, 2020 @10:02AM (#24081904)
Simplicity exists on more than a single dimension. Choosing one column from "ls" output for example is not simple, bordering on impossible using the consistent behaviour of standard pipes.

Sometimes the inconsistent solution will be simpler by moving the complexity to the choice of the mode of interaction. Sometimes not.

Re:Crush: A command line shell that is also a powerful moder... by ratboy666 on Friday August 07, 2020 @12:24PM (#24083657)
You are correct. It is all about how you think about things.

"ls" lists files. Sure. Simple interactive command. But, thinking about this, "echo " also lists files. "ls" provides information about files. Sure. Simple interactive command. But, "stat" specifically provides information.

So, I would reach for

stat --format "%n %a"

To get name and octal permissions. You are correct, and wrong at the same time. Easy enough to accomplish -- but using * instead of ls. Note that the "space in filename" becomes the big issue (use %N in stat format).

So your conclusion is 100% correct. Thank you for your post and insight

Re:Crush: A command line shell that is also a powerful moder... by moonchild on Friday August 07, 2020 @05:48PM (#24086803)
> Choosing one column from "ls" output for example is not simple, bordering on impossible using the consistent behaviour of standard pipes.

  ls -l | awk '{print $3}'
  ls -l | cut -f 3 -d ' '
Re:Crush: A command line shell that is also a powerful moder... by ori_b on Friday August 07, 2020 @11:02AM (#24082594)
Maybe a shell is the wrong tool for that job, and hiding the modes that the language is operating in complicates things.
Re:Crush: A command line shell that is also a powerful moder... by pjmlp on Sunday August 09, 2020 @11:30AM (#24100211)
Nor do they know that before bash takeover of the UNIX world via BSD and GNU/Linux clones, it was just another shell among many others, with tsch and ksh also having a place on the table.
Re:Crush: A command line shell that is also a powerful moder... by drbojingle on Friday August 07, 2020 @10:05AM (#24081942)
when he says Perl or Tcl I think he means general purpose languages. It doesn't have to be Perl, or Lisp or Tcl, those are examples.
Re:Crush: A command line shell that is also a powerful moder... by kevincox on Friday August 07, 2020 @08:53AM (#24081273)
This seems to strike a good compromise as "third party" commands are "lines" type which is basically what we are used to send and receive in unix tools. Of course a lot of tools already support emitting JSON so it seems the Crush is already more useful than the typical unix shell as you can still use "lines" for every program (and convert to a table by parsing if you want to use the more advanced features) and there are already a number of third-party programs that you take directly take advantage of these feature with even though they didn't know anything about this shell.

I think the fact that you can already use this with most programs and it is never less powerful than bash seems like good indication that the system doesn't need to be reworked around this shell. It fits in cleanly to existing paradigms.

Re:Crush: A command line shell that is also a powerful moder... by cnity on Friday August 07, 2020 @04:38AM (#24079729)
Your ideas are something I wrestled with while I was writing (a very similarly named) crsh[0]. I chose to avoid trying to reimplementing commands and instead stuck with an unstructured environment, but with the ability to parse output using an expandable set of parsers and use inline JavaScript to operate on it. I agree with what you say about perl, but the number of users with experience in perl is -- at least in my bubble -- very small compared with more modern languages.

[0] https://crwi.uk/2020/07/12/crsh.html

Re:Crush: A command line shell that is also a powerful moder... by dividedbyzero on Friday August 07, 2020 @05:01AM (#24079876)
While I have some relatively extensive experience with Perl, I'd rather write assembler using morse than touch that ever again. The language is one guy's not-too-well-thought-through hack that gained enormous traction by filling a void, and from there grew far too organically. There are lots and lots of cryptic ways to do the most mundane things, lots of inconsistencies, the language really makes it hard to write software that isn't terrible to maintain.
Re:Crush: A command line shell that is also a powerful moder... by gridlockd on Friday August 07, 2020 @05:26AM (#24080025)
Aren't we talking about "a better shell scripting language"? At the point where a Perl program becomes "hard to maintain", what would the bash alternative even look like?

Perl code is often written once and then runs for years without issue. I have on occasion fixed broken Perl scripts despite having practically no experience with the language. It wasn't a problem at all, because your average maintenance job is "something was moved" or "we're switching out X for Y", but not "we need to rewrite this complex system that is a Perl script for some reason".

Re:Crush: A command line shell that is also a powerful moder... by licebmi__at__ on Friday August 07, 2020 @09:22AM (#24081487)
>It wasn't a problem at all, because your average maintenance job is "something was moved" or "we're switching out X for Y", but not "we need to rewrite this complex system that is a Perl script for some reason".

I would intuitively agree with you as there are hundreds of unnoticeable perl scripts doing their job, but as someone with moderate experience with the language, I can say that when I did maintenance tasks, they were mostly the second kind.

Re:Crush: A command line shell that is also a powerful moder... by zeveb on Friday August 07, 2020 @10:45AM (#24082411)
You are right, but none of those criticisms apply to Tcl, which is both beautiful and integrates really well with the Unix environment. I won't say that it is perfect, but it is really, really good. A better choice than Perl where Perl is used, a better choice than Lua almost everywhere Lua is used, often a better choice than Python.

Tcl is horribly, terribly under-appreciated. It is one of the great might-have-beens of modern computing, almost as much as is Lisp.

Re:Crush: A command line shell that is also a powerful moder... by yumaikas on Friday August 07, 2020 @11:06AM (#24082630)
Eh, having used both Tcl and Lua, I definitely think Lua is the better of the two when it comes to a scripting engine for games.

And I think Lua is more elegant than TCL overall. TCL's stringiness really gets clumsy in certain types of programs, and it's a much larger target than Lua overall.

Not to say that TCL is bad, but I'm glad that dict-based languages prevailed over TCL's string-based-ness

Re:Crush: A command line shell that is also a powerful moder... by cnity on Friday August 07, 2020 @05:13AM (#24079941)
Exactly. This is common with shell scripting languages. They feel like some awful duct tape, when in fact the perfect primitive for joining separate concerns already exists (the pipe). Using a nicer language (like modern JS) to perform procedural logic makes perfect sense to me.
Re:Crush: A command line shell that is also a powerful moder... by inshadows on Saturday August 08, 2020 @01:21PM (#24093330)
> Using a nicer language (like modern JS) to perform procedural logic makes perfect sense to me.

# ls | grep foo

This involves two programs written in nicer language (C).

# ls | rg foo

This involves two programs written in nicer language (C & Rust).

Feel free to come up with JS program that does something well and/or is usable in pipeline. I think you're missing the point of the shell.

Re:Crush: A command line shell that is also a powerful moder... by mhotchen on Friday August 07, 2020 @05:14AM (#24079950)
This is a very interesting project. I really like the combination of languages and the way you've implemented it. I already see some opportunities to use it.
Re:Crush: A command line shell that is also a powerful moder... by cnity on Friday August 07, 2020 @05:22AM (#24080004)
Thank you! It's pretty buggy at the moment, and maybe frustrating to use since it's missing some important shell features, but any feedback is always welcome.
Re:Crush: A command line shell that is also a powerful moder... by mhotchen on Friday August 07, 2020 @05:40AM (#24080124)
Yeah I've just installed it and seen eg. the autocompletion on ls isn't how I'm used to. I will keep playing around and watch for progress because I really like the idea.

I especially see this being useful in my CI environment which has a handful of functions, some json and yaml parsing (using jq and python respectively), etc. It's a little cumbersome at the minute but not so much to switch from bash and the rest of the project is JS anyway so it would be good to be consistent.

Re:Crush: A command line shell that is also a powerful moder... by cnity on Friday August 07, 2020 @05:48AM (#24080177)
Excellent. If there are things you notice, please feel free to raise as an issue, and pull requests are always welcome!

> useful in my CI environment

For sure. I've been meaning to play around with getting a docker image with the shell set as the default. It's definitely a use-case I had in mind.

Re:Crush: A command line shell that is also a powerful moder... by mhotchen on Friday August 07, 2020 @05:50AM (#24080191)
I'm very impressed with what works so far by the way.
Re:Crush: A command line shell that is also a powerful moder... by shawxe on Friday August 07, 2020 @12:14PM (#24083514)
You really aren't kidding about Tcl. I recently discovered that with tclreadline, Tcl can be used completely in place of Bash in interactive mode, in a way that something like Python absolutely cannot.

A lot of people seem to have negative opinions about Tcl (maybe because it's more of a LISP than its syntax seems to imply), but as someone who is just discovering it, I'm shocked at how powerful it is for how unpopular it seems to have become. It's like some kind of unexpected cross between Bash, LISP, and (with Tk) Visual Basic. There's something about it that's just kind of fun.

Re:Crush: A command line shell that is also a powerful moder... by hodgesrm on Friday August 07, 2020 @12:49PM (#24083964)
Tcl is awesome. I used it constantly in the 1990s. It's outstanding for things like testing and build scripts.

I think some of the pushback might be because people tried to use it to build large applications and failed. Languages like Java and (dare I say it) Visual Basic were more comprehensive and had good IDE support.

Re:Crush: A command line shell that is also a powerful moder... by mr_toad on Saturday August 08, 2020 @01:46AM (#24089374)
Tcl has features that are very powerful, but are really hard for a beginner, and really easy for a novice programmer to shoot themselves in the foot with.

Yet Tcl tends to be forced on undergraduate programmers, who probably just learn to loathe it. I lost several toes to it myself decades ago, and haven’t really felt inclined to pick it up again.

Re:Crush: A command line shell that is also a powerful moder... by IshKebab on Friday August 07, 2020 @04:15PM (#24085995)
You are forgetting about how shell scripts start. "I don't want to keep writing these 5 shell commands, I'll put them in a file. Ok that is useful, I'll add some parameters. This shell script works great, I'll add more functionality."

And before you know it you have a buggy monster written in a batshit insane language that nobody is going to want to touch.

If your shell is at least vaguely sane, the situation is a lot better. I don't really get why you would argue against something that fixes the many many many mistakes of Bash.

Re:Crush: A command line shell that is also a powerful moder... by lolc on Friday August 07, 2020 @06:13PM (#24086964)
To a first approximation, people who are ok with Bash as a scripting language do not know enough Bash to safely use it as a scripting language.

I see many insane constructs that accidentally work. I also know how much time it would take to explain expansion rules. And people don't even want to hear it because it shakes their simplistic (and inconsistent) understanding.

So yes, I hope we'll see something like crush replacing Bash. But I don't see how it will happen.

Re:Crush: A command line shell that is also a powerful moder... by hestefisk on Saturday August 08, 2020 @06:19AM (#24090486)
I don’t think nushell or crush for that matter copy PowerShell. They have learnt from MS and built upon what they didn’t get right. Strongly typed objects on the command line is theoretically interesting, but slow and complex in practice (why does it still take 3-4 seconds to run ls / gci in my homedir at home?). Text in columns gives you the simplicity of text coupled with some level of structure.
Re:Crush: A command line shell that is also a powerful moder... by majkinetor on Saturday August 08, 2020 @08:03AM (#24090970)
3 to 4 s to run ls?

U should fix ur computer rather then spreading FUD.

Also its clearly stated that copy of pwsh is intention on both projects.

Nushell is still one man show just like crush so they need decade or so to get to pwsh level.

Its nice to make stuff and offer alternatives but lets keep perspective here.

Re:Crush: A command line shell that is also a powerful moder... by hestefisk on Saturday August 08, 2020 @08:10AM (#24091023)
Column orientation is very different to object orientation.

My computer runs just fine. Do you really think pwsh is fast?

Re:Crush: A command line shell that is also a powerful moder... by majkinetor on Saturday August 08, 2020 @11:02AM (#24092112)
No. Its acceeptable, and mostly startup related. Certainly not even close to the level u claim. Once started it is more or less OK depending on specific cmdlet and task in question. I use it in production on numerious gov level services serving millions.

Vim is slower for example but rarelly anybody compalain about it given its power.

Re:Crush: A command line shell that is also a powerful moder... by pjmlp on Saturday August 08, 2020 @06:36AM (#24090542)
They haven't learned everything, because the other part is integration with all sorts of native libraries and IPC.
Re:Crush: A command line shell that is also a powerful moder... by jodrellblank on Friday August 07, 2020 @06:12AM (#24080313)
> “because the system itself was designed around the shell.”

Windows wasn’t designed around the command prompt, it wasn’t designed around shell utilities. When I call “cat”, it’s not important that I’m writing those three letters, they are a library way of calling a set of file open/read OS functions. When I write “ping”, it’s not the ping tool I care about, it’s the network api calls it does behind the scenes. The Unix/Linux shell is then seen like a “Python standard library” of ways the user can control the OS, and it’s a hugely inconsistent, undesigned, ad-hoc agglomeration of names and parameters and bodges, which cheats out on dealing with the complexity and instead offloads that straight on to the user in a user hostile way.

What powershell tries to do for Windows is make a somewhat designed, consistent, and more user-approachable set of wrappers around the Windows OS system calls, along with guidelines and support for vendors to build in that style, a human interface that is introspectable, built to be programmable, but still composable and modular.

The objection that trying to do such a user-focused thing on Unix makes a “useless” system is weird because that - a user interface to tools/library of OS call patterns - is what the shell is. In what way is “resolve-dnsname” pretending to be one with the system that dig and nslookup aren’t? They’re names which trigger a pattern of network traffic and show a result. In what way is piping text from dig to sed “real” and piping resolve-dnsname to format-list “pretend”?

In what way is running “docker compose” from sh real, but running it from zsh is pretend?

In what way is it a better design to have (a pile of shell tools and Python library wrappers and Python wrapping shell tool calls), instead of (a Python based shell with transparent shell tool calls)?

Like, “I want what I’m familiar with, too many things to relearn”, or “too many things are awkward in this approach (cough PowerShell)” are reasonable objections, but “trying for a more consistent, more human friendly, interface with more high level language constructs at one’s fingertips makes a thing useless to me” feels heel dragging or Stockholm syndromeish. Presumably you don’t object to there being a choice of multiple command line tools to do a task? Why object on principle to a choice of other OS “front end experiences”? Is there any version of things which you can imagine as being both “better” (less arbitrary and inconsistent than shell) and “not pretend”?

> “The point of shell is that it interoperates freely with all programs and all programs share a language.”

What language? Some treat piped bytes as bytes (e.g. piping a binary file), others as ASCII, others as UTF-8. All support different parameter options, names and values and ways of specifying them. Many handle output formatting in different ways, many trigger internal states from environment variables. If the point is a common shared language, the point doesn’t seem to have been achieved from a user perspective. And if the point is that “I have to suffer a system that’s tied to a shared language with an AIX box in a bank basement last touched by a human in 1997” the point is a bad one. I use my computer a lot more than I use AIX and I have more computing power to spare on human comforts and conveniences.

Re:Crush: A command line shell that is also a powerful moder... by jerf on Friday August 07, 2020 @10:02AM (#24081916)
"What language?"

The UNIX philosophy was to write a solid system by taking most of the hard problems in kernel space and kicking them into user space. This is not a slur, this is a description. Especially at the time, it wasn't at terrible solution. I kind of think of it the same way as many programming languages have observed that "the standard library is where things go to die"; the code in a system that is hardest to change, well, it doesn't change! So any bad decision that ever gets in there is almost permanent. Part of the reason UNIX won is that it enshrined fewer bad decisions in the kernel than its competition did. I think you could even argue it had more bad decisions overall than its competition, at least towards the beginning; it's just that far fewer of them were enshrined in the kernel.

This is also the philosophy of the pipe. It disclaims all layout and moves that responsibility on to the consumers. There is no "shell language", at all. This is, simultaneously, a big strength and a big weakness.

One aspect of that is precisely that the strength of this approach tends to inhibit anyone who tries to beat it with something like Powershell. All Powershell had to be was better than any shell on Windows. This was not hard. For something like Crush, to take off it has to be better than any existing shell on UNIX, and as annoying as unstructured pipes may be, the ecosystem as a whole still has a lot of positives about it, because it's been tuned for 50+ years. It's going to take a lot of work to match that, and so far, it doesn't seem like any of these projects are achieving take-off velocity.

Arguably, the best thing to do would be for all these projects to get together and try to define a standard UNIX-level non-textual rich serialization of some sort, using lessons from Powershell and arguably things like D-Bus to do it, because none of these projects individually seem to be on a success trajectory.

Re:Crush: A command line shell that is also a powerful moder... by BeetleB on Friday August 07, 2020 @12:50PM (#24083974)
> For something like Crush, to take off it has to be better than any existing shell on UNIX, and as annoying as unstructured pipes may be, the ecosystem as a whole still has a lot of positives about it, because it's been tuned for 50+ years. It's going to take a lot of work to match that, and so far, it doesn't seem like any of these projects are achieving take-off velocity.

Who cares about "taking off"? If it's useful for 10s of users, it has taken off.

Consider xonsh (https://xon.sh/). I don't think it will ever be "mainstream" the way bash or zsh are. I doubt it will ever come preinstalled in any major Linux distribution. But it's used by enough and has enough momentum that I don't worry it will die. That alone is enough for me to use it as my primary shell. I don't care that xonsh will never "take off".

Re:Crush: A command line shell that is also a powerful moder... by jerf on Friday August 07, 2020 @01:42PM (#24084561)
Failure to take off means that instead of getting a long tail of things that work, you get a smaller island of reduced functionality, even if that is enough to keep you using it.

It doesn't have to be the goal of the project or the author, but there are real advantages to achieving a takeoff, even to the users of a product.

Re:Crush: A command line shell that is also a powerful moder... by pjmlp on Saturday August 08, 2020 @06:52AM (#24090614)
A philosophy that is more cargo cult than anything else, as anyone with work experience in commercial UNIXes knows.

What is the one thing that GNU ls does well, by the way?

Re:Crush: A command line shell that is also a powerful moder... by jerf on Saturday August 08, 2020 @10:36AM (#24091885)
"What is the one thing that GNU ls does well"

Backwards compatibility with itself, probably.

If you came away from my post with the impression that this system produces a lot of elegant software, well, I must have screwed up in my writing somehow. What it produces is bodges upon bodges, which are then polished by years of ramming into the corner cases and putting in another bodge to fix them. There is actually something to be said for this design methodology, and it's not all bad, but it rarely produces elegance.

Re:Crush: A command line shell that is also a powerful moder... by pjmlp on Saturday August 08, 2020 @11:07AM (#24092170)
Which has nothing to do with "UNIX philosophy", as expected.
Re:Crush: A command line shell that is also a powerful moder... by jerf on Saturday August 08, 2020 @01:40PM (#24093523)
Oh, heh, if you were expecting a defense of the "UNIX philosophy" of doing one thing well from me, you're not going to get it. I think one small step by one small step that has been abandoned over time, and because it was so incremental there's no one place to point at where it went over the line and it's easy for people to miss it because there is no such point, but cross the line it has.

Now, at least GNU ls doesn't send or receive email or something. A quick scan of its man page doesn't show many any features grossly out of line with its primary task. But yeah, it has a lot of features for sure, many of which nominally overlap with tasks that could be done by other tools (sort, ignoring backups, -D ("generate output designed for Emacs' dired mode", lol), quoting styles...).

I feel much the same way about Python. Very little of its philosophy expressed back around 2000 or so is in effect today. And there's no one release you can point at and say, "this is it, this is when it stopped being simple", yet, clearly, today it is no longer simple.

Re:Crush: A command line shell that is also a powerful moder... by pjmlp on Saturday August 08, 2020 @02:48PM (#24094079)
Agreed, that was my whole point.

The "UNIX philosophy" gets cargo cult by younger generations thanks to a couple of statements in a few worshipped books, yet there is hardly any UNIX clone post V6 where it was actually followed upon.

Re:Crush: A command line shell that is also a powerful moder... by hodgesrm on Friday August 07, 2020 @12:44PM (#24083904)
New shells seem unlikely to catch fire unless they:

* Preserve compatibility with popular shells like bash.

* Address some of the broken parts in a way that makes the world better. Quote handling is the original sin of *nix shells. If somebody fixed that you would have my full attention.

Otherwise I can just stick with Bash + Python3.

Re:Crush: A command line shell that is also a powerful moder... by hannasanarion on Friday August 07, 2020 @01:30PM (#24084433)
Which is impossible, which is why no new shells have caught fire.

In order to preserve compatibility, you must handle quotes, namespaces, etc in the same way as Bourne-derived shells, because they will be expected to run scripts that use nested interpolation, or string declarations without quotes, or whatever. Shells that use a more robust syntax, like Fish or Powershell, can't ever be compatible.

Re:Crush: A command line shell that is also a powerful moder... by chubot on Friday August 07, 2020 @04:40PM (#24086213)
It's possible, and http://www.oilshell.org/ has done it:

http://www.oilshell.org/release/latest/doc/simple-word-eval....

You can try it right now. Turn on 'shopt -s simple_word_eval' to get the better behavior.

Or turn on the group 'shopt -s oil:basic' and get even more better behavior.

When those options are off, Oil runs some of the biggest shell scripts in the world. It's the shell that's most compatible with bash by a mile.

https://github.com/oilshell/oil/wiki/Shell-Programs-That-Run...

Re:Crush: A command line shell that is also a powerful moder... by int_19h on Saturday August 08, 2020 @02:33PM (#24093967)
Fish is plenty popular regardless of all that. Sure, it won't replace Bash, in a sense that you'd have Fish handle all the scripts on the system - that's impossible for backwards compatibility reasons. But it's used as a primary interactive shell, and for custom system & user scripts, by a lot of people.
Re:Crush: A command line shell that is also a powerful moder... by hodgesrm on Friday August 07, 2020 @02:48PM (#24085202)
I can't speak to the implementation details but there must be a middle ground where you can set compatibility using 'set -N' or some similar approach to enable new behavior.

Scripting languages like Python, Ruby, Perl, etc., have dealt with upgrade many times. It has not always been pretty, but the alternative is stagnation.

Re:Crush: A command line shell that is also a powerful moder... by chubot on Friday August 07, 2020 @04:42PM (#24086242)
Yup, it's already been done with 'shopt -s simple_word_eval' in Oil, see right above:

https://news.ycombinator.com/item?id=24086213

And yes I drafted a blog post called "Unix Shell Should Evolve Like Perl 5" which says exactly what you are saying:

http://www.oilshell.org/blog/2020/07/blog-roadmap.html#the-u...

And Oil has already done it. It needs to be faster, but that's an inevitability based on progress so far.

Why Use Oil? http://www.oilshell.org/why.html

Re:Crush: A command line shell that is also a powerful moder... by majkinetor on Friday August 07, 2020 @02:04PM (#24084787)
Not exactly true since PowerShell is doing quite good regarding popularity nowdays...
Re:Crush: A command line shell that is also a powerful moder... by mdaniel on Friday August 07, 2020 @03:45PM (#24085763)
From my perspective, that's partially because CMD is so stunningly incapable as what a reasonable person might think of as a shell. I'd guess the other half is the amount of pressure Microsoft has placed upon management tooling using PS

If Apple shipped some Swift-powered shell and all of their management documentation started using it, I'd bet a non-trivial portion of administrators would start to use AppleSwiftShell (although I do deeply appreciate that's a severely flawed comparison since macOS already has a sane functioning shell, but it's the best I could think of as a huge company that owns the platform pushing such a concept down)

Re:Crush: A command line shell that is also a powerful moder... by majkinetor on Saturday August 08, 2020 @11:08AM (#24092183)
I doubt. Most people still use cmd because they dont care.

Its doing good because it is good and people started to notice once MS propriatery chains went down.

Re:Crush: A command line shell that is also a powerful moder... by liljencrantz on Sunday August 09, 2020 @08:55PM (#24104350)
The way Crush is trying to "fix" quoting is to do less of it.

String interpolation isn't done via quoting but via the format method on the string type, e.g. `"foo {} baz":format "bar"` generates the string "foo bar baz".

Similarly, to execute a command on a remote host, pass in a closure as an argument to the `remote:exec` command, like `remote:exec {1+1} "example.com"`, which will return the value 2.

I find that when quoting becomes a problem it usually means that the wrong solution has already been picked. If you're doing double quoting, you have already lost.

Re:Crush: A command line shell that is also a powerful moder... by haecceity on Friday August 07, 2020 @02:27PM (#24084999)
fish is pretty popular?
Re:Crush: A command line shell that is also a powerful moder... by joe_the_user on Friday August 07, 2020 @04:03PM (#24085914)
Because I have better programming languages which, despite being able to interact with the system and its commands, don't pretend to be one with the system. As a result, the core high-level language constructs mesh better, because they're not trying to serve two goals at once.

The power and usefulness of a given language is often the ability to serve multiple goals at once. Python as tool is cool specifically because of a large-ish but accessible-ish library covering a everything from regex-ex to a web-server.

This project might not serve the goal of writing high level programs and interacting effortless with the command line/system. But I don't one should automatically dismiss the goal of making stuff-glued-together look like a coherent whole.

Re:Crush: A command line shell that is also a powerful moder... by r-w on Friday August 07, 2020 @06:42PM (#24087155)
It's my understanding that commands don't have to be specially written for Crush. As long as they speak an understandable format, they can be used. https://github.com/liljencrantz/crush#reading-and-writing-fi...
Re:Crush: A command line shell that is also a powerful moder... by moonchild on Friday August 07, 2020 @06:28AM (#24080385)
To clarify, I am not saying that everything except for bare /bin/sh without line-editing is Wrong. I wasn't clear enough here. I think that bourne shell, bash, fish, zsh, and csh are all able to interact with the unix system in a way that crush, nushell, and other powershell-alikes cannot.
Re:Crush: A command line shell that is also a powerful moder... by throwaway894345 on Friday August 07, 2020 @08:32AM (#24081137)
Can you elaborate on that more of interaction? What can bash, etc do that crush, etc can’t. Is this limitation inherent or easily amended?
Re:Crush: A command line shell that is also a powerful moder... by liljencrantz on Sunday August 09, 2020 @08:58PM (#24104379)
I am the original author of both fish and Crush, and I honestly don't know in what way fish interacts with the OS in a way that Crush by virtue of it's design never could.

I know that Crush currently doesn't interact very well with external commands, but I don't see where that is an inherent restriction in the design rather than a missing feature.

Re:Crush: A command line shell that is also a powerful moder... by nixpulvis on Friday August 07, 2020 @03:49PM (#24085811)
Exactly!

This is why I started my shell. Eventually it will have the ability to run both POSIX and other shell languages in the same program.

Assuming everything is a table is overly restrictive. Assuming everything is text is the UNIX way. It's then the job of the terminal to render it.

Re:Crush: A command line shell that is also a powerful moder... by liveoneggs on Friday August 07, 2020 @12:51PM (#24083984)
yeah perl with qx/cmd/ calls and similar is just really really good for "shell scripting".
Re:Crush: A command line shell that is also a powerful moder... by hhas01 on Friday August 07, 2020 @06:04AM (#24080264)
“somewhat miss the point of the shell in the first place”

This presupposes that the Unix shell is the way it is because of careful, considered, forward-thinking design, rather than being a haphazard heap of mouldering hacks upon lazy corner-cutting upon quick-n-dirty bodges that should’ve been thrown out and replaced decades ago.

I agree that trying to improve the *nix shell is a bad idea… because the _Unix shell itself_ is a bad idea. Fifty years is long enough. Instead of bending over backwards for that obsolescent garbage heap (for which no-one will thank you, as we see), study it, learn its lessons, and draw a line under it.

Then go build a clean, modern shell architecture from scratch, using modern tooling and techniques, unhobbled by the myriad defects and deficiencies of the old. It’ll take a tenth of the time and be ten times better (if not, you’re still doing it wrong).

See also:

https://www.google.com/search?q=sunk+cost+fallacy

https://homes.cs.washington.edu/~weise/uhh-download.html

--

p.s. As for driving early adoption, don’t even think of trying to win over the Unix old guard (who will only bring regressive practices and complaints with them), but sell it hard to the new generations of users who are accustomed to modern UI/UX standards and much less impressed by what the “Old Unix” dogpile has to offer.