4 ms·
> rustup is a toolchain manager for Rust I'm hoping this follows the "functional" paradigm, where a compile command is invoked, and the compilation result depe
by amelius 11y ago
> rustup is a toolchain manager for Rust
I'm hoping this follows the "functional" paradigm, where a compile command is invoked, and the compilation result depends solely on the arguments of the command, and not on configuration files and such. This makes it much easier to script things, to use alternative build systems, and, in general, to keep things predictable.
I'm saying this because I'm detecting a trend in a different direction, where tools are making things more confusing instead of more clear.
- caconym_ 11y ago> I'm saying this because I'm detecting a trend in a different direction, where tools are making things more confusing instead of more clear. Rust tools in particular, or tools in general? Just curious; the ease of use of Cargo is one of the things that initially drew me to Rust, and rustup seems pretty cool too (just used it to install Rust nightly on a new machine) but I have not done any serious work with Rust yet.
- steveklabnik 11y agoRustup manages installing rustc, cargo, and toolchains: it's not what you use to compile. Cargo does have a single Cargo.toml that manages per-project config stuff. But keeping it in a file is part of repeatable builds...
- jzelinskie 11y agoMy opinion is opposite of the GP: why isn't this just in Cargo? I'm locking all of my other dependencies, why not the language?
- steveklabnik 11y agoCargo cannot control versioning of Cargo, or at least, an external tool that handles versioning everything seems conceptually cleaner to me than making Cargo version both Cargo and rustc. It's also pretty similar to tools in other ecosystems. There is ongoing discussion about possibly adding configuration to Cargo packages with a minimum rustc version for the package; the details have not all been worked through yet.
- brson 11y agoThis question comes up a lot, and we've debated it a fair bit. There are a few key arguments for keeping them separate from my perspective: First, they have distinct audiences. Cargo is a tool for building Rust programs no matter how you obtained the compiler. rustup is a tool fundamentally for installing the official Rust binaries. So if Cargo contained rustup, that would be a large chunk of features that have an very unclear role when Cargo is distributed by Linux distributions, and would probably need to simply be compiled out. That last point about compiling out rustup also points to the fact that Cargo's and rustup's features are completely orthogonal. There's no technical reason to combine them. Of course, the practical reason to combine them is that one tool is conceptually simpler than two. Even I have found myself accidentally typing `cargo update nightly`, `rustup build`, etc. Finally, releases of Cargo today are paired with releases of rustc. Distributing the Rust installer with Cargo would necessarily change that relationship. That is, there would be one global Cargo that is used with every revision of rustc. This isn't necessarily a bad way to arrange the tools, but it is a big change from today that would require significant effort to move to.
- yazaddaruvala 11y agoHaving had this same conversation in the past: I want to say thanks for all the hard work! Regardless of anyone's rationalizations about 1 or 2 or X tools, having great tools exist is most important!
- Ericson2314 11y agoYes coming from nixos, this "foo install me tools; bar build me project" ideom is quite primitive. I have an long-open RFC that I hope will get cross-compilation working the right way https://github.com/rust-lang/rfcs/pull/1133 https://github.com/rust-lang/rfcs/pull/1133. That said RustUP is still a fine easy way to get compilers builds as opposed to standard library builds. I view it as convenient duck-tape analogous to Haskell's stack in that regard.