One of the things I hate the most when programming is how much resources are wasted doing the same thing that has been done already thousands of times. We all know that if you do cargo check
for tokio v1
with features = ["full"]
, there will be no errors, but the compiler has no way to know that so it has to repeat the process yet again for the millionth time.
I've been thinking of having a registry that you can ask if a crate with certain configuration type-checks:
Does
tokio
v1.0.0
withfeatures = ["full"]
for targetx86_64-unknown-linux-gnu
type-checks?
Yes.
Ok. Skipping local type-checking for
tokio
.
or
I don't know. Let me type-check it for the next person.
Ok. Type-checking
tokio
locally.
We already have something that does something like this: docs.rs. So this is not too crazy.
This is a lightweight alternative to hosting pre-compiled crates for every possible combination of features of a crate.
I'm not sure what should be taken into account so that we can trust that the same program type-checks correctly in any N environments (should we exclude crates with build.rs
?, crates that use include!
or any other proc-macro?, etc) I'm not even sure if this is a good idea...