Ceylon (programming language)

From Wikipedia, the free encyclopedia
  (Redirected from Ceylon Project)
Jump to: navigation, search
Ceylon
Ceylon (programming language) logo.png
Paradigm(s) Object-oriented
Designed by Gavin King, Red Hat
Appeared in 2011
Stable release 1.0[1] / November 12, 2013; 8 months ago (2013-11-12)
Typing discipline Static, strong, safe
Influenced by Java, Scala, Smalltalk
License Apache v2
Filename extension(s) .ceylon
Website http://ceylon-lang.org/

The Ceylon Project is a high-level, statically and strong-typed programming language and SDK, created by Red Hat. It is based on the Java programming language. Ceylon programs run on the Java Virtual Machine and JavaScript Virtual Machines.[2] [3]

Ceylon aims at solving the following problems its developers experienced with Java:[4][5][6]

  1. improved structured data and user interfaces
  2. language level modularity
  3. support for first-class and higher-order functions
  4. do away with clumsy meta-programming.

Language features[edit]

Ceylon inherits most of Java's syntax. The following is the Ceylon version of the Hello world program:[7]

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. [8]

Type system[edit]

The main principles behind the type system are:[9]

  • no special types, i.e. no primitive or compound types, "everything is an object".
  • no special functionality for built-in types.
  • everything should anyway work like "you expect" from Java / C / etc.
  • do not add complexity to type systems known from Java. Therefore no method overloading, wildcard types.

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.[10]
  • Fourth milestone release announced October 29, 2012.[11]
  • Fifth milestone release announced March 14, 2013.[12]
  • 1.0 beta release announced September 24, 2013.[13]
  • 1.0 production release announced November 12, 2013.[14]

See also[edit]

References[edit]

  1. ^ King, Gavin. "Ceylon 1.0.0 is now available". Retrieved 13 January 2014. 
  2. ^ "Ceylon 1.0 beta". Retrieved 2013-09-26. 
  3. ^ "Project Ceylon – Red Hat builds Java replacement". The Register. 2011-04-13. Retrieved 2011-11-27. 
  4. ^ Introducing the Ceylon Project – Gavin King presentations at QCon Beijing 2011
  5. ^ Gavin King (2011-04-13). "Ceylon". Retrieved 2011-11-27. 
  6. ^ "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" 
  7. ^ Gavin King (2011-04-27). "Introduction to Ceylon Part 1". Retrieved 2011-11-27. 
  8. ^ licences, official website
  9. ^ The Ceylon Type System, Gavin King.
  10. ^ Gavin King (2012-06-25). "Ceylon M3 and Ceylon IDE M3 released!". Retrieved 2012-07-05. 
  11. ^ Stéphane Épardaud (2012-10-29). "Ceylon M4 released". Retrieved 2012-12-04. 
  12. ^ Gavin King (2013-03-14). "Ceylon M5 released". Retrieved 2013-03-22. 
  13. ^ Gavin King (2013-09-24). "Ceylon 1.0 beta". Retrieved 2013-09-26. 
  14. ^ Gavin King (2013-11-12). "Ceylon 1.0.0 is now available". Retrieved 2013-11-13. 

External links[edit]