KEMBAR78
Low-level metadata library for ECMA-335 by kennykerr · Pull Request #3560 · microsoft/windows-rs · GitHub
Skip to content

Conversation

@kennykerr
Copy link
Collaborator

@kennykerr kennykerr commented Mar 26, 2025

This update introduces a low-level library for reading and writing the ECMA-335 format used by Windows to describe APIs.

I have written numerous parsers for ECMA-335 over the years but have struggled to come up with a decent generator, but I think I have finally landed on a capable low-level library design and implementation for both reading and writing metadata efficiently and concisely. As an example, I used it to write an MDMERGE knockoff in about 100 LOC.

You might say this is a reversal of #3266 where I made the decision to focus on windows-bindgen, but I think that Rust binding generation is now sufficiently mature that I can once again revisit metadata generation, as the weakest link in the toolchain. So this is the first step in that direction.

This update includes:

  • windows-ecma335 library crate with the low-level reader and writer.
  • test_ecma335 crate with basic test coverage for this library.
  • tool_merge as a basic MDMERGE-like tool for merging .winmd files.
  • Various unrelated Clippy nightly suggestions to pass build validation

Next steps:

  • Improve test coverage.
  • Update windows-bindgen to use this metadata reader so we only have one Rust parser.
  • Build front-ends to read IDL and header files to produce metadata directly using the windows-ecma335 library.

@kennykerr kennykerr merged commit 3fd93b0 into master Mar 26, 2025
36 checks passed
@kennykerr kennykerr deleted the ecma3 branch March 26, 2025 16:00
This was referenced May 14, 2025
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