Kotlin 1.1.4 released

New update for officially supported programming language for Android available now
15 August 2017   1088

Good news for Kotlin fans. Version 1.1.4 is out now.

What's inside?

This update:

  • Fixes a major performance regression in the IntelliJ IDEA plugin
  • Adds support for package-default nullability annotations
    Starting with this release, Kotlin supports package-default nullability annotations (such as JSR-305’s @ParametersAreNonnullByDefault and the @NonNullApi annotation introduced in Spring Framework 5.0).
     
  • Improved Java 9 support
    Now Kotlin performs module-based visibility checks based on information from module-info.java. Running the compiler under JDK 9 is now also supported.
     
  • Adds initial, experimental support for generating Android Parcelable implementations using the @Parcelize annotation
    Android Extensions plugin now supports not only Activities and Fragments, but also custom Views and even custom layout containers such as a ViewHolder. Also, variants are now fully supported.
     
  • Adds a tool for JavaScript dead code elimination, improves sourcemap support for JS debugging and JS unit testing support
    Kotlin 1.1.4 adds a new tool to eliminate dead code from the .js files produced by the Kotlin/JS compiler. 
     
  • Generates more efficient bytecode
    Exceptions from named suspending functions now originate from the function itself, which makes their stack-tracer easier to read, and the bytecode performs better in many cases.
     
  • Adds many new features to the IntelliJ IDEA plugin

All changes available at changeslist

JetBrains to Roll Out Kotlin/Native 0.8

Version 0.8 of Kotlin/Native brings new features and bug fixes
13 July 2018   129

The project team of Kotlin / Native introduced the release of version 0.8. Corrections and additions have concerned the security of multithreaded programming, the expansion of library functionality and support for iOS devices. As always, alot of bugs are fixed.

Parallelism

Implemented the concept of object freezing

object Config {
  var width: Int = 10
  private set
  init {
    val file = fopen("config.txt", "r")
    if (file != null) {
              try {
              val buffer = ByteArray(2 * 1024)
                 while (true) {
                 val nextLine = fgets(buffer.refTo(0), buffer.size, file)?.toKString()
                 if (nextLine == null || nextLine.isEmpty()) break
                 val records = nextLine.split('=')
                 if (records.size != 2) continue
                 val key = records[0].trim()
                 val value = records[1].trim()
                 when (key) {
                         "width" -> width = value.toInt()
                            }
                          }
                        }
             } finally {
                fclose(file)
                    }
         }
}

This code considers the configuration file and will later receive the Config.width property. 

The Config file itself is divided for any number of threads or vorkers. After publication, the object is frozen and any attempt to change it will result in an exception (InvalidMutabilityException).

The second peculiarity of parallelism in the Kotlin / Native project is indivisible values and references. Let's add an image:

object Config {
private val icon_ = AtomicReference()
val icon: Image
get() = icon_.get()!!
fun updateIcon(file: String) {
val imageData = Image(file)
icon_.compareAndSwap(icon_.get(), imageData.freeze())
}
}

All information about the icon in the AtomicReference is frozen. Any changes are indivisible and similar information is visible to each client.

Kotlin Libraries

Starting v 0.8, the standard library (kotlin. *) is compatible with other platforms. Standard number generator and the function of mixing the collections are designed to eliminate the use of sharpened for a specific platform API. As an experiment, the project supports other libraries, for example, kotlinx.coroutines, kotlinx.serialization, and also the Ktor HTTP client.

Changes for iOS devices

Fixed issues with the publication in the App Store and the initialization of the platform. Support for the 32-bit ARM architecture of iOS processors, which allows using Kotlin / Native on older devices from Apple added.