Platform independent code and import java.*


I wonder what the policy is for importing classes from java.* et al in projects intended not only for the JVM?

Take a look at this commit, which I believe is not correct:

As you can see in the comment section below the commits, despite there being an import java.util.StringBuilder the resulting Javscript code
works just fine since there is an implementation of StringBuilder in the js-stdlib.

Regards, Tommy


Yes, there is a naming problem there, and we should have a “kotlin” string builder available in the appropriate package, but this is not done yet

So it would be ok to start suggesting a std lib for kotlin and perhaps implement those classes in pure Kotlin?

This makes me glad, I was starting to feel that Kotlin had been tainted by JVM-ness.

For me, Kotlin feels like something like a cross of C# and Ruby, and the std lib should reflect that and not blindly copy atrocious API’s like Java’s StringBuilder class.

While suggesting additions to std lib, keep in mind that interoperabilty with Java is still very important.