Skip to content

Introduce windows-sys crate#1310

Merged
kennykerr merged 3 commits intomasterfrom
sys
Nov 11, 2021
Merged

Introduce windows-sys crate#1310
kennykerr merged 3 commits intomasterfrom
sys

Conversation

@kennykerr
Copy link
Copy Markdown
Collaborator

@kennykerr kennykerr commented Nov 11, 2021

Analyzing compile time indicates that most of the time building the windows crate is spent parsing function bodies. Those functions provide support for a more idiomatic developer experience. Even though those function bodies essentially compile away to nothing, the extra compile time makes adoption of the windows crate prohibitive in some cases. The windows-sys crate will simply have function declarations (externs), structs, and constants, and not include any function bodies. This is essentially the underlying ABI for the Windows API.

Today, the windows crate "inlines" this ABI and hides it from the developer. With the introduction of the windows-sys crate, the windows crate will instead defer to the windows-sys crate for those declarations. A developer can then choose to use the windows crate directly for convenience, safety, and productivity, or use the underlying windows-sys crate for no-compromise compile time when that matters most.

As always, all declarations will be generated from metadata. This PR just adds the basic scaffolding. Splitting out the ABI code gen is next.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant