days
-1
-1
hours
0
-9
minutes
-1
-6
seconds
-3
0
search
Beta late than never

Beta candidate available for Kotlin 1.0

JAX Editorial Team
© JetBrains.com

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!

After four years of development time and a total of 14 milestones, JetBrains’ JVM language Kotlin now has its first beta candidate available. Version 1.0 of the statically-typed programming language for both the Java and JavaScript platforms is therefore within reach.

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?

Kotlin is developed by Czech tool vendors JetBrains and is aimed at Java and JavaScript platforms. It can be compiled into bytecode or JavaScript, with its features including a static type system, object orientation, procedural programming (using functions that support Variable Type Inference) and support for closures.

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 plus and minus for unary functions, unaryPlus and 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 WARNING, ERROR or 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 equals() and 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.

Leave a Reply

Be the First to Comment!

avatar
400
  Subscribe  
Notify of