Mohit Khanna06/22/2021, 7:55 PM
Evan06/22/2021, 8:15 PM
will help cut down on the iOS binary size. I’m interested if anyone else has other insights or optimizations!
kpgalligan06/22/2021, 8:20 PM
Evan06/22/2021, 8:27 PM
still the best way to reduce the size of a resulting iOS binary as far as you know? Has there been any further R&D on this topic?
kpgalligan06/22/2021, 8:27 PM
Sam06/22/2021, 8:45 PM
kpgalligan06/22/2021, 8:45 PM
K/N binaries must include the Kotlin runtime which will add some weight to the app.Yes, true, but the reason you can't have multiple dependent frameworks, and (I would guess) a reason why you can't do reflection, etc, is because it doesn't include all of the runtime. Just the part you need. Swift used to require the runtime be included, which added ~20m, but apple (and apple devs) knew that was only temporary.
Yev Kanivets06/23/2021, 4:19 AM
Pavlo Huk06/23/2021, 7:24 AM
Mohit Khanna06/23/2021, 6:39 PM
kpgalligan06/24/2021, 11:34 AM
handled at language level in upcoming versionsWell, I would expect the Kotlin team would say
is already in the language. If it's your own code, we recommend doing this now, but obviously there's a limit to this.
combination of annotation and compile time pluginWe've explored this. We tried writing a compiler plugin that would change visibility to
unless annotated. The first major issue is that currently you can't change the visibility of existing classes. We'd need to modify the plugin sdk somewhat. JB has suggested we could do that and submit the changes, but we haven't gone down that road yet. There are bigger issues. You'd want to make sure anything you make visible to objc also has anything it references visible. That includes parameter and return types, specifically referenced generics, etc. Not impossible, but there's certainly room for issues.
Mohit Khanna06/24/2021, 8:02 PM
kpgalligan06/24/2021, 8:10 PM