Live data from Hacker News

NGS: Next Generation Unix Shell

github.com

111–120 of 204 posts

Re: NGS: Next Generation Unix Shell

#111
post #60

Lots of assertions about how "bad" our current shells are, but no substantiation. I'm a developer, and I know just enough shell to write a simple deploy script or two, but reading this, I'm not convinced that what we really need is new shells and scripting languages.

Simple example: using current shells it is not convenient to work with API call results which are structured data. Yes, there is jq but if the shell had data structures it would be much better, wouldn't it?

On UNIX, the "API" is basically that everything is a file and programs are written to handle text streams. After all these years, the shell is still perfect for this.

It sounds like you want create a new language and shell in order to have something similar to Windows PowerShell which interacts .NET objects using its API. This does not fit into the Unix "API" described above. This isn't a "Next Generation UNIX Shell" but an alternative shell that suits a certain group of users who don't really understand UNIX.

Re: NGS: Next Generation Unix Shell

#112
post #96
post #74

Earlier quoted context omitted.

Not new. Javascript is not the most popular language, does not have the largest "package manager" (nor standard library, nor package library which is what I think you mean) and more importantly it does not have the most programmers specializing in the problem domain at hand -- shell functions. Moreover the referenced toolset doesn't even use Javascript ! You merely jumped in blind to promote your favorite tool. Also…

> Javascript is not the most popular language > does not have the largest package library, which is what I think you mean. Yes, you've said that before. Do you have any supporting arguments? I'm basing that opinion on: 1. JS is #1 on modulecount and #2 on libraries.io, the two places that track the size of package repositories. 2. JS continually coming up as the #1 or #2 most popular language on StackOverflow eg http…

Other languages don't package 1 line functions.

Re: NGS: Next Generation Unix Shell

#113
post #96
post #74

Earlier quoted context omitted.

Not new. Javascript is not the most popular language, does not have the largest "package manager" (nor standard library, nor package library which is what I think you mean) and more importantly it does not have the most programmers specializing in the problem domain at hand -- shell functions. Moreover the referenced toolset doesn't even use Javascript ! You merely jumped in blind to promote your favorite tool. Also…

> Javascript is not the most popular language > does not have the largest package library, which is what I think you mean. Yes, you've said that before. Do you have any supporting arguments? I'm basing that opinion on: 1. JS is #1 on modulecount and #2 on libraries.io, the two places that track the size of package repositories. 2. JS continually coming up as the #1 or #2 most popular language on StackOverflow eg http…

And the most popular girl in my high school can't ride a motorcyle. I took her to prom but I'm not inviting her on my next cross-country ride. What's your point?

https://en.wikipedia.org/wiki/Measuring_programming_language...

Regardless you don't pick a toolset based on popularity. You choose it based on capability. 100,000 front-end HTML developers asking the same "how do I regex?" question on StackOverflow 10,000 times doesn't pre-qualify an ecosystem as the perfect tool for shell automation.

And at this point you're just trying to save face after you jumped in to explain why it's such a great idea that this project uses Javascript. It doesn't. I'm moving on and suggest you do the same.

Re: NGS: Next Generation Unix Shell

#114
post #99

Earlier quoted context omitted.

The (ex) AT&T Research command tw(1) has pretty much replaced find(1) for me (particularly with some canned search selectors for particular projects).

I'm struggling to find any information on this command (it's not an easy name to search for!) Do you have any links you could share please?

Apologies, I forgot to include a link: The toolkit is now at https://github.com/att/ast since AT&T laid off the group a couple years ago.

About half the package consists of evolutions of traditional Unix commands. The parts I use regularly are ksh and tw. tw ('tree walk') is sort of a 'find --exec' replacement with a C-like selector syntax. It's a bit verbose, so for interactive use I generally set up project-specific shell aliases with selection expressions, e.g.

  alias cctw=$'tw -e "select: return (type == REG) && ((name == \'*.c\') || (name == \'*.h\') || (name == \'*.cpp\') || (name == \'*.cc\') || (name == \'*.h\') || (name == \'*.hpp\') || (name == \'*.mm\') || (name == \'*.inc\'));" '
and then use those, e.g.

  cctw egrep -w MyIdentifier

Re: NGS: Next Generation Unix Shell

#115
post #95

Earlier quoted context omitted.

PowerShell actually does have data structures, and that's my favorite part of it. Pipe a directory listing as an object instead of text so you can access properties directly instead of parsing text!

No,I mean displaying them inline in the REPL and allowing you to interact with them.

Well, that's an issue with the REPL, not the design of PowerShell. No reason you couldn't make one that does this.

Re: NGS: Next Generation Unix Shell

#116
post #95

Earlier quoted context omitted.

No,I mean displaying them inline in the REPL and allowing you to interact with them.

Well, that's an issue with the REPL, not the design of PowerShell. No reason you couldn't make one that does this.

Sure, I do like it much more than any UNIX alternative and it is the only widespread shell that is closer to the experiences I was referring to.

But that REPL could be improved, that is what I mean.

Re: NGS: Next Generation Unix Shell

#118
post #39

I'm sure we can all agree that the current state of shells needs some work, but I don't think inventing a new one is the right solution. I'm a huge fan of the fish shell, but in the real world, it never seems to be installed across the farm, and convincing the older SysAdmins to install it is more trouble than it's worth. We should be focusing on saner bash defaults, since it's the most common shell in use. We should…

We should be focusing on saner bash defaults, since it's the most common shell in use. That kind of work is not glamorous and highly controversial. Ideally there should be some sort of cross distro/OS working group (Debian/Ubuntu, Red Hat, SUSE, FreeBSD, NetBSD, OpenBSD, Mac OS X, etc.), similar to the working groups that standardize the web, where such proposals can be made, voted on and adopted. For example there s…

I've been using -nix for almost 20 years. I've used everything from ksh on SunOS 2.6 (Solaris?? what's that) to oh-my-zsh (for 3 years, before happily graduating to oh-my-fish). I grew up on Slackware 6 waiting hours and hours for a 2.2 kernel build to finish. In high school, FreeBSD 4.3 kernel mods took up more time than booze and women. My 3 year puppy love for oh-my-zsh dimmed as I transitioned to a more sane, less emotional woman - oh-my-fish.

I hate to admit it, but Microsoft just got it right with Powershell. Standardizing the convention with an intuitive Verb-Noun, the out of the box documentation with -examples, -full, etc goes into so much detail that if everyone used it, there wouldn't be any dumb "How does I move directory??" questions on Stackoverflow (well, there'd be less at least).

Don't know a command? Show-Commands and type in 'network' to see what's available. Don't see it there? Go get a Powershell script (often offered by vendors like VMware and Citrix, making devop lives easier). I remember spending _weeks_ trying to get my dual-boot machine (FBSD / Win2k) Cygwin/msys setup to work well on my P3 600 at 12 or 13. Now I can just Feature install Bash and get a native binary. Let me say that again -- now, I can Feature install Bash on Windows jeeebus. QT is LGPL. CLR is open source. Visual Studio Community (basically Professional) is free (unless you need historical debugging then Ultimate's going to cost a lot). Satya + Meijers + Hanselman et al have made favor Microsoft so hard, despite being an active donor of the FSF.

That GNUutils-with-autocomplete is real trivial to write, but since it's already in fish, I see no need to right it. :smug: [In all seriousness, I agree with you re: standards. Plan 9's interface standards semi-addressed that. But le sigh such is life.]

Re: NGS: Next Generation Unix Shell

#119
post #58

My number-one wish for a NGS: Undo! Take, for example, rm. The hoops we have to jump through when accidentally rm'ing a file are ridiculous [1]. But in most cases (smallish, non-secret files), rm should be trivially undoable. Windows gets this right: By default, files are not deleted, but moved to trash. If there is not enough space in trash, Windows warns you. Or, if you really want to delete a file instead of movin…

>Windows gets this right: By default, files are not deleted, but moved to trash.

The del or Remove-Item commands also permanently delete the file, just like rm. The "Windows" behavior you're talking about is the behavior of the graphical shell Explorer, which is also present in Gnome and KDE. There's nothing specific to Windows here.

Post reply on HN