Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose provider::Baked as per-formatter Fork providers #5922

Open
Manishearth opened this issue Dec 18, 2024 · 2 comments
Open

Expose provider::Baked as per-formatter Fork providers #5922

Manishearth opened this issue Dec 18, 2024 · 2 comments
Labels
C-data-infra Component: provider, datagen, fallback, adapters discuss Discuss at a future ICU4X-SC meeting

Comments

@Manishearth
Copy link
Member

Manishearth commented Dec 18, 2024

The current scenario with baked vs other providers is that you have roughly equivalent functionality, except there is no easy way to do fancy data provider stuff with baked data. You can't easily mix baked data with buffer data, or "intercept" the baked data load to understand resolved locales as needed by some strategies for storing resolved options (#5900).

A concrete use case would be wishing to use a hotloadable buffer provider for locale data, and baked data for closed sets of data (like digits data, UCD data, etc).

We do have provider::Baked in each crate but it's not all the data needed by the type. It would be nice if each formatter type had a const fn get_baked_provider() -> impl DataProvider ... that produces a baked data provider that works for that type. Typically it will be provider::Baked, or it will be something like ForkByKeyProvider<provider::Baked, othercrate::provider::Baked>

cc @sffc @robertbastian

@Manishearth Manishearth added C-data-infra Component: provider, datagen, fallback, adapters discuss Discuss at a future ICU4X-SC meeting labels Dec 18, 2024
@Manishearth
Copy link
Member Author

@sffc noted that the ForkByKey provider doesn't implement DataProvider the way we want it to because of specialization, but we could instead use a macro to generate a custom type with a host of DataProvider impls

@Manishearth
Copy link
Member Author

We can also do this in the metacrate, using the registry. Per-formatter baked providers are not strictly necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-data-infra Component: provider, datagen, fallback, adapters discuss Discuss at a future ICU4X-SC meeting
Projects
None yet
Development

No branches or pull requests

1 participant