Ceylon (programming language)
|
|
This article appears to be written like an advertisement. (April 2013) |
![]() |
|
| Paradigm(s) | Object-oriented |
|---|---|
| Appeared in | 2011 |
| Designed by | Gavin King, Red Hat |
| Typing discipline | Static, strong, safe |
| Influenced by | Java, Scala, Smalltalk |
| License | GPL v2 |
| Usual filename extensions | .ceylon |
The Ceylon Project is an upcoming programming language and SDK, created by Red Hat. It is based on the Java programming language and when it is released, will run over the Java Virtual Machine.[1]
The project is described to be what a language and SDK for business computing would look like if it were designed today, keeping in mind the successes and failures of the Java language and Java SE SDK. The project has been referred to by industry analysts as a "Java killer", though Red Hat themselves reject this term.[2][3]
Contents |
Language features [edit]
Ceylon inherits most of Java's syntax. The following is the Ceylon version of the Hello world program:[4]
void hello() { print("Hello, World!"); }
Operator polymorphism [edit]
Ceylon will not provide operator overloading, as it was deemed to be generally confusing, but instead supports operator polymorphism, where an operator is a shortcut for a method of a built-in type. This is supposed to be safer and simpler than true operator overloading.
Interfaces [edit]
Interfaces are data structures that contain member definitions and not actual implementation. They are useful to define a contract between members in different types that have different implementations. Every interface is implicitly abstract.
An interface is implemented by a class using the satisfies keyword. It is allowed to implement more than one interface, in which case they are written after satisfies keyword in a comma-separated list. Ceylon allows for limited code besides for the definitions. An interface may not contain initialization logic, but can contain mixins.
shared interface Comparable<in T> { shared formal Comparison compare(T other); shared Boolean largerThan(T other) { return compare(other)==larger; } shared Boolean smallerThan(T other) { return compare(other)==smaller; } ... }
Inheritance [edit]
Classes in Ceylon, as in Java, may only inherit from one class. Inheritance is declared using extends keyword. A class may reference itself using this keyword.
Abstract classes are classes that only serve as templates and cannot be instantiated. Otherwise it is just like an ordinary class.
Only abstract classes are allowed to have abstract methods. Abstract methods do not have any implementation and must be overridden by a subclass unless it is abstract itself.
License [edit]
All the work, including even its website, the language specification, and Ceylon Herd, is freely available under open source licenses. [5]
Releases [edit]
- A compiler was released on December 20, 2011.
- The releases of the third milestones of the compiler and IDE were announced on June 25, 2012.[6]
- Fourth milestone release announced October 29, 2012.[7]
- Fifth milestone release announced March 14, 2013.[8]
References [edit]
- ^ "Project Ceylon – Red Hat builds Java replacement". The Register. 2011-04-13. Retrieved 2011-11-27.
- ^ Gavin King (2011-04-13). "Ceylon". Retrieved 2011-11-27.
- ^ "Ceylon JVM Language". infoq.com. 2011-04-13. Retrieved 2011-11-27. "First, I never billed this as a Java Killer or the next generation of the Java language. Not my words. Ceylon isn't Java, it's a new language that's deeply influenced by Java, designed by people who are unapologetic fans of Java. Java's not dying anytime soon, so nothing's killing it"
- ^ Gavin King (2011-04-27). "Introduction to Ceylon Part 1". Retrieved 2011-11-27.
- ^ licences, official website
- ^ Gavin King (2012-06-25). "Ceylon M3 and Ceylon IDE M3 released!". Retrieved 2012-07-05.
- ^ Stéphane Épardaud (2012-10-29). "Ceylon M4 released". Retrieved 2012-12-04.
- ^ Gavin King (2013-03-14). "Ceylon M5 released". Retrieved 2013-03-22.
External links [edit]
- Official project website
- http://in.relation.to/Tutorials/IntroductionToCeylon
- Introducing the Ceylon Project[dead link] by Gavin King, Red Hat (Mirror[dead link])
- The Ceylon Type System[dead link] by Gavin King, Red Hat (Mirror[dead link])
- Gavin King unveils Red Hat's Java successor: The Ceylon Project, by Marc Richards on April 11, 2011
