Personally I strongly prefer separate crates to a single huge crate with feature flags. To me feature flags are less transparent compared to separate crates. Also separate crates make portability easier (see this proposal). Ideally I would love to see even finer grained split (e.g. separate net
and fs
crates), so it would be very easy to see which capabilities are used by a crate. It would allow for example embedded project to implement the net
core crate and use all crates dependent on it, without bothering with fs
and other parts which do not make sense for it. I think had we this split, we would not get the nonsensical implementation of std
for wasm32-unknown-unknown
.
So in addition to introducing a new attribute you also propose to significantly change semantics of the widely used #![no_std]
? It would break a lot of projects during migration without a good enough reason, so sounds like a non-starter to me.