Kotlin



What is Kotlin?

When creating native apps for Android, you will normally use the Java programming language for your logic. Whilst Java is a battle hardened language, it isn’t without its issues.
When you run a Java application, the app is compiled into a set of instructions called Bytecode and runs in a virtual machine. Over the past several years, a number of new programming languages have been introduced to also run on the Java virtual machine. Whilst the resulting app looks the same for the virtual machine, the idea is the language features can help developers write simpler code and fix some of Javas issues.
JetBrains, known for IntelliJ IDEA (Android Studio is based on IntelliJ), has introduced the Kotlin language.
Kotlin is a statically-typed programming language that runs on the JVM. It can also be compiled to JavaScript source code. Kotlin has some amazingly cool features!

Using Kotlin for Server-side Development

Kotlin is a great fit for developing server-side applications, allowing to write concise and expressive code while maintaining full compatibility with existing Java-based technology stacks and a smooth learning curve:
Expressiveness: Kotlin's innovative language features, such as its support for type-safe builders and delegated properties, help build powerful and easy-to-use abstractions.
Scalability: Kotlin's support for coroutines helps build server-side applications that scale to massive numbers of clients with modest hardware requirements.
Interoperability: Kotlin is fully compatible with all Java-based frameworks, which lets you stay on your familiar technology stack while reaping the benefits of a more modern language.
Migration: Kotlin supports gradual, step by step migration of large codebases from Java to Kotlin. You can start writing new code in Kotlin while keeping older parts of your system in Java.
Tooling: In addition to great IDE support in general, Kotlin offers framework-specific tooling (for example, for Spring) in the plugin for IntelliJ IDEA Ultimate.
Learning Curve: For a Java developer, getting started with Kotlin is very easy. The automated Java to Kotlin converter included in the Kotlin plugin helps with the first steps. Kotlin Koans offer a guide through the key features of the language with a series of interactive exercises.
Frameworks for Server-side Development with Kotlin


Spring makes use of Kotlin's language features to offer more concise APIs, starting with version 5.0. The online project generator allows to quickly generate a new project in Kotlin.


Vert.x, a framework for building reactive Web applications on the JVM, offers dedicated support for Kotlin, including full documentation.


Ktor is a Kotlin-native Web framework built by JetBrains, making use of coroutines for high scalability and offering an easy-to-use and idiomatic API.


kotlinx.html is a DSL that can be used to build HTML in a Web application. It serves as an alternative to traditional templating systems such as JSP and FreeMarker.


The available options for persistence include direct JDBC access, JPA, as well as using NoSQL databases through their Java drivers. For JPA, the kotlin-jpa compiler plugin adapts Kotlin-compiled classes to the requirements of the framework.
Deploying Kotlin Server-side Applications

Kotlin applications can be deployed into any host that supports Java Web applications, including Amazon Web Services, Google Cloud Platform and more.

To deploy Kotlin applications on Heroku, you can follow the official Heroku tutorial.

AWS Labs provides a sample project showing the use of Kotlin for writing AWS Lambda functions.
Users of Kotlin on the Server Side

Corda is an open-source distributed ledger platform, supported by major banks, and built entirely in Kotlin.

JetBrains Account, the system responsible for the entire license sales and validation process at JetBrains, is written in 100% Kotlin and has been running in production since 2015 with no major issues.

How to install Kotlin in Android Studio

Comments

Popular posts from this blog

Constants

Data Types in C Programming

Identifiers