days
1
4
hours
1
8
minutes
5
2
seconds
1
1
search
The wait is over

A first look at Kotlin 1.1

JAX Editorial Team
Kotlin 1.0.5
Source: https://kotlinlang.org/

Kotlin 1.0.X releases are in the pipeline, but the JetBrains team is also working on the new language features in Kotlin 1.1. Here is the first preview version of 1.1.

Andrey Breslav, the lead language designer of Kotlin at JetBrains, offered a first glimpse of Kotlin 1.1 although he warned that it is “far from Beta.” Because it is not a stable version, Breslav gives no compatibility guarantees. However, he claims that syntax, APIs, command-line switches and anything else may be changed in the future previews of 1.1.

What’s under the hood of Kotlin 1.1?

“Many languages support asynchronous programming through dedicated language constructs such as async/await keywords,” Breslav wrote in the blog post. The JetBrains team generalized this concept so that libraries can define their own versions of such constructs. Plus, async is just a function, not a keyword. This design allows different asynchronous APIs to be integrated: futures/promises, callback-passing, etc.

Coroutines represent one of the biggest features of Kotlin 1.1.

Screen Shot 2016-07-15 at 2.44.53 PM

Source: https://blog.jetbrains.com/kotlin/2016/07/first-glimpse-of-kotlin-1-1-coroutines-type-aliases-and-more/

According to Breslav, one of the greatest parts about coroutines is that they can suspend without blocking a thread, and still look like normal sequential code. Here is the detailed description. Coroutine-based libraries will be included with the Standard Library at a later time. This includes JDK’s CompletableFuture, asynchronous IO (NIO), RxJava, and off-loading tasks from the UI thread in Swing.

The team is actively working on the improved support for Java 8 and is adding new functions to the Standard Library. As they rely on Java API version newer than 1.6, they also introduced new artifacts such as kotlin-stdlib-jre7 and kotlin-stdlib-jre8 that carry extra functionality such as AutoCloseable.use(), Regex named groups support and stream-related functions.

JavaScript has not been forgotten either; Breslav announced that they are also working on the JavaScript back-end; the team is close to getting JavaScript (runtime) module systems integrated into the picture, he added.

Find the full changelog for 1.1 M01 here.

How to give Kotlin 1.1 a try

IDE

For those who are already running Kotlin 1.0.3, 1.1 can be installed as follows:

Tools → Kotlin → Configure Kotlin Plugin Updates. Select “Early Access Preview 1.1” in the Update channel drop-down list.

Press Check for updates in the same dialog, then Install when you see the new version.

Maven/Gradle

All you need to do is add https://bintray.com/kotlin/kotlin-eap-1.1 as a repository to your project and make sure to use version 1.1-M01 for your Kotlin artifacts.

try.kotlinlang.org

Use the drop-down list at the bottom-right corner to change the compiler version.

Screen Shot 2016-07-15 at 3.02.54 PM

Source: https://blog.jetbrains.com/kotlin/2016/07/first-glimpse-of-kotlin-1-1-coroutines-type-aliases-and-more/

Leave a Reply

Be the First to Comment!

avatar
400
  Subscribe  
Notify of