Kotlin 1.3 Released

Four days ago, Kotlin version 1.3 was officially released to the general public. This release adds a lot of highly anticipated features, amongst which are:

  • Coroutines now stable: After being an experimental feature for quite some time, Jetbrains have now decided the time has come to mark coroutines as a stable feature. It is not integrated in the core language, but still an add-on that Kotliners can opt-in for.
  • Kotlin 1.3 introduces support for multiplatform tooling, which should make it easier to support multiple platforms. So other than just supporting JVM based platforms, using these tools makes it easier to also support Android, JavaScript and even native as target platforms. Support is available for HTTP, serialization and couroutines, to name a few.
  • Several minor features added to the language, compiler and/or tools and plug-ins, amongst which:
    • Experimental support for inline classes (for better performance
    • Experimental support for unsigned integers
    • When expressions now expose the subject so you won’t need to assign it to a variable yourself
    • Contracts added to improve static analysis of library calls
    • No-arg main method
    • Sequence debugger for visualizing lazy computations
    • Scratch, REPL and scripting improvements
    • Standard library expanded to Kotlin/Native and support for Kotlin/JS
    • Experimental incremental compilation for Kotlin/JS

More detailed info on the release is available on the Jetbrains website.

All in all a good release and a solid update that finally gives us the stable version of coroutines. We’ve already upgraded, you too?

Posted in Blog, Kotlin | Leave a comment

Compiler Hinting with Kotlin Contracts

Kotlin’s built-in null-safety makes it easy for us to write code that’s less error-prone and less susceptible to the unwanted and unexpected NullpointerException at runtime. We can do a lot to make sure it doesn’t happen, but sometimes there’s no way around dealing with possible null-values. Kotlin is introducing Contracts in the upcoming 1.3 release (currently m2) in which we can use contracts to tell the compiler how a function behaves and what results are implied, so we can benefit from improved smart-casts.

Continue reading

Posted in Blog, Kotlin | 1 Comment

Let’s stay away from silver bullet claims

Apparently everybody’s  favourite JVM language beat Java in a recent code-smell contest. The Register reported on a paper by Bruno Gois Mateus and Matias Martinez who had carried out an extensive survey of the rate of Kotlin usage in recent open-source Android projects. Well, they’d have to be fairly recent, wouldn’t they. Using the Paprika tool to sniff out anti-patterns, they reached the not so surprising conclusion that the Kotlin code under scrutiny smelled a lot better than your average Android project in Java.

Continue reading

Posted in Blog, Kotlin | Leave a comment

Kotlin Release news: Kotlin 1.2.60, Kotlin 1.3 M1, Kotlin Native 0.8

Some good news coming from Jetbrains, who have been tirelessly working on expanding and improving Kotlin and the tools provided with it. In this post I’ll provide an overview of the latest news.

Continue reading

Posted in Kotlin, News | Leave a comment

Going functional and fullstack with Spring Fu and Kotlin

Spring Fu is an experimental Kotlin micro-framework that makes it easy to create lightweight Spring-powered applications with functional APIs instead of annotations. Fu is for functional API, but that’s also a wordplay with the -fu suffix which means skill, the chinese character which means “good luck” and the chinese poetry. Sébastien Deleuze announced this interesting new Micro framework on twitter:

One of the interesting features is that Spring Fu really allows you to develop the full stack using Kotlin by writing your Gradle build file and application code in Kotlin.

Josh Long has put up a great youtube video to get you started with Spring Fu:

The micro part for me is due to minimal reflection usage, no classpath scanning and no annotation processing. While this requires you to be a bit more explicit in the configuration, it boosts startup of you application significantly. For more details make sure to check out the project on github: https://github.com/spring-projects/spring-fu

Posted in Blog, Kotlin | Leave a comment