dotnet / runtimelab

This repo is for experimentation and exploring new ideas that may or may not make it into the main dotnet/runtime repo.
MIT License
1.36k stars 188 forks source link

[NativeAOT-LLVM] Non hybrid globalization requires JS #2557

Open yowl opened 2 months ago

yowl commented 2 months ago

With https://github.com/dotnet/runtime/pull/99956, globalization requires some JS which we wont have for WASI and don't include in the build https://github.com/dotnet/runtimelab/pull/2543#discussion_r1573746907. We should do something else, use the full ICU as before, in the future maybe https://github.com/WebAssembly/WASI/issues/590

maraf commented 2 months ago

@ilonatommy How is globalization working on WASI on Mono?

ilonatommy commented 2 months ago

WASI does not expose Intl API in the same way as browser does, so it's not possible to implement HG there. There are ongoing discussions under https://github.com/WebAssembly/WASI/issues/239 or https://github.com/WebAssembly/WASI/issues/25 mentioning the need to enable it.

maraf commented 2 months ago

The issue explicitly mentions non HG. Do we require JS in non HG or is this issue missleading?

ilonatommy commented 2 months ago

Sorry, misread it. Issue is formed correctly. For NativeName to return correct value we need JS (so HG switched on). Otherwise, we use ICU data that is shipped in reduced size form- without full NativeName info. Theoretically we could start adding that info and pump-up ICU package but already long time ago it was decided against it. I am not sure what is the size change and if custom ICU build would help here, I will need to check it. Beyond that I don't see any "easy" existing solution.

maraf commented 2 months ago

IIUC on WASI we don't correctly compute NativeName, is that right?

ilonatommy commented 2 months ago

IIUC on WASI we don't correctly compute NativeName, is that right?

We return e.g. en-US when the expectation is English (United States). See the original issues about it: https://github.com/dotnet/runtime/issues/44739.