Kotlin 1.4 is out: Here’s all you need to know

JetBrains has added quite a few new features in the latest Kotlin 1.4. The open-source, general-purpose programming language for JVM, Android, web, and native development has reached a new milestone with this version. Here are all the new features in Kotlin 1.4.

Earlier version of Kotlin only allowed functional interfaces, having just a single abstract method (SAM). With the v1.4, you can mark your own Kotlin interface as functional and get them to work in a similar manner.

Another highlight of Kotlin 1.4 is the new explicit API mode. It enforces certain language properties of Kotlin that are usually optional. Kotlin 1.4 also allows specifying visibility modifiers and explicit typing for any public declaration, to prevent mistakes while designing an API.

One of the benefits of Kotlin 1.4 is that the developers can use new and more powerful type inference algorithm. Improved compiler will help developer become more productive by supporting smart-casts and cases. The latest version brings an optional, alpha-stage stability compiler backends for Kotlin/JVM, and Kotlin/JS. Even if you are not developing with Jetpack Compose, users are encouraged to try out the Kotlin/JVM backend.

The API has been expanded to cover real-life cases. A new set of creation function set()NotNull(), makes a set of all non-null items among the provided arguments. The delegation improvements also work better with a new PropertyDelegateprovider interface and ReadWriteProperty.

The very first step to trying Kotlin 1.4 is to update your projects and IDE to the latest version. Once the latest plugin is enabled, you can upgrade your app projects to use Kotlin 1.4 by updating the Kotlin Gradle plugin version.