Fair enough of the principle, but do any of those work like that? Last I checked there is a huge amount of code in std and the community that assumes a unix-windows dichotomy.
A huge amount of boilerplate for each crate
Huh? My proposal is that we cfg just like today, but something checks to ensure regardless of the (valid) combination of cfg tokens, there are no unresolved identifiers. The compiler, not the users "proves" that that the cfgs are total. If anything the problem would be compilation time bloat, not code bloat.
Semantically backwards
I am not sure what you mean.
Relatively inextensible
Do you mean any(os(windows), os(unix)) seems total, but then somebody adds multics to rustc, so the code wasn't so portable after all? We can avoid that.
I looked at this during the āshould forget be unsafeā discussion, and I do believe it should be possible to have destructors guaranteed while having reference counting. (Specifically, the guarantee would be that an object would be guaranteed to be destroyed by the end of itās valid lifetime.) Rcs containing only 'static data could be used exactly as today, since they would be okay to leak. (Their valid lifetime is āforeverā.) Rcs containing non-'static data would either be statically prevented from containing cycles (which would require a way to specify that one lifetime strictly outlives another) or would be used with a scope-guard cycle collector that makes sure any cycles are cleaned up.
Iām not a big fan of this. It feels āworse than Cā. At least in C or C++, you need to #include <platform_specific.h> before using any platform specific APIs. I would rather have any platform specific APIs stuck in some sort of std::sys, which says āif you use these, your code is not guaranteed to compile everywhereā, kind of a thingā¦ Iām not sure, though.