Content deleted Content added
No edit summary |
Jerryobject (talk | contribs) Template:Infobox programming language update, parameters: move, add, fill. WP:LINK updates. Nonlead nonproper noun MOS:CAPS > low-case. Template:Cite web updates. Terms define before WP:ABBRs. Small WP:EoS WP:COPYEDITs. |
||
Line 2:
{{Infobox programming language
| scope =
| implementations =▼
| programming language =
| dialects =▼
| operating system =
| url=http://ceylon-lang.org/documentation/1.2/faq/#what_is_ceylon▼
| title=Frequently Asked Questions: What is Ceylon?▼
| quote=Ceylon is a new programming language that's deeply influenced by Java▼
| accessdate=2015-12-04}}</ref> [[Scala (programming language)|Scala]], [[Smalltalk]], [[ML (programming language)|ML]],<ref>{{cite web▼
| url=https://gitter.im/ceylon/user?at=5660a7242cbea1d7054de9d9▼
| title=ceylon/user - Gitter▼
| accessdate=2015-12-04}}</ref> [[Lisp (programming language)|Lisp]]<ref>{{cite web▼
| url=https://gitter.im/ceylon/user?at=5660a90e5057376520db6f8b▼
| title=ceylon/user - Gitter▼
| accessdate=2015-12-04}}</ref>▼
▲ | license = [[Apache License|Apache v2]]
| file ext = .ceylon<ref>{{cite web
| wikibooks =▼
| influenced by = [[Java (programming language)|Java]],<ref>{{cite web
▲
| influenced =
}}
'''Ceylon''' is an [[Object-oriented programming|object-oriented]], [[Strong typing|strongly]] [[Type system|statically typed]] programming language with an emphasis on [[Immutable object|immutability]], created by [[Red Hat]]. Ceylon programs run on the [[Java
| url=http://ceylon-lang.org/blog/2013/09/22/ceylon-1/
| title=Ceylon 1.0 beta
|
| url=http://www.theregister.co.uk/2011/04/13/red_hat_unveils_project_ceylon
| title=Project Ceylon – Red Hat builds Java replacement
| date=2011-04-13
| publisher=[[The Register]]
|
The language design focuses on [[Computer programming#Readability of source code|source code readability]], [[Predictability#Predictability in human–computer interaction|predictability]], [[Programming tool|toolability]], [[Modular programming|modularity]], and [[Metaprogramming|metaprogrammability]].<ref>{{cite web
| url=http://ceylon-lang.org/blog/2012/01/10/goals/
| title=Principles that guide this project
| date=2012-01-10
| last=King | first=Gavin
|
Important features of Ceylon include:<ref>{{cite web
| url=http://ceylon-lang.org/documentation/1.2/faq/language-design/#goals
| title=FAQ about language design: Goals
|
*
*
*
*
* powerful tools, including an Eclipse-based IDE
The name "Ceylon" is an oblique reference to Java, in that [[Java]] and [[Sri Lanka]], formerly known as Ceylon, are islands known for growth and export of [[coffee]] and [[tea]].
Line 122 ⟶ 136:
| url=http://ceylon-lang.org/documentation/1.2/spec/html_single/#compiletimesafety
| title=The Ceylon Language: §1.4.3 Compile-time safety for null values and flow-sensitive typing
|
| last=King | first=Gavin}}</ref>
Intersection types can be used to get a non-optional type out of a possibly-optional type, such as a type parameter. For example, the signature of a function that removes <code>null</code> elements from a stream of values could be:
<source lang="ceylon">
Line 132 ⟶ 145:
</source>
When <code>removeNulls</code> is called with a stream of <code>Integer|Null</code> elements, the result will be a stream of <code><Integer|Null> & Object</code> elements, which simplifies to <code>Integer</code>.
==== Functions ====
Similarly to many modern languages, Ceylon supports first class functions and higher order functions, including function types and anonymous functions <ref>{{cite web|last=King|first=Gavin|title=The Ceylon Language:
<source lang="ceylon">
Line 157 ⟶ 168:
String reversed2 = process("one", (text) => text+text);
</source>
==== Enumerated Types ====
Similar to Java and many other languages, and with a similar mechanism as algebraic types, Ceylon supports enumerated types, otherwise known as enums.
<source lang="ceylon">
Line 187 ⟶ 199:
</source>
==== Type
Ceylon is strongly and statically typed, but also has support for type inference.
The <code>value</code> keyword is used to infer the type of a variable,
Line 208 ⟶ 220:
| url=http://ceylon-lang.org/documentation/1.2/spec/html_single/#typeinference
| title=The Ceylon Language: §3.2.9 Type inference
|
| last=King | first=Gavin}}</ref>
Line 222 ⟶ 234:
but any other function can be used as main calling the program with the --run parameter, like this:
== License ==
Line 228 ⟶ 240:
| url=http://ceylon-lang.org/code/licenses
| title=Ceylon: Licenses
|
== See also ==
{{Portal|Free and open-source software}}
* [[Dart (programming language)]], has its own VM, compiles to JS
* [[Fantom (programming language)]], compiles to JVM
== References ==
|