Kotlin (programming language)

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Wickorama (talk | contribs) at 03:43, 27 April 2014 (→‎See also: rewording). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Kotlin
File:Kotlin language logo.png
Designed byJetBrains
DeveloperJetBrains and open source contributors
Typing disciplinestatic
PlatformOutputs Java Virtual Machine bytecode and JavaScript source code
OSany supporting a JVM or JavaScript interpreter
LicenseApache 2
Filename extensions.kt
Websitehttp://kotlin.jetbrains.org/
Influenced by
Java, Scala, Groovy, C#, Gosu

Kotlin is a statically-typed programming language that runs on the Java Virtual Machine and also can be compiled to JavaScript source code. Its primary development is from a team of JetBrains programmers based in St. Petersburg, Russia (the name comes from the Kotlin Island, near St. Petersburg).[1] Kotlin was named Language of the Month in the January 2012 issue of Dr. Dobb's Journal.[2] While not syntax compatible with Java, Kotlin is designed to interoperate with Java code and is reliant on Java code from the existing Java Class Library, such as the Collections Framework.

History

In July 2011 JetBrains unveiled Project Kotlin, which had been under development for a year, a new language for the JVM.[3] 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 compile time of Scala as an obvious deficiency.[3] One of the stated goals of Kotlin is to compile as fast as Java. In February 2012, JetBrains open sourced the project under the Apache 2 license.[4] Jetbrains hopes that the new language will drive IntelliJ IDEA sales.[5]

Philosopy

Development lead Andrey Breslav has said that Kotlin is designed to be an industrial strength object-oriented language, be a better language than Java but still be fully interoperable with Java code, allowing companies to make a gradual migration from Java to Kotlin.[6]

Syntax

Like Pascal, Haxe and Scala, Kotlin variable declarations and parameter lists have the data type come after the variable name (and with a colon separator), unlike C and its derivatives such as C++, Java, C#, and D. As in other modern languages like Scala and Groovy, semicolons are optional as a statement terminator, in most cases a newline is sufficient for the compiler to deduce that the statement has ended.[7]

Semantics

In addition to the classes and methods (called member functions in Kotlin) of object-oriented programming , Kotlin also supports procedural programming with the use of functions.[8] As in C and C++, the entry point to a Kotlin program is a function named "main", which is passed an array containing any command line arguments. Perl and Unix/Linux shell script style string interpolation is supported. Type inference is also supported.

Hello, world! example

fun main(args : Array<String>) 
{
  val scope = "world"
  println("Hello, ${scope}!")
}

Tools

See also

There are other languages trying to be better a better language than Java for the JVM:[11]

References

  1. ^ Heiss, Janice (April 2013). "The Advent of Kotlin: A Conversation with JetBrains' Andrey Breslav". oracle.com. Oracle Technology Network. Retrieved February 2, 2014.
  2. ^ Breslev, Andrey (January 20, 2012). "Language of the Month: Kotlin". drdobbs.com. Retrieved February 2, 2014.
  3. ^ a b Krill, Paul (Jul 22, 2011). "JetBrains readies JVM language Kotlin". infoworld.com. InfoWorld. Retrieved February 2, 2014.
  4. ^ Waters, John (February 22, 2012). "Kotlin Goes Open Source". ADTmag.com/. 1105 Enterprise Computing Group. Retrieved February 2, 2014.
  5. ^ "Why JetBrains needs Kotlin". we expect Kotlin to drive the sales of IntelliJ IDEA
  6. ^ RebelLabs (April 22, 2013). "JVM Languages Report extended interview with Kotlin creator Andrey Breslav". http://zeroturnaround.com/. Retrieved February 2, 2014. {{cite web}}: External link in |website= (help)
  7. ^ "Semicolons". jetbrains.com. Retrieved February 8, 2014.
  8. ^ "functions". jetbrains.com. Retrieved February 8, 2014.
  9. ^ "Jetbrains Plugin Repository:Kotlin".
  10. ^ a b c "Kotlin Build Tools".
  11. ^ Kotlin and the search for a better Java, Stephen Colebourne, 2011-07-21.

External links