Kotlin Nights (almost like a party)

Eugene Trigubov
Eulerr
Published in
4 min readDec 10, 2017

On 25 November the company JetBrains (the creator of Kotlin) proposed an event Kotlin Night Moscow. Kotlin Nights are focusing on popularizing Kotlin. The event took place in Avito’s office(one of the most well-known company to place ads).

It would be great, if they had not miss the letter

I’ve visited this event and now I am going to tell you about technologies, which are worthed to pay attention.

To start, I would like to note the high level of event: a lot of different branded products were given (like note, stickers, pens); the office is small but there was enough place for everyone; during the break there was no queue for food or coffee. In general, everyone felt comfortable.
Now let’s talk about two very interesting and promising technologies.

Kotlin DSL

The first speaker was talking about the possibilities of Kotlin DSL (domain-specific language). What languages belong to the DSL? The most striking examples are Sql, RegExp, Gradle. Each of these languages can solve its own specifically task, such as query of data from the database (SQL), search for matches in the text (RegExp) or the description of the assembling process applications. Kotlin provides many opportunities to develop their own problem-oriented language.

Let’s imagine that you have a standard implementation process, which can change sometimes, be refined, but in general you want to use it with different data and to format the result. Creating a DSL, you make a flexible tool for solving various tasks of one subject area, thus the end-user of your DSL doesn’t think about how the task decision was received. Using the API you can really simplify your life and long-term support system.

As a proof, look at the example of a test written by Kirk, that was created to replace Selenide to Kotlin.

Example of using Kotlin DSL

The example demonstrates clearly the format of DSL, which you can write. Essentially, it’s a BDD, the code with all the benefits of strong typing and refactoring support.

Kotlin Native

Official logo of LLVM

The next speaker was talking about the technology Kotlin Native.
Originally Kotlin was created for the JVM as an improved version of Java. Many people liked Kotlin, so they have come up with the idea: to compile Kotlin for something else. So, there is Kotlin JS. But developers didn’t stop and decided to compile Kotlin to LLVM (Low Level Virtual Machine) that can translate normal code into a complex internal representation.

Simply put, it is a universal tool for writing a compiler. Many languages are supported by LLVM, such as C, C++, Swift, Java. So, what does Kotlin need here?

To answer this question, let’s look at the scheme. That was until Kotlin:

Android — Java, iOS — Swift, Web — JS, Backend — Java

And now:

Swift ?

In other words, JetBrains still have some way to “plug the hole” in iOS.

Kotlin Native comes to the aid. In very simple terms, you will be able to compile Kotlin code to develop on iOS with LLVM.

Kotlin and LLVM — iOS

However, competitors are not sleeping.
For example, Intel offers the Intel MultiOS engine, which can allow you to write Java and use the JVM straight from Android Studio to do iOS apps.
It is fantastic! So, in the next few years we will see interesting battle for the market of universal mobile development.

To sum up:

JetBrains are developing Kotlin very hard. The company wants to make it universal for all popular industries and well-known platforms, starting from the development for mobile OS and ending with web development and backend. And I can not look at this situation without smiling, because versatility will facilitate the work of developers greatly. The only question: will whether Kotlin the first, which can occupy the market of versatility?

--

--