Beta candidate available for Kotlin 1.0
Kotlin 1.0 is now available in beta mode after 14 milestone releases. JetBrains’ JVM language, developed over a period of four years, packs in Java interoperability, changes to the language itself as well as IDE improvements. Test it now!
The binary format is considered final, with major language changes for the official beta and final version no longer planned, according to the Russia-based team. Compared to their last milestone, the beta candidate still contains some considerable innovations.
What is Kotlin?
Since February 2012, Kotlin has been made available via open source. The creation of Kotlin came about due to JetBrains originally believing that other JVM languages such as Scala and Ceylon were too complex or too slow.
Language changes and Kotlin collections
Since the last milestone, the
operator modifier was required on functions in the interest of operator overloading. This also now applies to infix functions. To this end, every Java function can now be used with an appropriate signature as an operator. To avoid confusion, some changes to operator names have been made as part of the beta, where instead of
minus for unary functions,
unaryMinus are now to be used.
In addition, the functional annotation
@Deprecated has been expanded: Using
ReplaceWith("...") to specify a replacement now provides you with a level via
HIDDEN and determines the behaviour of the compiler.
Kotlin collections are similar to Java collections but have ‘interfaces’ that distinguish between variable and ‘read-only’ collections. The main change in the current beta release is that collections and other core APIs have been cleaned up: For example,
size is now a property and
contains is type-safe. Through these changes, the library is set to “feel more like Kotlin” and stay compatible with Java at the same time.
Java interoperability, IDE changes and tools
Kotlin is now better equipped for static Java methods, fields and classes. For example, inherited nested classes, static methods and fields from Java classes can now be used inside their Kotlin subclass. Access to inherited Java static methods and fields are also available through their subclass name.
The interface inheritance rules are now compatible with Java 8 and
Int and other basic types are serialisable on the JVM from now on. Forming part of the IDE changes, autocomplete supports callable references and the methods
hashCode() are easier to generate, with unit testing becoming lighter overall.
With regard to tools, it should be noted that the compiler daemon is now enabled by default in the IDE, which now supports parallel compilation of independent modules. Other amendments include the removal of external annotations options in Maven and Gradle.
And finally, Kotlin now has a 200k-smaller
kotlin-runtime library, with the aim of additional improvements (without breaking changes) to further reduce its size. Read more in the official blog post here.