- About Scala
- In the Enterprise
- Scala Community
- Language Research
- In the Press
- The Scala Team
- Scala's Prehistory
- Contact Us
- Learning Scala
- Tour of Scala
- Scala API
- Setup & Getting Started
- Programming Guides
- Other Guides
- Code Examples
- Scala Developers
Proguard shrinking and Scala collection library [was 'a kill to a view']
On Sat, Dec 17, 2011 at 5:45 PM, martin odersky wrote:
>> No, but proguard isn't able to remove view classes in many cases even
>> if they are not used any where in user code. And they are the current
>> road block for using the Scala standard library with Android.
> It would be good to dig deeper on this one. Why can't proguard remove
> these classes?
I don't know. You can enable some kind of verbose mode in proguard
where it's supposed to print out a trace why it keeps certain things
but as far as I looked it up in the sources of proguard, the verbose
mode works differently from the normal case, runs much longer and
doesn't finish or provide useful output when it's finished.
In general, it seems to me that shrinking is really hard (probably
even undecidable?) for a language with virtual calls. Especially,
Scala's collections class hierarchy appears to be a particular hard
case because it really needs and uses virtual calls all over the
place. From what I've seen proguard's shrinker isn't sophisticated
enough to get even near an optimal solution in those cases.
Probably we should talk to the Proguard developers, maybe they can say
what's going on exactly.