Ceylon Project

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 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

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

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



Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Ceylon Project — Dieser Artikel wurde aufgrund von inhaltlichen Mängeln auf der Qualitätssicherungsseite der Redaktion Informatik eingetragen. Dies geschieht, um die Qualität der Artikel aus dem Themengebiet Informatik auf ein akzeptables Niveau zu bringen. Hilf… …   Deutsch Wikipedia

  • Ceylon (disambiguation) — Ceylon is the former English name given to Sri Lanka, by the British, under their occupation of the island nation in South Asia. Ceylon may also refer to: Contents 1 Geography 1.1 Sri Lanka …   Wikipedia

  • CEYLON — (Sri Lanka), island, south of India, now an independent state. Legend and tradition, Islamic and Samaritan in origin, connect Ceylon with biblical personalities and events. Adam is said to have descended on the island after his expulsion from… …   Encyclopedia of Judaism

  • Project HOPE (USA) — Project HOPE (Health Opportunities for People Everywhere) is an international health care organization founded in the United States in 1958. Its most visible aspect was the SS HOPE , the first peacetime hospital ship (converted from the USS… …   Wikipedia

  • Commelina caroliniana — Specimen in Bangalore, India. This specimen is irregular as its upper cyme is exerted, whereas typically it is vestigial. Scientific classification …   Wikipedia

  • Sri Lanka — Ceylon redirects here. For the time period of 1948 1972, see Dominion of Ceylon. For other uses, see Ceylon (disambiguation). Democratic Socialist Republic of Sri Lanka ශ්‍රී ලංකා ප්‍රජාතාන්ත්‍රික සමාජවාදී ජනරජය (Sinhala) இலங்கை சனநாயக சமத்துவ… …   Wikipedia

  • Havelock City — Project Overview Infobox Skyscraper building name = Havelock City caption = Scenic view of Phase 1 under construction. year highest = year end = plural = location = Colombo, SRI coordinates = coord|06|52|55|N|79|52|00|E status = Under… …   Wikipedia

  • List of Trinity College, Kandy alumni — Trinity College, Kandy is an Independent elite private school providing primary and secondary education in Sri Lanka. It is widely considered to be the premier private boys school in Sri Lanka. This list of eminent Old Trinitians is by no means… …   Wikipedia

  • South Asian arts — Literary, performing, and visual arts of India, Pakistan, Bangladesh, and Sri Lanka. Myths of the popular gods, Vishnu and Shiva, in the Puranas (ancient tales) and the Mahabharata and Ramayana epics, supply material for representational and… …   Universalium

  • Chinese people in Sri Lanka — Total population Various estimates Related ethnic groups Chinese people There have been Chinese people in Sri Lanka since the 1700s.[1] Though their numbers dwindled in the decades after independence, in the 1990s and 2000s a new wave of Chinese… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”