4 ms·
> what do you like about Nu shell specifically? A whole bunch of things: 1. abandonment of POSIX shell syntax. We can do better. I'm happy with Zsh being POSI
by kbd 5y ago
> what do you like about Nu shell specifically?
A whole bunch of things:
1. abandonment of POSIX shell syntax. We can do better. I'm happy with Zsh being POSIX-compatible, and that will always be there.
2. a focus on structured data. Nu basically has hierarchical dataframes built-in, along with lots of facilities for their manipulation. There have been a few other attempts at this but the benefits are obvious. Rather than figuring out how to `awk` your way through whatever text output a command generates, command output in Nu is structured and everything can be handled in orthogonal ways.
3. modern conveniences built-in, like syntax highlighting, and AFAIK they want to include features like "do something when you cd into a directory" that we currently need more tools for (i.e. direnv, which I highly recommend!)
4. serious technology. The people behind it are experts and JT has been showing off (https://youtu.be/3o8b_QcrFHc https://youtu.be/3o8b_QcrFHc) the engine that enables trivially parallelizable loops. No more need for `xargs`.
5. I hesitate to mention "made in Rust" as a feature, but using a modern language for core infrastructure does matter.
- kbd 5y agoI'll put it this way: Nu shell seems perfectly supportive of my philosophy that a shell is basically a REPL for a computer, and they're taking the ergonomics of an interactive REPL along with the programming language that powers that REPL seriously. The thing is, there's currently NOTHING GOOD for "shell scripting". Shell sucks (yes it does), so for anything more than very short things I'd rather write Python. But Python sucks for shell-like things, parallelization, it has slow startup, and you also can't do things like put environment variables into your session or change the working directory, so you often wind up writing shims (eg. Broot's br alias - https://dystroy.org/broot/install-br/ https://dystroy.org/broot/install-br/). Yes I've looked at Xonsh but maybe the additional syntax is offputting to me. Like, I wouldn't use it as a shell over Zsh (how's Xonsh's fzf support? I don't know, but I know everything's going to support Zsh), and I dunno if I want to use its syntax extensions over just Python. Though It's always on my list of things to re-explore, and maybe it'll click one day. But it being based in Python makes it feel slow (I wrote my prompt in Zig to get it to be fast...) This is relevant to mention: I wrote a small Python library (https://github.com/kbd/aush https://github.com/kbd/aush) that's basically a DSL for subprocesses, so it tries to make it more convenient to do shell-like things. I find it preferable to shell or Python alone most of the time. Here's an example of its use in my script that creates a new Python project: https://github.com/kbd/setup/blob/master/HOME/bin/create-python https://github.com/kbd/setup/blob/master/HOME/bin/create-pyt... I haven't figured out a convenient way to implement shell piping well with Python's pipe operator, or pass through interactive output directly (so things that "update" the display, like poetry and npm don't behave the same as they do interactively) so it's still .9 status, but it works really well for what it is, and you can always write "regular Python" along with it. Anyway, Nu seems to be an attempt to put a "real" programming language REPL in my shell, from people who have serious language experience, so I'm hopeful it'll be great.
- enriquto 5y ago> A whole bunch of things: I appreciate the clarity of your message... curiously enough all the things that you mention I see them as anti-features of nushell (except the first one) 1. Posix shell is clunky has its limitations but there's nothing really flawed about it. It is nice to have non-posix shells, though; in that I agree with you. 2. I hate hate hate the very concept of dataframes. They seem like a useless over-engineering. Plain tabular data is a perfect, and the columns of a table are always named 1, 2, 3. The whole point of abstraction is that you do not care about the meaning of the columns of your table, and the programs (like the lovely awk) that deal with these columns do not care either. There's nothing more "orthogonal" than that: filters that do not understand the data but can filter it anyway. 3. syntax highlighting is a very personal issue; in my case I prefer my terminal not to look like a christmas tree. 4. xargs is one of my favorite tools (alongside gnu make and gnu parallel) and there's nothing "unserious" about it. The happiest moments in my programming life are when I get to use these tools. Not using xargs sounds like a nightmare! 5. Rust is definitely an anti-feature to me: it's like a language that was built by picking the worst features of many already ugly languages. I would not really care in what language the shell is written, but I'd rather have it written in saner, "unsafe" languages.
- nerdponx 5y agoI strongly disagree about data frames. I am a data scientist professionally, and I think the data frame is one of the most important programming abstractions I use.
- duckerude 5y ago> Posix shell is clunky has its limitations but there's nothing really flawed about it. I think shellcheck is the best argument against this. POSIX shell is just stuffed to the brim with weird gotchas, places where the obvious way to write something causes subtle bugs down the line. It's the only programming language I use that feels adversarial, where you have to be paranoid to properly solve simple tasks. (Admittedly some of that is because of the reliance on system programs rather than the shell language itself.)
- 5y ago