Android app size and lib_FoundationICU.so

I'm getting here from the KMP thread, and while I agree on a leaner Foundation (and the Swift runtime, with a 10MB "core" plus 10MB libc++_shared.so is not a cakewalk either), I kind of disagree with the initial assumptions of this thread.

Here we tend to talk about apps, and apps definitely need localization, no doubt about that. However, from a cross-platform perspective, the common (and most sane) use case for Swift in Android is to create a library to share the business logic of the apps.

In this scenario, localization can be made a frontend/view concern to be resolved within the respective UI frameworks (SwiftUI and Compose), outside Foundation, IMHO. At least, I think that localization should be strongly opt-in, because in most cases, there are better workarounds to avoid its dependency at the library level (e.g. string keys, error codes, absolute UNIX/UTC timestamps).

My two cents.

3 Likes