Kotlin 1.05 Released
Thursday, 10 November 2016

A new version of Kotlin, the language created by JetBrains, has just been released. Kotlin is another Java replacement and it claims, or rather aims, to be better while fully interoperable.


kotlinlogo

Kotlin can be compiled to JavaScript. As a modern object-oriented language, it can also be used to develop Android apps. It is open source and JetBrains sees it as a way of increasing the sales of its IntelliJ IDE. Indeed most of the improvements in this release relate to IntelliJ features that have been extended to the language. 

The most notable improvements are:

The IntelliJ IDEA plugin can now detect many cases where imperative for loops can be rewritten in a more compact and idiomatic manner using standard library functions such as filter and map.

As a simple example, the following snippet:

 

will be automatically converted to: 

To trigger the conversion, put the caret on the for keyword and press Alt-Enter.

This might seem perfectly natural to a functional programmer but not so much to a hardline object-oriented programmer. 

Also new is postfix code complietion which works like the sort of code completion you know and love but it will wrap what you have already written in a construct rather than just complete what you are writing. The example given by JetBrains is you can write a boolean expression and retrospectively wrap it in an if statement. The idea is that you can avoid having to move the insertion position backwards. Postfix code completion has now come to Kotlin and it is promised to be in Android Studio when it upgrades to the new IntelliJ platform. 

Another "tool" improvement are some new refactorings:

The Kotlin plugin now supports “Extract Interface” and “Extract Superclass” refactorings, which were previously only supported only for Java and some other languages, as well as an entirely new refactoring “Introduce Type Parameter”, providing an easy way to change a class or function into a generic one.

There is also a minor upgrade to the Kotlin Lint tool which is now the equal of the Android Studio 2.2 lint. There are also some minor JavaScript enhancments.

What is the future of languages such as Kotlin?

If you look a the Github activity it seems to be ramping up, not dying off, and there is a healthy community of contributors. However, Kotlin, despite having admirers, doesn't seem close to making a Ruby- or a Lua-like breakthrough to gain a wider audience.

Given that Google already uses the open source version of intelliJ to implement Android Studio, Kotlin could make a replacment for Java in Android development if  Oracle's impending appeal court case reverses the verdict in May that Google's ue of Java APIs was lawful and constituted fair use. 

Google has its own JVM and has swtiched to the open source class library, so a JVM language that already has Android development experience might be an interesting proposition. 

  

kotlinlogo

More Information

Kotlin 1.0.5 is here

Related Articles

Kotlin JVM 1.0

Project Rider, A Cross Platform C IDE

Project Kotlin Moves On

Kotlin Goes Open Source

Kotlin - another Java alternative?

Google Successful With Fair Use Defence

 

 

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on, Twitter, FacebookGoogle+ or Linkedin

 

Banner


Call For Code 2024 Focuses On Generative AI
01/03/2024

This year's Call for Code challenge has been launched with a theme of the use of generative AI technology for solutions that aim to improve equitable access to resources and opportunities for historic [ ... ]



White House Urges Memory Safe Software
29/02/2024

The White House is urging developers to adopt memory safe programming languages, suggesting Rust would be a safer choice than C or C++. 


More News

 

raspberry pi books

 

Comments




or email your comment to: comments@i-programmer.info

The IntelliJ IDEA plugin can now detect many cases where imperative for loops can be rewritten in a more compact and idiomatic manner using standard library functions such as filter and map. As a simple example, the following snippet:

 

 

…will be automatically converted to:

 

 

To trigger the conversion, put the caret on the for keyword and press Alt-Enter.

Last Updated ( Thursday, 10 November 2016 )