Kotlin 1.3.70 adds experimental features and new color schemes

Share
  • March 6, 2020

Although the JVM language Kotlin is not being widely used in absolute numbers, it has been gaining popularity. In GitHub’s latest State of the Octoverse report, for example, it ranked on fourth place of trending programming languages—with an impressive 182% increase in usage.

SEE ALSO: Top Java technologies in 2020 – JVM programming languages, IDEs, tools & more

Kotlin 1.4 is expected to arrive this spring, but v1.3.70 is here to shorten the wait. Let’s see what it has in store for us.

Standard library

The latest Kotlin release adds several new experimental functions to the standard library. For example, the kotlin.collections.ArrayDeque class has been added. This requested feature, double-ended queue, lets you add or remove elements from the beginning and end of the queue in amortized constant time, as shown here:

@OptIn(ExperimentalStdlibApi::class)
fun main() {
    val deque = ArrayDeque(listOf(1, 2, 3))

    deque.addFirst(0)
    deque.addLast(4)
    println(deque) // [0, 1, 2, 3, 4]

    println(deque.first()) // 0
    println(deque.last()) // 4

    deque.removeFirst()
    deque.removeLast()
    println(deque) // [1, 2, 3]
}

Further updates to the standard library include an extended functionality of StringBuilder for it to be used from common code, and some members of KClass can now do without a kotlin-reflect dependency on the JVM.

IntelliJ IDEA: Color schemes, code completion & more

The IntelliJ IDEA Kotlin plugin has received updates for several areas, one of which is code completion.

Additional code completion suggestions now include functions declared in objects, object-level overrides, and functions declared in nested objects. The ML model that sorts the list has been updated to display the most relevant options at the top.

Kotlin

Kotlin code completion. Source.

The editor now  also comes with new customizable color schemes. For example, this applies to color schemes for the suspend function and property declarations:

Kotlin

Kotlin color schemes. Source.

Further IntelliJ IDEA updates include improved support for Gradle Kotlin DSL scripts in the shape of *.gradle.kts files, and the Kotlin/Native debugger now has the single breakpoint type Kotlin Line Breakpoint for JVM and Native targets.

Other updates

Kotlin/Native now offers faster compilation and debugging. Additionally, Kotlin 1.3.70 is able to generate type annotations in the JVM bytecode with the target version 1.8+ . This should make it easier to use some existing Java libraries.

The JavaScript target has been updated as well, regarding aspects such as bundle size or test handling, and the Kotlin/JS docs have been updated.

SEE ALSO: Kotlin-logging wraps SLF4J for better native Kotlin support

See the JetBrains blog post for the full details.

The post Kotlin 1.3.70 adds experimental features and new color schemes appeared first on JAXenter.

Source : JAXenter