Replies: 2 comments 12 replies
-
In general I agree. The overall design of ICU4X is to put data loading front and center, however I actually do expect most pure Rust users to just use compiled data, and adding more convenience APIs seems good. I suspect most disagreement will be from the angle that data loading must be explicit. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I think there are numerous advantages toward making calls through the data structures explicit rather than implicit. However, I'm amenable to convenience constructors that improve discoverability. For example: // Current:
PropertyNamesLong::<Script>::new().get(Script::Adlam)
CodePointMapData::<BidiClass>::new().get('🎃')
// Alternative:
Script::long_names().get(Script::Adlam)
BidiClass::code_point_map().get('🎃')
// Also allows for:
Script::long_names_with_buffer_provider(&provider).get(Script::Adlam)
BidiClass::code_point_map_with_buffer_provider(&provider).get('🎃') |
Beta Was this translation helpful? Give feedback.
12 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In the course of using
icu_properties
I've run into a number of little ergonomics issues that seem like they could be improved:Script
instances is unintuitive. I would expect the majority of users are using baked-in data, which means it should be possible to have methods onScript
for doing these conversions, likeScript::short_name
orScript::long_name
, or aScript::from_short_name
constructor.Script::for_char
constructor?CodePointMapData
, couldn't we have a type method on the relevant type, so that I could callBidiClass::codepoint_map
? In the case where this is borrowed static data this could even be available as a const, likeBidiClass::CODEPOINT_MAP
or something?In any case these are just a couple ideas, and someone who has spent more time on this project might have better ones.
Beta Was this translation helpful? Give feedback.
All reactions