Call for Feedback: Upcoming Changes in Kotlin

As mentioned before, we are wrapping up with the language design, and this post is a head-up for the upcoming changes + request for your feedback. Continue reading

Posted in Language design | 91 Comments

Kotlin M13 is out!

It’s been a long summer, and we have a lot to tell you about Kotlin M13 (details below):

  • Compiler daemon for faster compilation;
  • lateinit properties to support dependency injection and other frameworks;
  • sealed classes for expressing closed hierarchies;
  • Specifying and checking annotation targets;
  • Java get/set pairs are now seen as properties in Kotlin;
  • Better type safety for Java interop: taking @NotNull annotations into account (see this blog post);
  • Modifiers and annotations have been separated syntactically (see this blog post);
  • Fully functional reflection on classes, functions and properties;
  • Access to internal is now checked outside of a module (details below);
  • New .class file layout for top-level functions and properties;
  • and more (see below) Continue reading
Posted in Releases | 70 Comments

Join Live Webinar — Quasar and Kotlin

Join us 
Wednesday, September 16th, 16:00 – 17:00 CET (10:00 – 11:00 AM EDT) for our free webinar, Quasar: Efficient and Elegant Fibers, Channels and Actors with Fabio Tudone.

Quasar fibers bring true lightweight threads to the JVM as well as Erlang-like actors, Go-like channels and Dataflow programming: this means we can efficiently use straightforward blocking APIs and regular stack-based control flow rather than submitting to cumbersome and infectious async and monadic styles.

After an introduction about fibers, their workings and Quasar’s additional abstractions we’ll explore how Quasar uses Kotlin

  • data classes
  • top-level functions
  • lambdas
  • annotated expressions
  • when-expressions
  • inline functions

to offer an extremely lean and expressive API.

Everyone is welcome!

You can ask questions to Fabio and suggest themes for future webinars in comments.

Fabio Tudone Fabio Tudone works on Quasar, Pulsar and Comsat at Parallel Universe. He has been writing mostly JVM software during his entire career, and before joining Parallel Universe he led the development of a cloud-based enterprise content governance platform. His interests include Dev and DevOps practices, scalability, concurrent and functional programming as well as runtime platforms at large.

Posted in Events, Libraries | Tagged , , , , , , | 1 Comment

Feedback Request: Limitations on Data Classes

While M13 is approaching, we are planning a little ahead. This is a request for feedback on some future changes in Kotlin.

We want to deliver Kotlin 1.0 rather sooner than later, and this makes us postpone some design choices we don’t have enough confidence about. Today let’s discuss data classes. Continue reading

Posted in Language design | 47 Comments

Modifiers vs Annotations

This is another heads-up and a call for feedback. We have been discussing options regarding Kotlin’s annotation syntax for quite some time already, rolling out experiments, gathering feedback. As we are finalizing the language now, many pain points that we used to postpone are surfacing. We have to make decisions, and sometimes in a defensive way. In this post I will give an overview of the options we have and the decisions we are provisioning.

Setting the stage: Some introductory definitions

Kotlin (as well as many other languages) has two kinds of metadata:

  • modifiers (such as public, open or abstract), which are built into the language, and
  • annotations (such as @Test or @Inject), which are defined in libraries, also they can have parameters.

Unlike many languages, in Kotlin most modifiers are not proper keywords. They have special meaning only where they are applicable, i.e. in front of a declaration. The compiler won’t mind if you call your variable or class public:

This technique is known as “soft keywords” or “contextual keywords”. Continue reading

Posted in Language design | 44 Comments

Gradle Daemon Support for Faster Compilation

We are currently working on improving compilation times. Today we are happy to invite you to try Kotlin 0.12.1230 making use of the Gradle Daemon. It eliminates startup costs, and your builds run faster. Continue reading

Posted in Tools | 35 Comments

Improving Java Interop: Top-Level Functions and Properties

Kotlin has had top-level functions and properties from day one. They are very convenient in many cases: from basic utilities to extensions for standard APIs.

But Kotlin code is not the only client, and today I’m going to explain how we are planning to improve on the Java interop when it comes to calling top-level functions and properties. Continue reading

Posted in Language design | 18 Comments

Better Annotation Processing: Supporting Stubs in kapt

We announced kapt, an Annotation Processing Tool for Kotlin, some time ago, and discussed its limitations. Now most of the limitations are going away with the updated version of kapt that is available as a 0.1-SNAPSHOT preview. Continue reading

Posted in Android, Libraries, Tools | 18 Comments

Kotlin Evolves: How to Keep Your Code Up

Kotlin is undergoing finalization, and as part of the process we are cleaning up: revising the language and its libraries. The biggest changes have been made in M12, but some more are coming. The point is to perform all the necessary breaking changes before we release 1.0, so that we can keep the language and libraries backwards-compatible after the release.

The trick is both we, ourselves, and you, our users, have quite a bit of code written in Kotlin already, and we don’t want all that code broken hopelessly on each update (some breakages are inevitable, unfortunately, but we are doing our best). The general scheme of making changes in a user-friendly way is “deprecate-release-remove”, for example:

  • in M12 we deprecated quite a few language constructs and library classes/functions,
  • then we released M12, so that whenever you use those to-be-removed language and library features, the compiler issues warnings,
  • in the next milestone we will remove those deprecated things completely, so that the compiler will issue errors instead of warnings.

So, if you have any deprecation warnings in your code, now is just the right time to get rid of them: the next major update will make all that code red, and your build will break.

Getting rid of deprecation warnings

As mentioned above, there are two kinds of deprecation warnings: language deprecations and library deprecations. To get rid of them we provide several options.
Continue reading

Posted in Libraries | 20 Comments

Kotlin Eclipse Plugin 0.2.0

Kotlin Eclipse Plugin 0.2.0

Today we are happy to present a new version of Kotlin plugin for Eclipse. This release includes the following features:

  • Update to Kotlin M12
  • Java to Kotlin converter
  • Navigation to Kotlin sources from Java
  • Kotlin syntax highlighting in Compare View

Continue reading

Posted in Tools | 3 Comments