Reading the current set of guidelines I was actually a little surprised! It looks like we don’t have a section on “Portability” which may be great to flesh out when talking about the mio
crate, which is chock-full of portability gotchas.
Some thoughts I’d have on the topic of portability:
- First-and-foremost, how should we recommend platform-specific functionality is exposed? The crate currently uses std-style extension modules, but we’ve found that this doesn’t always work great in the ecosystem. Should we use Cargo features instead?
- We should probably explicitly document that all APIs should be “portable to tier 1 platforms” by default. What exactly “portable” means and what exactly “tier 1” means is a bit up for debate, though. Some things that
mio
does, though is:- works on Windows/Mac/Linux
- goes above and beyond to try to provide consistency across platforms, not having one be accidentally “more featureful”
- at the same time, exposing the underlying abilities of each platform where possible
- For crate organization, we may want to specify how one creates, for example, a windows specific implementation and a unix specific implementation. I’ve seen a lot of ways to do this but we may want to just pick one!