You are on page 1of 6

Ceylon

1 of 6

file:///C:/Users/l7943416/Documents/dropbox/l7943416/scr...

Ceylon
Friday, 24 June, 2011 4:42:22 PM

Ceylon: True advance, or just another language?


Elaine.Ye
Linux
GNU Compiler
CollectionRubyPythonPerlRed Hat
CeylonLinux

C/C++JavaScalaRubyPythonPerlErlangLuaScheme

Red HatCeylon

CeylonJava
CeylonJavaJavaJava
JavaGavin King

Ceylon
CeylonRed HatGavin KingKingHibernateJava
KingJava
Standard
Edition SDkXML
KingJavaSDK
CeylonJavaJVM
CeylonC
SmalltalkJava
CeylonJava JavaCeylonJVM
JavaJVMCeylonCeylon
JavaJVM

Ceylon
CeylonCeylon

statically typed languageLisp

CeylonJava

Chigher-order function
Java
CeylonJava
publicprotectedprivateCeylon
sharedCeylon

Ceylonarraylist

Ceylon

6/2/2012 PM 10:28

Ceylon

2 of 6

file:///C:/Users/l7943416/Documents/dropbox/l7943416/scr...

Ceylon
Ceylon

Hello World
Hello World1
hellowriteLine
1. CeylonHello World
doc "Hello World Program"
by "Gavin King"
void hello() {
writeLine( "Hello World." );
}
APIdoxygendoc
by

Ceylon
Ceylon
1.
2.
3.
4.
5.

Natural
Integer
Float
Whole
Decimal

NaturalIntegerFloat64small32

Ceylon
CeylonCeylonclass

methodstate

class initializer

Ceylon22
Type?

shared
startshared

gettersetter
assign

Java
2. Ceylon
01
02
03
04
05
06
07
09
10

doc "Simple Counting Class"


class Counter( Natural? start ) {
doc "Class Initializer"
variable Natural count := 0;
if (exists start) {
count := start;
}

6/2/2012 PM 10:28

Ceylon

3 of 6

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

file:///C:/Users/l7943416/Documents/dropbox/l7943416/scr...

doc "The incrementer"


shared void increment() {
count++;
}
doc "The getter"
shared Natural currentValue {
return count;
}
doc "The setter"
shared assign currentValue {
count := currentValue;
}
}

Ceylon3Counter
cntCeylonnewCounter
incrementgetterCounterCeylon=:=
=:=
3. Counter
01
02
03

Counter cnt = Counter(1);


cnt.increment();
writeLine( c.currentValue );

Ceylon
variable25
Ceylon
{}
if (cnt > 10) statement();
CeylonCeylon
if (cnt > 100) { statement(); }
C

Ceylon
first-order function

first class objectKingrepeat


4Natural
repeatfor

4. Ceylon
01
02
03
04
05

void repeat( Natural times, void hfunction() ) {


for (Natural n in 1..times) {
hfunction();
}
}

57
5. Ceylon

6/2/2012 PM 10:28

Ceylon

4 of 6

01
02
03
04
05
06
07

file:///C:/Users/l7943416/Documents/dropbox/l7943416/scr...

void sayhello() {
writeLine( "Hello World." );
}
...
repeat( 10, sayhello );

Ceylon
closure

CeylonJavainstanceofCCeylon

type narrowing

6is
...
2
exists ...
6. Ceylon
01
02
03
04
05
06
07
08
09
10
11
12
13

Object obj = ;
switch (obj)
case (is Counter) {
obj.increment();
}
case (is ComplexCounter) {
obj.incrementBy(1);
}
else {
stream.writeLine("Unknown object");
}

Ceylonnonempty ...

CeylonswitchCJava
CeyloncasedefaultelseCeylon
switchelse
switch

Ceylonif...elseJavatrycatch
finallyCeylonfailfor7

7. Ceylonfail
01
02
03
04
05
06
07
08

for (Instrument i in instruments) {


if (i.failing()) {
break;
}
}
fail {
// Take some action...
}

CJavaCeylon

6/2/2012 PM 10:28

Ceylon

5 of 6

file:///C:/Users/l7943416/Documents/dropbox/l7943416/scr...

Ceylon

KingCeylon
SDKJavaCeylonKing
CeylonANTLRAnother Tool for Language Recognition

Ceylon

1. Gavin KingCeylon30 Introducing the Ceylon Project


KingCeylonThe Ceylon Type System

2. Gavin King11Ceylon
King

3. CeylonCeylon
4. ANTLRANTLR
University of San FranciscoTerence Parr
5. CeylonWikipediazfirst-class
functionhigher-order functionclosure
6. developerWorks Linux zonehow-to
Linux
7. developerWorks technical events and webcastsIBMIT
8. a free developerWorks Live! briefingIBMIT
9. developerWorks on-demand demos

10. TwitterdeveloperWorksLinux tweets on developerWorks

IBMSOA
SandboxService Oriented Architecture

6/2/2012 PM 10:28

Ceylon

6 of 6

file:///C:/Users/l7943416/Documents/dropbox/l7943416/scr...

My developerWorks communitywiki
developerWorks

M. Tim JonesArtificial Intelligence: A Systems Approach, GNU/Linux


Application Programming ()AI Application Programming ()BSD Sockets
Programming from a Multilanguage Perspective
TimIntel Longmont

LinuxRAID-
1.

Ubuntu LinuxWindows 7

6/2/2012 PM 10:28

You might also like