Kotlin 1.3.50: New APIs and improved Java to Kotlin converter

Share
  • August 23, 2019

The good news for Kotlin keeps on rolling. Since Google announced that it is officially the first-class language for Android in 2017, it has been eating away at Java’s Android throne. According to a recent Facebook poll taken by Dice, 15% of Android developers prefer using Kotlin over Java.

While this number may sound small, for this newcomer of a language it’s gaining a steady foothold and is well-loved by developers. Take a peak at the Kotlin 2019 state of development ecosystem report to see what devs love about the language and how they use it.

Kotlin released version 1.3.50.

This update includes some tooling improvements, new intentions and inspections, debugging improvements, and more.

1.3.50 features

Some of the latest features and changes included in this update:

New duration and time measurement API

Version 1.3.50 introduces an experimental preview of a new duration and time measurement API. Potential use cases for the API include measuring code block execution time, enabling typed API for passing duration values, noting time elapsed from a particular point, and noting time remaining to a future point.

Support for the monotonic clock  MonoClock also arrives.

SEE ALSO: ICO report reveals real time buying puts your data at risk

According to the KEEP on GitHub:

The goal of this proposal is to introduce the following API into the common Kotlin Standard Library:

  • the class Duration representing the duration of time interval between two instants of time;
  • the enum class DurationUnit that lists the possible units in which a duration can be expressed;
  • the functions measureTime and measureTimedValue allowing to measure execution time of a code block;
  • the interface Clock abstracting the source of time and allowing to notch a mark on the clock and then read the amount of time elapsed from that mark.

Refer to the KEEP on GitHub for more information about this API, its operators, components and more.

SEE ALSO: The implication of AI & ML on the marketing landscape

Kotlin/Native

An array of improvements to Kotlin/Native has been made in this update. Now, both Kotlin and Native versioning align. The standard library updates to support the kotlin.reflect.typeOf() function for Kotlin/Native types.

This also brings more pre-imported Apple frameworks for all platforms, improvements for interop, standard library updates, and more.

Kotlin Native changelog available here.

Other changes and improvements

Some miscellaneous updates included in this version:

  • Functions for bit manipulation API: Currently in the initial experimental state.
  • Debugging improvements: Changes made to how to the ‘Variables’ view chooses which variables to display and highlight relevant variables. Users can set a breakpoint at the end of the function.
  • Kotlin/JS: Support for building and running Kotlin/JS Gradle projects with the org.jetbrains.kotlin.js Windows plugin. Performance updates also enhanced, improving upon the project compilation time.
  • Dukat: Kotlin/JS ships with experimental Dukat integration for Gradle projects. Refer to Dukat on GitHub to learn more about it.
  • Scripting improvements and features added: Includes default JSR-223 implementation library.
  • New intentions and inspections
  • Java to Kotlin converter: Work continues to improve on the Java to Kotlin converter, making it easier than ever to convert your code with fewer compilation errors. It is available for preview and awaiting feedback.

View the full list of changes in the changelog.

The post Kotlin 1.3.50: New APIs and improved Java to Kotlin converter appeared first on JAXenter.

Source : JAXenter