As per Wikipedia: Kotlin is a cross-platform, statically typed, general-purpose programming language with type inference. Kotlin is designed to interoperate fully with Java, and the JVM version of Kotlin's standard library depends on the Java Class Library, but type inference allows its syntax to be more concise. Kotlin mainly targets the JVM, but also compiles to JavaScript (for e.g. frontend web applications using React) or native code (via LLVM), e.g. for native iOS apps sharing business logic with Android apps. Language development costs are borne by JetBrains, while the Kotlin Foundation protects the Kotlin trademark.
On 7 May 2019, Google announced that the Kotlin programming language is now its preferred language for Android app developers. Since the release of Android Studio 3.0 in October 2017, Kotlin has been included as an alternative to the standard Java compiler. The Android Kotlin compiler targets Java 6 by default, but lets the programmer choose to target Java 8 up to 13, for optimization, or more features.
History
In July 2011, JetBrains unveiled Project Kotlin, a new language for the JVM, which had been under development for a year. JetBrains lead Dmitry Jemerov said that most languages did not have the features they were looking for, with the exception of Scala. However, he cited the slow compilation time of Scala as a deficiency. One of the stated goals of Kotlin is to compile as quickly as Java. In February 2012, JetBrains open sourced the project under the Apache 2 license.
The name comes from Kotlin Island, near St. Petersburg. Andrey Breslav mentioned that the team decided to name it after an island just like Java was named after the Indonesian island of Java (though the programming language Java was perhaps named after the coffee).
JetBrains hopes that the new language will drive IntelliJ IDEA sales.
Kotlin v1.0 was released on 15 February 2016. This is considered to be the first officially stable release and JetBrains has committed to long-term backwards compatibility starting with this version.
At Google I/O 2017, Google announced first-class support for Kotlin on Android.
Kotlin v1.2 was released on 28 November 2017. Sharing code between JVM and JavaScript platforms feature was newly added to this release (as of version 1.4 multiplatform programming is an alpha feature upgraded from "experimental"). A full-stack demo has been made with the new Kotlin/JS Gradle Plugin.
Kotlin v1.3 was released on 29 October 2018, bringing coroutines for asynchronous programming.
On 7 May 2019, Google announced that the Kotlin programming language is now its preferred language for Android app developers.
Kotlin v1.4 was released in August 2020, with e.g. some slight changes to the support for Apple's platforms, i.e. to the Objective-C/Swift interop.
Design
Development lead Andrey Breslav has said that Kotlin is designed to be an industrial-strength object-oriented language, and a "better language" than Java, but still be fully interoperable with Java code, allowing companies to make a gradual migration from Java to Kotlin.
Semicolons are optional as a statement terminator; in most cases a newline is sufficient for the compiler to deduce that the statement has ended.
Kotlin variable declarations and parameter lists have the data type come after the variable name (and with a colon separator), similar to BASIC, Pascal and TypeScript.
Variables in Kotlin can be read-only, declared with the val keyword, or mutable, declared with the var keyword.
Class members are public by default, and classes themselves are final by default, meaning that creating a derived class is disabled unless the base class is declared with the open keyword.
In addition to the classes and member functions (equivalent to methods) of object-oriented programming, Kotlin also supports procedural programming with the use of functions. Kotlin functions (and constructors) support default arguments, variable-length argument lists, named arguments and overloading by unique signature. Class member functions are virtual, i.e. dispatched based on the runtime type of the object they are called on.
Kotlin 1.3 adds (experimental) support for contracts (inspired by Eiffel's design by contract programming paradigm)
Applications
Kotlin is widely used for Server Side, and Android development. On Android the platform was stuck on Java 7 for a while (with some contemporary language features made accessible through the use of Retrolambda or the Jack toolchain) and Kotlin introduces many improvements for programmers such as null-pointer safety, extension functions and infix notation. Accompanied by full Java compatibility and good IDE support (Android Studio) it is intended to improve code readability, give an easier way to extend Android SDK classes and speed up development.
Kotlin was announced as an official Android development language at Google I/O 2017. It became the third language fully supported for Android, in addition to Java and C++.
The Spring Framework officially added Kotlin support with version 5 on 04 January 2017 before the Android announcement made by Google at Google I/O 2017. Some of the official Kotlin support in Spring covers documentation, library support, and video presentations. Many of the other Server Side libraries/frameworks like Ktor, and Vert.x provide official Kotlin support. Google Cloud Platform officially supports Kotlin, however the other cloud platforms like AWS (Amazon Web Services), and Azure don't officially provide Kotlin support although Kotlin is known to run on these platforms.
Kotlin is mainly used in new projects (96%), and is mostly used in work projects (75%), followed by personal projects (68%). The following types of software are developed using Kotlin:
- Mobile (56%)
- Web Backend (47%)
- Library/framework (28%)
- Tooling (20%)
- Linux is the top target used in Kotlin Native projects (74%), followed by Android (48%), and MacOS (47%).
Adoption
In 2018, Kotlin was the fastest growing language on GitHub with 2.6 times more developers compared to 2017. It's the fourth most loved programming language according to the 2020 Stack Overflow Developer Survey.
Kotlin was also awarded the O'Reilly Open Source Software Conference Breakout Award for 2019.
Many companies/organizations have used Kotlin for backend development:
- Norwegian Tax Administration
- Gradle
- Amazon
- Square
- JetBrains
- Flux
- Allegro
- OLX
- Shazam
- Pivotal
- Rocket Travel
- Meshcloud
- Zalando
Some companies/organizations have used Kotlin for web development:
A number of companies have publicly stated using Kotlin:
Corda, a distributed ledger developed by a consortium of well-known banks (such as Goldman Sachs, Wells Fargo, J.P. Morgan, Deutsche Bank, UBS, HSBC, BNP Paribas, Société Générale), has over 90% Kotlin in its codebase.
Comments
Post a Comment