Skip to content

Conversation

@yordis
Copy link

@yordis yordis commented Oct 17, 2025

@alexcrichton
Copy link
Member

Thanks for this! Are you looking to get this merged ASAP? Or is this more of a proof-of-concept to support the development of the PR on the spec itself? If you're looking to get this merged sooner-rather-than-later, do you have plans to work on other parts of the stack such as wit-bindgen or Wasmtime?

@yordis
Copy link
Author

yordis commented Oct 20, 2025

@alexcrichton no rush at all in my end. I want to learn how to do the whole thing if possible if that is ok with you

@yordis yordis force-pushed the yordis/add-map-support branch 3 times, most recently from 8a0b8c4 to cd02439 Compare October 21, 2025 01:13
Signed-off-by: Yordis Prieto <[email protected]>
@yordis yordis force-pushed the yordis/add-map-support branch from cd02439 to 2487714 Compare October 21, 2025 02:11
@yordis
Copy link
Author

yordis commented Oct 21, 2025

Note for self: 0x63 why is that typed in so many places instead of having a enum somewhere?

@yordis yordis marked this pull request as ready for review October 21, 2025 19:39
@yordis yordis requested a review from a team as a code owner October 21, 2025 19:39
@yordis yordis requested review from pchickey and removed request for a team October 21, 2025 19:39
@alexcrichton alexcrichton requested review from alexcrichton and removed request for pchickey October 21, 2025 21:51
Copy link
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok looked over things, and thanks for this!

In terms of implementing this, adding a new type is a relatively major endeavor that takes awhile as there are a lot of integration points. Given that we'll want to make sure that this work is properly "gated" from external users to avoid, in theory, accidentally hitting unimplemented parts of the type system. The primary way this is done is via WasmFeatures in the wasmparser crate. What I'd recommend is adding a new cm_map feature similar to cm_fixed_size_lists. Effectively you'll want to add a bunch of tests/checks/etc in the same manner as fixed-size-lists, also an unstable feature at this time.

Additionally you'll want to add tests in tests/cli/component-model/*.wast for this new type as well. You should be able to find tests for fixed-size-lists around there and you can structure tests in a similar way.

Other than that though I think this would be reasonable to land. After landing here would come integration work into wasmtime/wit-bindgen/etc.

@yordis yordis requested a review from alexcrichton November 21, 2025 19:56
Copy link
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, thanks! The remaining things I can think of are:

  • This needs a new feature gate in wasmparser's validation to ensure that this isn't accidentally usable-by-default.
  • This needs *.wast tests for the component-model side of things to ensure that the type works in the text format, validation, etc. There should also be tests ensuring that if the feature gate is disabled that usage of the type is an error (you can copy fixed-size-list tests for example)
  • Tests are currently not passing in CI, so that'll need to be green

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.

2 participants