Live data from Hacker News

GitHub – nushell/nushell: A new type of shell

github.com

291–300 of 411 posts

Re: GitHub – nushell/nushell: A new type of shell

#291
post #81
post #65

Earlier quoted context omitted.

This is insanity and hubris. "It's so easy!" yes if you have the language and tools de jour installed and up to date. I want none of that. It was node and npm. Then go. Now Rust and cargo. Oh, I forgot ruby. And all this needs to be up to date or things break. (And if you do update them then things you are actively using will break.) I don't need more tamagochis, in fact the less I have, the better. What happened to…

Ease of use and familiarity are different things. Tooling around rust really is easy, when the alternatives (for equivalent languages) are CMake, autotools, and the like. As it stands, I can brew install ripgrep and it just works. I don’t need to know it’s written it rust. If, for some reason, homebrew (or whatever other package manager) is lagging behind and I need a new release now , cargo install is a much easier…

Indeed. Thank for you stating this so clearly.

The "ease of use" and "familiarity" distinction reminds me of talks by people such as Rich Hickey who distinguish "simple" and "easy":

https://www.infoq.com/presentations/Simple-Made-Easy/

> Rich Hickey emphasizes simplicity’s virtues over easiness’, showing that while many choose easiness they may end up with complexity, and the better way is to choose easiness along the simplicity path.

Re: GitHub – nushell/nushell: A new type of shell

#292
post #236

Earlier quoted context omitted.

Nice summary. It leaves me wonder, though: is the philosophy the same as in Unix world? as in, little independent tools that do one and just one thing. Would those tools also need to be modified to add compatibility with the same typing system that is used by the shell? Or it follows the opposite mentality and the sell comes with batteries included? I'm thinking of some arbitrary example, like downloading a JSON and…

Powershell commands (called "commandlets" or "cmdlets") are little .net (or .net core) programs/methods which accept and return either objects or arrays of objects, rather than plain text. powershell offers cmdlets which let you sort and filter these result objects based on object property values rather than sorting on plain text values. Obviously when printing to stdout or stderr, THAT bit is plain text, but until t…

Thank you very much, it's now clearer to me how it works.

Regarding the objects themselves, the way you describe them makes me think of Javascript objects & arrays: you don't need to know the exact shape of an input object, as long as it has the specific properties that you want to work on. Same for arrays: regardless of their content, the language allows you to use the standard ops like map() or find() (and it's then a matter of you providing adequate functions to access the contained elements)

Re: GitHub – nushell/nushell: A new type of shell

#293

This feels extremely like PowerShell, from all the examples, and even cites "draws inspiration from projects like PowerShell", so "a new type of shell" feels very disingenuous unless it has additional novel properties that aren't evident just from these. There's also no support for variables yet if the page is to be believed, which means there's 0 chance of me using this for more than 5 minutes right now. (I'm not tr…

I took it to mean that it was a new type of shell from the perspective of unix/osx users who were presumably their target audience, and who are an audience who might either not know what PowerShell is about our discount it is just a "windows thing" and therefore not relevant to their life. So "new" in the sense of "new to you".

You could probably point to just about any technology that claims to be new and pull it apart and find that it is mostly derivative of existing technology and ideas

Re: GitHub – nushell/nushell: A new type of shell

#294

I wonder if this could be accomplished in a more general way with a fourth standard file descriptor for structured data. stdjson basically.

I see this as requiring considerable work. For JSON, I don't see the payoff (relative to more expressive type systems). JSON was designed to work within different constraints. All in all, this suggests moving beyond JSON.

Sometimes the new ways are best...

I often find that redesigns / rewrites can be transformative. The same benefits less often accrue to incremental changes.

Practically, in my experience, when a group (or organization) is not under a severe time and budget crunch, redesigns seem more palatable. The results are more likely to be simpler, even if they are not as familiar.

Re: GitHub – nushell/nushell: A new type of shell

#295
post #248
post #236

Earlier quoted context omitted.

Nice summary. It leaves me wonder, though: is the philosophy the same as in Unix world? as in, little independent tools that do one and just one thing. Would those tools also need to be modified to add compatibility with the same typing system that is used by the shell? Or it follows the opposite mentality and the sell comes with batteries included? I'm thinking of some arbitrary example, like downloading a JSON and…

In powershell you would use built ins. To download json over rest you would use Invoke-RestMethod or irm. To convert json to objects you would use ConvertFrom-Json. To select properties from objects you would use Select-Object or select. Here is a concrete example that I wrote for the rustlings install script: https://github.com/rust-lang/rustlings/blob/main/install.ps1... Note that I used Invoke-WebRequest instead o…

And then I guess the shell itself has mechanisms to easily attach or register new commandlets, to allow for easily add custom object processing?

I really like the consistency that those commands have: ConvertFrom-.

No built in converter for the format you need? I'm just speculating here, but I guess you just need to implement this or that Interface and there you go.

Re: GitHub – nushell/nushell: A new type of shell

#296
post #222

Earlier quoted context omitted.

Is it easier? Because I would expect man free to go to the C stdlib.h definition. You’re just familiar with the former and not the latter currently.

Your assumption is wrong. Why would you double down on a bad argument? Don't you have a linux environment to type man free in before making that claim? It's just an overall bad argument. I don't see how `Get-CimInstance -Class Win32_OperatingSystem` is in any way memorable https://www.google.com/search?q=man+free

man free for me shows the BSD library functions manual, maybe it's different in Linux

Re: GitHub – nushell/nushell: A new type of shell

#297
The philosophy section is the most important aspect, in my opinion, because I want to know why I should switch. In other words, show me a better future, and then I'm more likely to try it out.

> Philosophy

> Nu draws inspiration from projects like PowerShell, functional programming languages, and modern CLI tools. Rather than thinking of files and services as raw streams of text, Nu looks at each input as something with structure. For example, when you list the contents of a directory, what you get back is a table of rows, where each row represents an item in that directory. These values can be piped through a series of steps, in a series of commands called a 'pipeline'.

Re: GitHub – nushell/nushell: A new type of shell

#298
post #272

Earlier quoted context omitted.

Could you expand upon this? My specific concern there is that, while the compiler frontend for any one given edition becomes individually simpler, the whole compiler becomes a bit more complicated, and things like IntoIterator, which pjmlp mentioned elsewhere, imply changes across several editions. This is not a major problem when editions means {2015, 2018, 2021}, but in a world where we also have 2024, 2027, ... ed…

The Rust compiler is roughly “parse -> AST -> HIR -> MIR -> LLVM IR -> binary.” I forget exactly where editions are erased (and I’m on my phone so it’s hard to check), but for sure it’s gone by the time MIR exists, which is where things like the borrow checker operates. Edition based changes only affect the very front end of the compiler, basically. This is a necessary requirement of how editions work. For example, i…

[deleted]

Re: GitHub – nushell/nushell: A new type of shell

#299
post #288

Earlier quoted context omitted.

I wouldn’t use a custom shell in company work, but I’d use it for company work. I treat custom shells like a custom keyboard or shortcuts in the OS. Shells can help a lot in your day to day command line ergonomics, like presentation (always know which branch and directory I’m on, time and time taken for commands) and ease of use (autocomplete, aliases, shortcuts). But I wouldn’t script into them for professional work…

I agree... and any well written script will have a shebang that specifies the shell that shluld run it, anyway. For me, personally, I love having homogeneus systems put in place. In this case it means not having to switch my mind between in and for modes. Helps me avoid mistakes, having to keep less context up here. But it's always interesting to read about other people's way of working.

If you want to make the systems homogeneous, then you need homogeneous teams, too. Maybe some team members prefer fish, others prefer zsh, still others prefer bash. Your suggestion means that everyone has to use the same shell for their command line.

I find that it is better to allow each team member to have their own working environment: different (command line) shell, different editors/IDEs, different keyboard shortcuts. But everyone uses the same programming languages (counting shell as a programming language for scripts here) and the same build tools and the same linters.

Re: GitHub – nushell/nushell: A new type of shell

#300
First 60 second impression - this looks like powershell with not-insane syntax. Looks quite revolutionary, it breaks the traditional paradigm for UNIX shells and appears to artfully refine the good concepts in Powershell (which seem to be let down severely - in my opinion - by UX issues.)
Post reply on HN