4 ms·
Nushell is definitely interesting, and I'm glad it exists, but I'm not using it because of at least a couple of major reasons: - It reimplements all commands.
by imiric 3y ago
Nushell is definitely interesting, and I'm glad it exists, but I'm not using it because of at least a couple of major reasons:
- It reimplements all commands. You're not actually using GNU coreutils, but Nushell reimplementations of ls, rm, etc. See [1].
I understand why it's done, but this has many drawbacks:
1. All existing shell examples and documentation spanning decades are useless. Nushell commands try to replicate existing UIs, but they invariably must be incompatible to support all features and deprecate unnecessary ones, so the only valid source of documentation is Nushell itself.
2. Nushell-specific bugs[2,3]. This goes without saying, and will improve as the project matures, but experiencing bugs with core commands is jarring. I've never had that with GNU tools.
3. Unsupported commands won't have any of the benefits, and you'd still have to parse their output in the traditional way, or use a Nushell helper. How often this happens will depend on your use case, but you'll always depend on Nushell for integrating that command in your workflow.
- Related to point 3, Nushell is building an entirely separate monolithic ecosystem, which goes against the open ideology of Unix. This is similar to BusyBox, where you always have to be aware you're not using GNU tools, but some slightly incompatible equivalents.
More importantly, this approach doesn't scale. There will always be new commands that target POSIX shells, but not many commands will be written specifically for Nushell.
I appreciate what projects like Nushell and Murex are trying to address, but having a saner scripting language and passing structured data in pipelines is not worth the drawbacks for me.
For one, Bash scripting is not so bad if you set some sane defaults and use ShellCheck. Sure, it has its quirks, but all languages do. Even so, the same golden rule applies: use a "real" programming language if your problem exceeds a certain level of complexity. This is relative and will depend on your discomfort threshold, but using the right tool for the job is always a good practice. No matter how good the shell language is, I would hesitate to write and maintain a complex project in it.
And for general QoL improvements with interactive use, Zsh is a fine shell, while still being POSIX compatible.
[1]: https://github.com/nushell/nushell/blob/main/crates/nu-command/src/filesystem/ https://github.com/nushell/nushell/blob/main/crates/nu-comma...
[2]: https://github.com/nushell/nushell/issues/5027 https://github.com/nushell/nushell/issues/5027
[3]: https://github.com/nushell/nushell/issues/9310 https://github.com/nushell/nushell/issues/9310
- hnlmorg 3y ago> I appreciate what projects like Nushell and Murex are trying to address, but having a saner scripting language and passing structured data in pipelines is not worth the drawbacks for me. Murex doesn’t change any of coreutils. With murex can use the command line as dumb byte streams with the standard GNU / BSD utils if you want…and in fact I do just this myself. What Murex offers is an abstraction on top that allows you to add type hints to those byte streams so you can do fancier stuff with it if you wanted. Think of it like what Typescript does for JavaScript. You have access to all the same POSIX utilities and additional type aware controls on top but it’s completely optional if you want to use those type aware controls (personally, I think once you do, you wouldn’t go back, but I respect people’s personal preferences).
- imiric 3y agoAh, thanks for clarifying. That's actually a better approach, IMO.
- ripley12 3y ago> Nushell is building an entirely separate monolithic ecosystem, which goes against the open ideology of Unix I wouldn't entirely agree with that (but I am biased, I work on Nu). One of the nice things about Nu is that it's trivial to bring in data from elsewhere; if other tools speak JSON, XML, TOML, CSV, etc. it's easy to bring that into a Nu pipeline.
- KingMob 3y agoYou may be interested in https://www.oilshell.org/ https://www.oilshell.org/. It has many of the same end goals as nushell with more of an upgrade path from bash planned. You can start with full compatibility, and then turn on shell opts as you get comfortable to enable new behavior and disable bad old practices.
- imiric 3y agoThanks. I'm familiar with Oil, and appreciate its gradual approach to compatibility, but I'm not the target user for it. > It's designed for programmers who know Python, JavaScript, or Ruby, but avoid shell. I know Python and JS, but I don't avoid shell. :) I differ with the Oil authors in that I don't think that my shell should be a programming language. The warts in shell scripting are not insurmountable, and for the simple use cases that it's meant to be used for, it's perfectly adequate. For anything beyond a comfortable level of complexity, I reach for a proper programming language. This approach has served me well over the years, and I don't experience any of the compatibility drawbacks of using an alternative shell, or maintenance drawbacks of using a niche shell-oriented programming language.