This is f***ing ridiculous. Due to type erasure, you can't create an array of a generic type T without having an object of type T and using reflection to make an array of the same type. But if you create an Object array, you can't cast it to a T array either, since an Object array that will always contain T's is not the same as a T array (as it shouldn't be, but dammit, the type system should realize this operation is safe!).
So I thought, ok, I'll pass in a function that will create an T[] of arbitrary size. Except then I have to create yet another damn interface, and implement the stupid thing. This is nothing new, but what really irritated me was that I just now remembered that faking higher order functions in freaking C++ is easier than this--you just overload the function call operator. Alteratively (and a better approach) is simply to assume the type T passed in will have a member function named, say, "apply", and then the typechecker will make sure this is true of T once the template is instanitated, so you can fake structural subtyping. Don't get me wrong, I fully (and painfully) understand the issues with C++ templates, but seriously, we're in a bad situation when C++ is beating Java.
So I thought, oh yeah, I have a wrapper lying around that is intended to wrap constructors. It basically has only one function, makeObject, with the type alpha->beta. Except I can't use it, as is. Know why? The argument type I need is "int", and "int" is not a type that can be used to instantiate type variables. So then I have to deal with freaking "Integer". Boxing helps, though marginally.
Btw, have I mentioned that the Fluid library includes a class "ArrayIterator", because in order to make an array something that you can iterate over, you have to WRITE CODE??
Perhaps one argument for having "dynamically typed languages" is that then you can have a screwed up language where you'd have to jump through hoops to get a typechecker to accept it if you had one, but people won't notice because they don't have a typechecker. Somewhat ironically, Java's ugliness is far more apparent to me now that it has a slightly less primitive type system, since it makes the the language's flaws all the more obvious.
Somebody, quick, write a translator (that you've proven correct) from Java to Scala. Ok, I'll give you a little more time, since you do have to first formalize the sematics of both Java and Scala... (though I think someone has done this for Java, since they tried to prove its whole disgusting mess as type safe).