Live data from Hacker News

Nushell.sh ls | where size > 10mb | sort-by modified

nushell.sh

121–130 of 215 posts

Re: Nushell.sh ls | where size > 10mb | sort-by modified

#121
post #105

Earlier quoted context omitted.

For some reason I never liked to do it the "right way". First of all it doesn't seem to actually matter. But most of all the cat way just aligns with my mental model more. Data flows left to right, if you catch my drift. It also makes it easier to add arguments to the end if re-running it.

Besides it's also a fail-safe way to make sure the program doesn't modify the original file. random-app ./myfile.txt The app opens the file on its own. It could decide to write to it. cat ./myfile.txt | random-app The app receives chunks of the file from a pipe. It doesn't know where the original file is. This is especially useful if you aren't sure the program will by default modify the file (such as formatters).

Yeah but you get the same from

    random-app 

Re: Nushell.sh ls | where size > 10mb | sort-by modified

#122
post #70

I find this project interesting But doesn't it look like too monolithic? That will have problems with maintenance and scaling? And features that overlap with many already existing cli tools?

I think Nu generally plays nicely with other CLI tools and data sources. For example if you've got an external executable that emits JSON, all it takes is `from json` to convert that output to a Nushell table.

That inspired me to give it a quick try, however the assumption that white on bright white is a readable color conflicts with the need to make them the same color for other software that I use (which only use eight colors and I want white to be white). I'm guessing this might be configurable for anyone sufficiently interested.

Re: Nushell.sh ls | where size > 10mb | sort-by modified

#123

This is fun, but reading the commands[1] reminds me of learning a new language. There are just too of them, and they are all pipelined in a functional manner so I need to understand the I/O of them. In that case, why would one bother remembering all of those, when Xonsh or IPython does similar job to their data, only with a few more lines of (more familiar) code? [1]: https://www.nushell.sh/commands/

I have written a bunch of nu and: no dot method syntax means you need to browse documentation for literally everything. So much worse than your average programming language, which takes the data type + you enter a dot = it suggests all the relevant methods. The Nu docs are better than they were a few years ago but as far as I can tell they keep changing command names, having subtle changes of behaviour for commands with the same name but apparently different implementations for different data types, having a crucial command listed under a weird name that takes an hour to find, etc etc. If I need to wrangle some JSON again I think I’ll just use Python.

Re: Nushell.sh ls | where size > 10mb | sort-by modified

#124

This looks extremely interesting! Is anyone using it as a daily driver on Linux? How has your experience been?

Yes, daily driving it (it's my default shell in zellij), and have ported my use-every-5-mins scripts to it.

It's VERY refreshing, but I still have issues with it not short-circuiting when an error is thrown in a loop... Which I suspect will get fixed in time...

Re: Nushell.sh ls | where size > 10mb | sort-by modified

#126
post #70

I find this project interesting But doesn't it look like too monolithic? That will have problems with maintenance and scaling? And features that overlap with many already existing cli tools?

I think Nu generally plays nicely with other CLI tools and data sources. For example if you've got an external executable that emits JSON, all it takes is `from json` to convert that output to a Nushell table.

It's so wildly awesome to deal with data natively in nushell than donhacky shit with jq and strings... In bash. No thanks.

Re: Nushell.sh ls | where size > 10mb | sort-by modified

#127

I tried to use it as my main shell for a couple days, found it fun and potentially useful, played with its unique features... and eventually uninstalled it and went back to zsh. For 99.99% of what I use a shell for, Nushell doesn't do anything that I can't do with a regular shell. Maybe just because I'm used to shells/sed/awk/etc. For the few cases where Nushell could be useful, I can usually do the same thing with V…

What if someone starts from a clean slate. Which shell is better? That is the question. Old habits hold us back from progress in usability. Eventually if one system is better it should completely replace the old system. But only if it's better. What one power user deems as "useful" according to his own usage patterns shouldn't be a metric for measurement. I haven't played with nushell yet, but it actually seems more…

> What if someone starts from a clean slate. Which shell is better?

Then they learn the better and end up having to learn bash anyway coz that's what runs on remote machines.

There is also not that much to be gained. Common easy tasks might be easier to learn but just few percent faster in the end. Harder ones are faster by one-off script in "real" programming language most of the time. Harder repeatable one should never be written in shell or shell-like language because it is just a terrible one to write any real programs.

Also if you really spend that much time gnobling in shell you'd be FAR better off investing time into learning configuration management tools.

Re: Nushell.sh ls | where size > 10mb | sort-by modified

#128
post #91
post #48

Earlier quoted context omitted.

Many of these next-gen shells like Nushell are clearly (and sometimes explicitly) inspired equally by Fish and by PowerShell, and it shows. It's a brilliant combination!

I think the problem with this approach is that it breaks down at some point, and then your only option is to rewrite the entire thing in a real scripting language. I.e., there is no graceful scaling path.

Should be doing that anyway, bash is terrible for actual programs.

Re: Nushell.sh ls | where size > 10mb | sort-by modified

#129

Earlier quoted context omitted.

For some reason I never liked to do it the "right way". First of all it doesn't seem to actually matter. But most of all the cat way just aligns with my mental model more. Data flows left to right, if you catch my drift. It also makes it easier to add arguments to the end if re-running it.

>But most of all the cat way just aligns with my mental model more. Data flows left to right, if you catch my drift. Using ` out_file` (Though annoyingly this doesn't work for feeding input to while loops. `< <(echo a; echo b; echo c;) while read -r foo; do echo "$foo"; done` is invalid syntax; it needs to be `while read -r foo; do echo "$foo"; done < <(echo a; echo b; echo c;)`)

> Using `If you showed that without context it would look like some prefix/lispy notation so no, you are just showing how bad it is
Post reply on HN