- Ceylon Project
-
Ceylon Paradigm(s) Object-oriented Appeared in 2011 (tentative) Designed by Gavin King, Red Hat Typing discipline Static, strong, safe Influenced by Java, Scala, Smalltalk Usual filename extensions .ceylon The Ceylon Project is a programming language and SDK, created by Red Hat. It is based on the Java programming language and when it is released, will run under 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]
Contents
Language features
Ceylon inherits most of Java's syntax. The following is the Ceylon version of the Hello world program:
void hello() { writeLine("Hello World!"); }
Operator overloading
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
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.
Implementing an interface
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 aftersatisfies
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
Classes in Ceylon, as in Java, may only inherit from one class. Inheritance is declared using
extends
keyword. A class may reference itself usingthis
keyword.Abstract classes
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.
Releases
- A compiler release is planned for late 2011.
References
External links
- Official project website
- http://in.relation.to/Tutorials/IntroductionToCeylon
- http://in.relation.to/tag/Ceylon
- Introducing the Ceylon Project by Gavin King, Red Hat (Mirror)
- The Ceylon Type System by Gavin King, Red Hat (Mirror)
- Gavin King unveils Red Hat's Java successor: The Ceylon Project, by Marc Richards on April 11, 2011
- Ceylon JVM Language, Q&A question with Gavin King by Alex Blewitt on April 13, 2011.
Categories:- Java programming language family
- Programming language topic stubs
- Computer science stubs
Wikimedia Foundation. 2010.