6 ms·
A brand new shell, especially in Rust is a great thing to see and also how it tackles the problems that exist in other shells. However, its interesting to see
by rvz 7y ago
A brand new shell, especially in Rust is a great thing to see and also how it tackles the problems that exist in other shells.
However, its interesting to see so many dependencies that are required to build it (73 crates last time I checked) and as shells have always been portable across many operating systems, I wonder how portable nushell would be since it wishes to replace my current shell.
- orf 7y agoThere are 464 dependencies in the complete tree when doing `cargo install`. That's a bit too many. But it's not often you compile your shell from scratch.
- jntrnr1 7y agoIt's definite a lot. We're looking into making more of the features optional, so you can streamline it if you want.
- orf 7y agohttps://github.com/nushell/nushell/pull/341 https://github.com/nushell/nushell/pull/341 now there are only 458 :)
- leetrout 7y agoThat is some impressive insight to the behavior of the lib. Have you ran into that before and knew it was an easy thing to get rid of? I’m always impressed when people show up with fixes like this (that I wouldn’t even know to look for).
- sams99 7y agoI did see quite a few that double up, like 2 versions of url and a few others. Just had a quick play ... on arch linux `yay nushell-git` already works!!! One area where I got a bit stuck was around help. `man where` gave me nothing, `help where` also. I tries stuff like `ls | where type = File` and got a type error. I think it would be amazing if this thing onboarded people a bit nicer, "where needs a condition, to learn about where type "help where" ... stuff like that Overall really enjoying the ideas here and I am absolutely going to be following this!
- seaish 7y agoAnd 484 when installing with rawkey and clipboard.
- smt88 7y agoI think the JavaScript/npm world has trained a generation of devs that high dependency counts are a code smell. This can be true, of course, but that's largely because of external factors. In a perfect world, a language's ecosystem would have a tiny stdlib and allow importing of libraries for everything else. The Linux philosophy would be followed strictly. The problem is just that the overhead in securing, maintaining, and organizing all those libraries is pretty large, as we've seen by npm's repeated failures. Of course the *nix community seems to have largely solved the problem, but there's also a massive culture of volunteerism benefiting them.
- ekc 7y agoUNIX philosophy. You mean the UNIX philosophy.
- umanwizard 7y ago
- j88439h84 7y agoMario gives a lot of the benefits of using objects instead of text, but since it doesn't control the whole shell it's less of a commitment. https://github.com/python-mario/mario https://github.com/python-mario/mario
- bsder 7y ago> However, its interesting to see so many dependencies that are required to build it (73 crates last time I checked) The problem is that Rust has two issues: 1) In Rust, you don't pay for what you don't use. This means that a lot of stuff tends to be an external library since not using something means you can exclude it COMPLETELY. The issue is that things tend to get atomized more finely than most languages would do. 2) Rust is trying to not bake things into a standard library too early. This is a good comment about standard libraries from Python: "The standard libraries constitute one of Python’s great features, but they tend to suck up all the oxygen. Programmers are reluctant to write libraries that duplicate their functions, so poor libraries in the standard set persist. Only a few people, like Reitz, are willing to write modules that compete with the standards." https://leancrew.com/all-this/2012/04/where-modules-go-to-die/ https://leancrew.com/all-this/2012/04/where-modules-go-to-di...
- saghm 7y ago> shells have always been portable across many operating systems Most shells work on just one of either Unix or Windows; the blog post specifically mentions Windows support as being something on the radar of the developers, which Rust is arguably a better fit for than C/C++ (which most shells are written in) due there being a single compiler, standard library, and build tool with first-class support for both Unix and Windows in the Rust toolchain.
- johnisgood 7y agoWhich shells are those? Bash works fine on both Unix and Windows.
- jorangreef 7y agoThe risk of a supply chain attack, roughly speaking, is then multiplied by all 73 dependencies. If any of those are compromised, the shell and system are compromised. To ameliorate the risk, the security of all 73 dependencies would need to be at least an order of magnitude greater, just to catch up to shells with no dependencies. The irony is that this lack of "dependency-safety" is far more easily exploitable than any previous lack of "memory-safety". Of course, this can be easily fixed if developers stop multiplying third-party dependencies, so that importing a dependency involves O(1) risk, not O(?).
- perlgeek 7y ago> But this can be easily fixed. Developers need to stop using third-party dependencies, so that importing a dependency should involve O(1) risk, not O(N^2). How is this an easy fix? Now developers need to develop and maintain O(N) instead of O(1) software projects. I guess that if nushell had a zero dependency policy, it would have never happened. And there is a significant risk to spreading your resources thin when reimplementing sensitive dependencies, like crypto or network / http libraries.
- jorangreef 7y ago> How is this an easy fix? Now developers need to develop and maintain O(N) instead of O(1) software projects. At some point, developers need to take responsibility for the security of their projects. If your project is larger, you will need to maintain more code, whether directly or indirectly. You can't simply import a dependency but never audit it. And if you're taking the trouble to audit a third-party dependency, at some point it becomes worth maintaining directly. > sensitive dependencies, like crypto or network / http libraries. I am not suggesting that developers reimplement TCP.
- sterlind 7y agoI've had to reinvent the wheel, over and over again, throughout my career. Sometimes it was because our environment was constrained (no cloud, needs to be up for major disasters), or because the architecture was unique (no primary, all protocols must be decentralized), or because what I needed didn't exist for my stack. It's pain and sorrow all the way down and I find more bugs in my reinvented wheels than in the actu code I set out to write. How about this: 0. Rebuild from latest stable dependencies, or latest updates to your LTSB, whenever you or your dependencies have a bug. 1. Prefer static linking or lib incorporation if feasible, or use a package manager that properly guarantees you the right versions. 2. Stick to popular repos with responsive maintainers, or 3. Fork the dependency yourself, audit the code and know how to debug it. 4. Watch upstream for security bugs.