Last week, JetBrains announced their new statically typed language Kotlin at the JVM Language Summit. Kotlin joins the elite group of statically typed languages : Scala, Gosu, Ceylon, Fantom, targeted to run on the JVM. Scala is the most mature in this statically typed landscape. Fantom supports static and dynamic typing, so it may not be directly competing with others. Both Ceylon and Kotlin are not publicly available yet, but the documentation can give you a preview of how these languages shape up. Kotlin definitely has the potential to attract Java developers due to its backing from the leading Java IDE maker. The good news is Kotlin will debut with an IDE support from day one, but this keeps expectations high on this project.
While Kotlin and Ceylon try to score on the “complexity attribute” of its mature competitor Scala, it may very well become a competitor to Java 8 from an adoption perspective. Java 8 will include support for the most sought after language feature Lambda is slated for late 2012 release. Both Ceylon and Kotlin plans to support higher order functions among others may have stable releases around that time frame. As these young languages are work in progress, it provides an excellent opportunity for them to receive constructive critique from the community and possibly fix or clarify their design choices. Given some of the features that could be implemented as compiler plugins in Kotlin makes it a perfect candidate for experimenting advanced language constructs that were once alien to Java.
Can Kotlin attract Java developers?
Well, it certainly has the potential to attract Java developers and you can already see huge interest from the developer community (Kotlin language documentation is already flooded with feedback) trying to understand what Kotlin can bring to the rapidly innovating JVM platform languages. Some blogs debate its cool new features and its approach to becoming the next big JVM language (NBJL). In addition to the cool features it plans to support, Kotlin incorporates some good idioms from Josh Bloch’s Effective Java. The language documentation references at least 10+ idioms from Effective Java which shows its commitment to adopting best practices that aid developer productivity and program maintainability. Here are some of those idioms highlighted in Kotlin documentation:
Item 11: Override clone judiciously
Item 14: In public classes, use accessor methods, not public fields
Item 16: Favor composition over inheritance
Item 17: Design and document for inheritance or else prohibit it
Item 18: Prefer interfaces to abstract classes
Item 23: Don’t use raw types in new code
Item 24: Eliminate unchecked warnings
Item 25: Prefer lists to arrays
Item 28: Use bounded wildcards to increase API flexibility
Item 38: Check parameters for validity
Item 43: Return empty arrays or collections, not nulls
Item 65: Don’t ignore exceptions
Item 69: Prefer concurrency utilities to wait and notify
Kotlin documentation by far is the most comprehensive source of information about the language and its syntax and it is well maintained. Once again JetBrains folks hit the right chord as the documentation is crucial for any language adoption early on. I do believe JetBrains would continue to deliver its promise of “Develop With Pleasure” with Kotlin too. So far, I have liked Kotlin’s approach to becoming the NBJL and its rich feature set and expressive syntax undoubtedly makes it a compelling choice for developers alike.
4 thoughts on “Project Kotlin, a new JVM language to rescue Java developers?”
I haven’t invested any time in Gosu or Fantom, but have been following Ceylon since it was accidentally announced. I have quite a bit of trust in Gavin King’s reasoning and share (perhaps mimic?) his position on things such as the importance of static typing and various code aesthetics. Thus, I’m really excited about ceylon. I have been toying with Scala, and really enjoy it. I have some academic background with functional programming and find some of Scala’s more powerful features to be compelling — but pretty esoteric to the average developer. So on one hand I love the fact that there is enough production time and adoption of Scala to make a moderate business case for adoption, but its hard to quantify the impact that such “complexity” for the future maintainers of scala projects. It’s a hard balance to strike: enough expressiveness to get optimal efficiency without making it difficult to maintain/read/etc by junior developers.
One thing is certain: all of this “exploration” in the space of language design will yield a _better_ net result. I have had feature envy over C# for years, but think that when this NBJL phase completes we’ll end up with something _more_ expressive with _less_ cognitive cost — i.e. “better”. Just as Java’s middleware ecosystem is better via competition and “community exploration” so too will its language (I hope).
You certainly make a good point about maintainability of code. I believe Kotlin and Ceylon has similar intentions to keep learning curve as minimal as possible and still be productive with expressiveness of the language without compromising simplicity.
It is true the gap is widening between C# and Java in terms of innovation, which can only be compensated by these noble attempts in the JVM ecosystem. I wish they make the prototype compiler available soon, wanting to try out some of these cool features.
“Kotlin definitely has the potential to attract Java developers due to its backing from the leading Java IDE maker.”
Umm, last time I checked, the leading Java IDE maker is Eclipse. What is the Kotlin story for Eclipse?
Well, at least from this recent InfoWorld article, it looks like IDEA is topping the Java IDE category. Any way, the point is not about IDEs here, JetBrains obviously has commercial interest in producing a competitive language (which btw would be Apache licensed) backed by a quality IDE. It looks like Eclipse already has Xtend, which probably has similar intentions but not full blown language like Kotlin or Ceylon.