5 ms·
Hey hey, this post is great! A few small comments: > It's not obvious to me why they do this – it's a documentation generator, why does it care what version o
by steveklabnik 6y ago
Hey hey, this post is great! A few small comments:
> It's not obvious to me why they do this – it's a documentation generator, why does it care what version of the Rust compiler I'm using?
rustdoc, being a part of the Rust distribution, has the same stability guarantees that Rust does: once it gains a feature, it will never go away. We (well, not me I don't really work on rustdoc, to be clear) need the capacity to try out new features without committing to them, same as features in the language.
> PyPI launched in 2003, and CPAN has been running since 1995
Neither of these support namespacing though, right?
> Cargo's unit of distribution is the crate, which is a problem because Rust's compilation unit is also the crate.
Cargo's unit of distribution is a package, which is one or more crates. It is true that there can only be one library crate per package, however. This is one area where people don't use the correct words super often, honestly.
> Of course build times are slow if changing one line of a leaf file requires rebuilding dozens of modules.
This shouldn't change based on if you're using Cargo or not; if it's re-building dependencies every time you touch a file, that is a bug.
- jmillikin 6y ago> rustdoc, being a part of the Rust distribution, > has the same stability guarantees that Rust does: > once it gains a feature, it will never go away. We > (well, not me I don't really work on rustdoc, to be > clear) need the capacity to try out new features > without committing to them, same as features in the > language. I guess I expect rustdoc and rustc to be much less tightly coupled, so that I could use (for example) stable rustc and nightly rustdoc on the same code. In the current model, I can't use nightly rustdoc features without also using nightly rustc, because the annotations are processed by both systems. You could imagine an alternate model where rustc stabilizes `#[doc(...)]` and leaves everything in there up to rustdoc's interpretation, and nightly rustdoc might enable new parameters to the #[doc] annotation. > Neither of these support namespacing though, right? That's correct. I meant that mostly in terms of "package registries are not a new and untested idea". It's like using strings for file paths: not obviously a bad idea, turns out to be unworkable for obscure reasons, and as a new language Rust got to avoid that particular mistake. It feels like crates.io didn't (/ doesn't) have a similar process of avoiding known mistakes. > This shouldn't change based on if you're using Cargo > or not; if it's re-building dependencies every time > you touch a file, that is a bug. Given a crate with a hundred files, each one fairly independent of the other (i.e. a broad shallow build graph), changing one requires (if I understand rustc correctly) recompiling them all. Otherwise the `crate::` references can't be type-checked.
- migueloller 6y agoWould you be willing to expand on why using strings for file paths turns out to be unworkable? Very curious what the obscure reasons are!
- jmgao 6y agoIf your String type must be valid Unicode (which is true for pretty much every language that isn't C++), it cannot represent all paths. On most unixy filesystems, filenames are arbitrary byte sequences which aren't valid UTF-8, and on windows, NTFS stores filenames as UTF-16, but it allows unpaired surrogates.
- erik_seaberg 6y agoIs that technically UCS-2 rather than UTF-16?
- ChrisSD 6y agoTechnically not since ~2000. Windows uses UTF-16 throughout the OS. That is, Windows strings will be encoded and decoded as UTF-16 not UCS-2. However the tricky bit is that the kernel doesn't enforce this so it's possible for programmers to intentionally make broken UTF-16 strings. A broken UTF-16 string shouldn't be considered UCS-2 just because it happens to be a valid UCS-2 string (otherwise all bit patterns could be called "UCS-2" so long as they are an even number of bytes in length).
- throwaway894345 6y agoWhat languages require string types to be valid Unicode? Go for example let’s you put anything in a string; it’s only Unicode if you put Unicode into the string including via creating string literals.
- ChrisSD 6y agoRust, Java, Swift...
- thayne 6y ago> > PyPI launched in 2003, and CPAN has been running since 1995 > Neither of these support namespacing though, right? But both have policies that prohibit name squatting, whereas crates.io has a policy which explicitly allows it.