swift
swift copied to clipboard
Allow removing Unicode tables from produced binaries
This should reduce our binary size and partially resolve #7
From WWDC 2022 "What's new in Swift" at 5:04: "To make the standard library smaller for standalone, statically linked binaries, we dropped the dependency on an external Unicode support library, replacing it with a faster native implementation."
Is that going to help resolve this issue?
Formally, ICU dependency is removed from the standard library, but in terms of binary size this makes things even worse for people linking with Foundation, because the latter still depends on ICU. In this case binaries have two versions of Unicode tables embedded in them: new ICU replacement in stdlib, and ICU itself from Foundation.
When not linking with Foundation, I don't think you'll see a substantial difference. The Unicode tables are still there, they're just coming from a different source.
I'll rename the issue to mention Unicode tables explicitly to avoid the confusion. In that sense the issue is still not resolved.
Oh good lord. I was so excited! :cry: It would be nice if there was a way to delegate that to the platform somehow. Seems like wasm as a concept takes a hit if every module that needs to deal with unicode correctly has to ship its own tables.
Yeah, if there was a nice way to customize the source of Unicode tables, we could rely on Intl.Segmenter API in the browser. At least that's what Swift String API is using Unicode tables for.