Kotlin (programming language): Difference between revisions

Content deleted Content added
Yobot (talk | contribs)
m WP:CHECKWIKI error fixes, removed stub tag using AWB (9979)
Split syntax from semantics.
Line 30:
== 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.<ref name="interview">{{cite web | title=JVM Languages Report extended interview with Kotlin creator Andrey Breslav|url=http://zeroturnaround.com/rebellabs/jvm-languages-report-extended-interview-with-kotlin-creator-andrey-breslav/ | author=RebelLabs | website=http://zeroturnaround.com/ | date=April 22, 2013 | accessdate=February 2, 2014 }}</ref>
 
== Syntax ==
Like [[Pascal programming language|Pascal]], [[Haxe]] and [[Scala (programming language)|Scala]], Kotlin [[Variable (computer science)|variable]] declarations and [[Parameter (computer programming)|parameter lists]] have the [[data type]] come after the variable name (and with a [[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]]s are optional as a [[Statement (computer science)|statement]] [[Statement 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>
 
== Semantics ==
Like [[Pascal programming language|Pascal]], [[Haxe]] and [[Scala (programming language)|Scala]], Kotlin [[Variable (computer science)|variable]] declarations and [[Parameter (computer programming)|parameter lists]] have the [[data type]] come after the variable name (and with a [[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]]s are optional as a [[Statement (computer science)|statement]] [[Statement 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 (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 program|program]] is a function named "main", which is passed an array containing any [[Command-line interface|command line]] arguments. [[Perl]] and Unix/Linux [[shell script]] style [[string interpolation]] is supported. [[Type inference]] is also supported.
 
'''Hello, world! example'''