Kotlin (programming language): Difference between revisions

Content deleted Content added
Internal link for static typing
Yobot (talk | contribs)
m WP:CHECKWIKI error fixes, removed stub tag using AWB (9979)
Line 1:
{{Infobox programming language
| name = Kotlin
| logo = [[File:Kotlin_language_logoKotlin language logo.png|thumb|center]]
| caption =
| file_ext = .kt
Line 16:
| dialects =
| influenced by = [[Java (programming language)|Java]], [[Scala (programming language)|Scala]], [[Groovy (programming language)|Groovy]], [[C Sharp (programming language)|C#]], [[Gosu (programming language)|Gosu]]
| platform = Outputs [[Java Virtual Machine]] [[Java bytecode | bytecode]] and [[JavaScript]] [[source code]]
| operating system = any supporting a JVM or JavaScript interpreter
| license = [[Apache license|Apache 2]]
Line 32:
 
== Semantics ==
Like [[Pascal programming language|Pascal]], [[Haxe]] and [[Scala (programming language)|Scala]], Kotlin [[Variable (computer science)|variable]] declarations and [[Parameter (computer_programming)computer programming)|parameter lists]] have the [[data type]] come after the variable name (and with a [[Colon_Colon (punctuation)|colon]] separator), unlike [[C language|C]] and its derivatives such as C++, Java, C#, and D. As in other modern languages like Scala and [[Groovy (programming language)|Groovy]], [[Semicolon|semicolonssemicolon]]s are optional as a [[Statement (computer science)|statement]] [[Statement_terminatorStatement terminator#Statements|terminator]], in most cases a [[newline]] is sufficient for the [[compiler]] to deduce that the statement has ended.<ref>{{cite web | url=http://confluence.jetbrains.com/display/Kotlin/Grammar#Grammar-Semicolons | title=Semicolons | website=jetbrains.com | accessdate=February 8, 2014}}</ref> In additional to the [[Class (computer programming) | classes]] and [[Method_Method (computer_programming)computer programming)| methods]] (called member functions in Kotlin) of [[object-oriented programming]] , Kotlin also supports [[procedural programming]] with the use of [[function (computer science) | functions]]. <ref>{{cite web | url=http://confluence.jetbrains.com/display/Kotlin/Functions | title=functions | website=jetbrains.com | accessdate=February 8, 2014}}</ref> As in C and C++, the [[entry point]] to a Kotlin [[Computer_programComputer program| program]] is a function named "main", which is passed an array containing any [[Command-line_interfaceline interface|command line]] arguments. [[Perl]] and Unix/Linux [[shell script]] style [[string interpolation]] is supported. [[Type inference]] is also supported.
 
'''Hello, world! example'''
Line 45:
 
==See also==
There are other languages targeting the same market:<ref>[http://blog.joda.org/2011/07/kotlin-and-search-for-better-java_9066.html Kotlin and the search for a better Java], Stephen Colebourne, 2011-07-21.</ref>:
* [[Ceylon (programming language)]]
* [[Fantom (programming language)]]
Line 66:
[[Category:Programming languages created in the 2010s]]
[[Category:Software using the Apache license]]
 
{{compu-lang-stub}}