Category Archives: Language design

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 … Continue reading

Posted in Language design | 18 Comments

Upcoming Change: More Null-safety for Java

Our battle for combining null-safety and Java interop has been a long one already: we started off treating all Java reference types as nullable, and it was too inconvenient; then we employed external annotations to specify nullability, created KAnnotator, but … Continue reading

Posted in Language design | Leave a comment

Upcoming Change: Function Types Reform

Kotlin M12 will likely bring another change that is crucial for implementing a useful reflection library for Kotlin. In short, we are going to unify FunctionX and ExtensionFunctionX to be represented in the same way at runtime, but it will … Continue reading

Posted in Language design | 11 Comments

More changes: Enum Syntax, Another Deprecation and More

Enum Syntax Currently the syntax for enums with non-trivial constructors is kind of monstrous:

Posted in Language design | 59 Comments

More Deprecations Coming

There are two more items on the language cleanup list: backing-field syntax and static type assertion operator.

Posted in Language design | 19 Comments

Upcoming Change: Syntax For Annotations

Kotlin’s syntax for annotations was inspired by C#, which surrounds them with square brackets:

But brackets are precious for a language designer, and we would really like to use them later for something else, so we are considering changing … Continue reading

Posted in Language design | 29 Comments

Upcoming Feature Deprecations

As we are finalizing the language design, many things have to be cleaned up, and among these are features that were initially designed and (often partly) implemented, but turned out not to be worth the trouble supporting them. In the … Continue reading

Posted in Language design | 18 Comments

Follow-up: New Class Object Syntax

In the previous post I explained the rethought design of what used to be called “class objects”: they are now more uniform with normal nested objects, have names (name may be omitted, but a default one will be used by … Continue reading

Posted in Language design | 53 Comments

Upcoming Change: “Class Objects” Rethought

Kotlin M11 is coming very soon, and as some of you expressed concerns about being informed about the upcoming changes, I will describe one of the features of M11 and ask you for some feedback.

Posted in Language design | 43 Comments

Making Platform Interop even smoother

Being 100% interoperable with the JVM, and subsequently with JavaScript, has always been among Kotlin’s top priorities. With the amount of existing code, and a rich JVM ecosystem, having the ability of interoperating and leveraging these is crucial.

Posted in Language design | 31 Comments