SlideShare ist ein Scribd-Unternehmen logo
1 von 33
the language and its tools
          Max Rydahl Andersen
                 Red Hat
      http://about.me/maxandersen

           EclipseCon 2012
About Me
•   Max Rydahl Andersen
•   Lead of JBoss Tools & Developer Studio
•   Committer on Hibernate Core, Seam & Weld
•   Co-host of JBoss Community Asylum Podcast
•   @maxandersen on Twitter
•   http://about.me/maxandersen
Ceylon Origins
•   Created and lead by Gavin King
•   Helped by others at JBoss
•   Frustrated love for Java
•   Lessons learned working in JCP
•   Starting blocks
    •   on the JVM
    •   in the spirit of Java
    •   practical
•   Slashdotted (with no web site)
Language Introduction
              z
doc "A familiar Rectangle"
class SimpleRectangle() {
	 Integer width = 0;
	 Integer height = 0;
	
	 function area() {
	 	 return width * height;
	 }
}
doc "A real Rectangle."
shared class Rectangle(Integer width, Integer
height) {
	 // initializer
  	if(width <=0 || height <=0) {
  		 throw;
  	}
  	
	 shared Integer width = width;
	 shared Integer height = height;
	
	 shared Integer area() {
	 	 return width * height;
	 }
	
}
Modular by default

package com.acme.dotcom.domain               package com.acme.dotcom.business
shared class Foo           class Woo         shared class Action       class Reaction
shared String bar()    shared String war()   shared String ping()       String pong()

   String baz()           String waz()
Immutable by default

Integer width = w;
Immutable by default

Integer width = w;
	
variable Integer width := w;
doc "A variable Rectangle with properties."
shared class VariableRectangle(Integer w,
Integer h) {
	
  shared variable Integer width := w;
	 shared variable Integer height := h;
	
	 shared Integer badArea {
	 	 return width * 42;
	 }             Text
	
	 assign badArea {
	 	 width := badArea/42;
	 }
	
	 shared actual String string {
	 	 return "w:" width ",h:" height "";
	 }
}
shared class
Point(Integer x, Integer y) {
    shared Integer x = x;
    shared Integer y = y;
}

shared class
Point3D (Integer x, Integer y, Integer z)
       extends Point(x, y) {
    shared Integer z = z;
}
Integer attribute = 1;
Integer attribute2 { return 2; }
void topmethod(){}
interface Interface{}

class Class(Integer x){
	 Integer attribute = x;
	 Integer attribute2 { return x; }
	 class InnerClass(){}
	 interface InnerInterface{}
	
	 void method(Integer y){
	 	 Integer attribute = x;
	 	 Integer attribute2 { return y; }
	 	 class LocalClass(){}
	 	 interface LocalInterface{}
	 	 void innerMethod(Integer y){}
	 }
}
No
     NullPointerException’s
void typesafety() {

     Rectangle? rectOrNoRect() { return null; }
     Rectangle? rect = rectOrNoRect();

     print(rect.string);	// compile error

	   if(exists rect) {
	   	 print(rect.string);
	   } else {
	   	 print("No rectangle");
	   }
}
What is in a



               Type ?
Union Type

• To be able to hold values among a list of
  types
• We must check the actual type before use
• `TypeA|TypeB`
• `Type?` is an alias for `Type|Nothing`
class Apple()
{ shared void eat() { print("Eat " this ""); }}

class Broccoli()
{ shared void throwAway() { print("Throw " this ""); } }

void unions() {
	 Sequence<Apple|Broccoli> plate =
    {Apple(), Broccoli()};
	
for (Apple|Broccoli food in plate) {
	 	 print("Looking at: " food.string "");
	 	 if (is Apple food) {
	 	 	 food.eat();
	 	 } else if (is Broccoli food) {
	 	 	 food.throwAway();
	 	 }
	 }
}
Intersection Type
interface Food { shared formal void eat(); }

interface Drink { shared formal void drink(); }

class Guinness() satisfies Food & Drink {
	 shared actual void drink() {}
	 shared actual void eat() {}
}

void intersections(){
	 Food & Drink specialStuff = Guinness();
	 specialStuff.drink();
	 specialStuff.eat();
}
No Overloading
No Overloading
   •   WTF!?
No Overloading
   •   WTF!?
   •   is overloading evil ?
No Overloading
   •   WTF!?
   •   is overloading evil ?
No Overloading
   •   WTF!?
   •   is overloading evil ?


   •   Only usecase:
       •   Optional parameters
       •   Work on different subtypes
class
Rectangle(Integer width = 2, Integer height = 3) {
    shared Integer area(){
        return width * height;
    }
}

void method() {
    Rectangle rectangle = Rectangle();
    Rectangle rectangle2 = Rectangle {
        width = 3;
        height = 4;
    };
}
interface Shape2D of Triangle|Circle|Figure2D {}
class Triangle() satisfies Shape2D {}
class Circle() satisfies Shape2D {}
class Figure2D() satisfies Shape2D {}

void workWithRectangle(Triangle rect){}
void workWithCircle(Circle circle){}
void workWithFigure2D(Figure2D fig){}

void supportsSubTyping(Shape2D fig) {
    switch(fig)
    case(is Triangle) {
      workWithRectangle(fig);
    }
    case(is Circle) {
      workWithCircle(fig);
    }
    case(is Figure2D) {
      workWithFigure2D(fig);
    }
}
Other features
•   Interface based Operator overloading
•   Closures
•   Annotations
•   Type aliases
•   Meta-model
•   Interception
•   Interface with default implementations / “multiple inheritance”
•   Declarative syntax for datastructures
•   ...and more
Table table = Table {
    title="Squares";
    rows=5;
    border = Border {
        padding=2;
        weight=1;
    };
    Column {
        heading="x";
        width=10;
        String content(Natural row) {
             return row.string;
        }
    },
    Column {
        heading="x**2";
        width=12;
        String content(Natural row) {
             return (row**2).string;
        }
    }
};
Ceylon Today
•   Website (http://ceylon-lang.org)
•   Active and growing community
•   Fully open source (http://github.com/ceylon)
•   Targets JVM and JS (http://try.ceylon-lang.org)
•   Milestone 2 just released
    •   Java interopability
    •   Full IDE support
Ceylon IDE
Ceylon IDE

•   Incremental compiler and error reporting
•   Full editor with outline, folding and navigation
•   Refactoring, Quick fixes, Search
•   Wizards, Module repository integration
•   Debugging
Ceylon IDE -
      Behind the Scenes
•   Considered XText, DLTK, IMP & “DIY”
•   XText - very complete, but does not allow Antlr
    and require XText custom parser and
    typechecker
•   DLTK - allows Antlr, but at the time no good
    documentation and a preference to by “too
    dynamic language focused”
•   IMP - allows antlr and custom typechecker and
    just worked, but..
Ceylon IDE -
            Next Steps
•   IMP has many limitations when you push it
•   XText still too much “XText”
•   DLTK looks interesting
•   End result probably a mix of the above in a
    “DIY” solution
•   Contributors welcome!
Ceylon - Tomorrow
•   M3:
    •   - Annotations
    •    - Reified type parameters
    •    - Interception
    •    - Meta-model
    •   <Your Name Here>
?
•   http://try.ceylon-lang.org
•   http://ceylon-lang.org
•   http://ceylon.github.com/
       Text
        Text




            bit.ly/ec12ceylon

Weitere ähnliche Inhalte

Was ist angesagt?

Kotlin for Android Developers - 3
Kotlin for Android Developers - 3Kotlin for Android Developers - 3
Kotlin for Android Developers - 3Mohamed Nabil, MSc.
 
Java/Scala Lab 2016. Григорий Кравцов: Реализация и тестирование DAO слоя с н...
Java/Scala Lab 2016. Григорий Кравцов: Реализация и тестирование DAO слоя с н...Java/Scala Lab 2016. Григорий Кравцов: Реализация и тестирование DAO слоя с н...
Java/Scala Lab 2016. Григорий Кравцов: Реализация и тестирование DAO слоя с н...GeeksLab Odessa
 
An Introduction to Scala for Java Developers
An Introduction to Scala for Java DevelopersAn Introduction to Scala for Java Developers
An Introduction to Scala for Java DevelopersMiles Sabin
 
Scala jeff
Scala jeffScala jeff
Scala jeffjeff kit
 
Taking Kotlin to production, Seriously
Taking Kotlin to production, SeriouslyTaking Kotlin to production, Seriously
Taking Kotlin to production, SeriouslyHaim Yadid
 
Poniendo Kotlin en producción a palos (Kotlin in production, the hard way)
Poniendo Kotlin en producción a palos (Kotlin in production, the hard way)Poniendo Kotlin en producción a palos (Kotlin in production, the hard way)
Poniendo Kotlin en producción a palos (Kotlin in production, the hard way)Andrés Viedma Peláez
 
Few simple-type-tricks in scala
Few simple-type-tricks in scalaFew simple-type-tricks in scala
Few simple-type-tricks in scalaRuslan Shevchenko
 
Intro to Kotlin
Intro to KotlinIntro to Kotlin
Intro to KotlinMagda Miu
 
Kotlin Developer Starter in Android projects
Kotlin Developer Starter in Android projectsKotlin Developer Starter in Android projects
Kotlin Developer Starter in Android projectsBartosz Kosarzycki
 
Xbase - Implementing Domain-Specific Languages for Java
Xbase - Implementing Domain-Specific Languages for JavaXbase - Implementing Domain-Specific Languages for Java
Xbase - Implementing Domain-Specific Languages for Javameysholdt
 
Python internals and how they affect your code - kasra ahmadvand
Python internals and how they affect your code - kasra ahmadvandPython internals and how they affect your code - kasra ahmadvand
Python internals and how they affect your code - kasra ahmadvandirpycon
 
Kotlin Language Features - A Java comparison
Kotlin Language Features - A Java comparisonKotlin Language Features - A Java comparison
Kotlin Language Features - A Java comparisonEd Austin
 
Java OOP Programming language (Part 5) - Inheritance
Java OOP Programming language (Part 5) - InheritanceJava OOP Programming language (Part 5) - Inheritance
Java OOP Programming language (Part 5) - InheritanceOUM SAOKOSAL
 
Starting with Scala : Frontier Developer's Meetup December 2010
Starting with Scala : Frontier Developer's Meetup December 2010Starting with Scala : Frontier Developer's Meetup December 2010
Starting with Scala : Frontier Developer's Meetup December 2010Derek Chen-Becker
 

Was ist angesagt? (19)

Java Performance MythBusters
Java Performance MythBustersJava Performance MythBusters
Java Performance MythBusters
 
Kotlin for Android Developers - 3
Kotlin for Android Developers - 3Kotlin for Android Developers - 3
Kotlin for Android Developers - 3
 
Java/Scala Lab 2016. Григорий Кравцов: Реализация и тестирование DAO слоя с н...
Java/Scala Lab 2016. Григорий Кравцов: Реализация и тестирование DAO слоя с н...Java/Scala Lab 2016. Григорий Кравцов: Реализация и тестирование DAO слоя с н...
Java/Scala Lab 2016. Григорий Кравцов: Реализация и тестирование DAO слоя с н...
 
An Introduction to Scala for Java Developers
An Introduction to Scala for Java DevelopersAn Introduction to Scala for Java Developers
An Introduction to Scala for Java Developers
 
Kotlin
KotlinKotlin
Kotlin
 
Scala jeff
Scala jeffScala jeff
Scala jeff
 
Java for beginners
Java for beginnersJava for beginners
Java for beginners
 
Taking Kotlin to production, Seriously
Taking Kotlin to production, SeriouslyTaking Kotlin to production, Seriously
Taking Kotlin to production, Seriously
 
Poniendo Kotlin en producción a palos (Kotlin in production, the hard way)
Poniendo Kotlin en producción a palos (Kotlin in production, the hard way)Poniendo Kotlin en producción a palos (Kotlin in production, the hard way)
Poniendo Kotlin en producción a palos (Kotlin in production, the hard way)
 
Few simple-type-tricks in scala
Few simple-type-tricks in scalaFew simple-type-tricks in scala
Few simple-type-tricks in scala
 
Intro to Kotlin
Intro to KotlinIntro to Kotlin
Intro to Kotlin
 
Kotlin Developer Starter in Android projects
Kotlin Developer Starter in Android projectsKotlin Developer Starter in Android projects
Kotlin Developer Starter in Android projects
 
Xbase - Implementing Domain-Specific Languages for Java
Xbase - Implementing Domain-Specific Languages for JavaXbase - Implementing Domain-Specific Languages for Java
Xbase - Implementing Domain-Specific Languages for Java
 
Python internals and how they affect your code - kasra ahmadvand
Python internals and how they affect your code - kasra ahmadvandPython internals and how they affect your code - kasra ahmadvand
Python internals and how they affect your code - kasra ahmadvand
 
Scala jargon cheatsheet
Scala jargon cheatsheetScala jargon cheatsheet
Scala jargon cheatsheet
 
Scale up your thinking
Scale up your thinkingScale up your thinking
Scale up your thinking
 
Kotlin Language Features - A Java comparison
Kotlin Language Features - A Java comparisonKotlin Language Features - A Java comparison
Kotlin Language Features - A Java comparison
 
Java OOP Programming language (Part 5) - Inheritance
Java OOP Programming language (Part 5) - InheritanceJava OOP Programming language (Part 5) - Inheritance
Java OOP Programming language (Part 5) - Inheritance
 
Starting with Scala : Frontier Developer's Meetup December 2010
Starting with Scala : Frontier Developer's Meetup December 2010Starting with Scala : Frontier Developer's Meetup December 2010
Starting with Scala : Frontier Developer's Meetup December 2010
 

Andere mochten auch

Ceylon From Here to Infinity: The Big Picture and What's Coming
Ceylon From Here to Infinity: The Big Picture and What's Coming Ceylon From Here to Infinity: The Big Picture and What's Coming
Ceylon From Here to Infinity: The Big Picture and What's Coming Virtual JBoss User Group
 
The Ceylon Type System - Gavin King presentation at QCon Beijing 2011
The Ceylon Type System - Gavin King presentation at QCon Beijing 2011The Ceylon Type System - Gavin King presentation at QCon Beijing 2011
The Ceylon Type System - Gavin King presentation at QCon Beijing 2011devstonez
 
Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014
Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014
Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014hwilming
 
Ceylon/Java interop by Tako Schotanus
Ceylon/Java interop by Tako SchotanusCeylon/Java interop by Tako Schotanus
Ceylon/Java interop by Tako SchotanusUnFroMage
 
Ceylon introduction by Stéphane Épardaud
Ceylon introduction by Stéphane ÉpardaudCeylon introduction by Stéphane Épardaud
Ceylon introduction by Stéphane ÉpardaudUnFroMage
 
Ceylon.build by Loïc Rouchon
Ceylon.build by Loïc RouchonCeylon.build by Loïc Rouchon
Ceylon.build by Loïc RouchonUnFroMage
 
Ceylon SDK by Stéphane Épardaud
Ceylon SDK by Stéphane ÉpardaudCeylon SDK by Stéphane Épardaud
Ceylon SDK by Stéphane ÉpardaudUnFroMage
 
Ceylon.test by Thomáš Hradec
Ceylon.test by Thomáš HradecCeylon.test by Thomáš Hradec
Ceylon.test by Thomáš HradecUnFroMage
 
Introducing the Ceylon Project - Gavin King presentation at QCon Beijing 2011
Introducing the Ceylon Project - Gavin King presentation at QCon Beijing 2011Introducing the Ceylon Project - Gavin King presentation at QCon Beijing 2011
Introducing the Ceylon Project - Gavin King presentation at QCon Beijing 2011devstonez
 

Andere mochten auch (9)

Ceylon From Here to Infinity: The Big Picture and What's Coming
Ceylon From Here to Infinity: The Big Picture and What's Coming Ceylon From Here to Infinity: The Big Picture and What's Coming
Ceylon From Here to Infinity: The Big Picture and What's Coming
 
The Ceylon Type System - Gavin King presentation at QCon Beijing 2011
The Ceylon Type System - Gavin King presentation at QCon Beijing 2011The Ceylon Type System - Gavin King presentation at QCon Beijing 2011
The Ceylon Type System - Gavin King presentation at QCon Beijing 2011
 
Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014
Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014
Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014
 
Ceylon/Java interop by Tako Schotanus
Ceylon/Java interop by Tako SchotanusCeylon/Java interop by Tako Schotanus
Ceylon/Java interop by Tako Schotanus
 
Ceylon introduction by Stéphane Épardaud
Ceylon introduction by Stéphane ÉpardaudCeylon introduction by Stéphane Épardaud
Ceylon introduction by Stéphane Épardaud
 
Ceylon.build by Loïc Rouchon
Ceylon.build by Loïc RouchonCeylon.build by Loïc Rouchon
Ceylon.build by Loïc Rouchon
 
Ceylon SDK by Stéphane Épardaud
Ceylon SDK by Stéphane ÉpardaudCeylon SDK by Stéphane Épardaud
Ceylon SDK by Stéphane Épardaud
 
Ceylon.test by Thomáš Hradec
Ceylon.test by Thomáš HradecCeylon.test by Thomáš Hradec
Ceylon.test by Thomáš Hradec
 
Introducing the Ceylon Project - Gavin King presentation at QCon Beijing 2011
Introducing the Ceylon Project - Gavin King presentation at QCon Beijing 2011Introducing the Ceylon Project - Gavin King presentation at QCon Beijing 2011
Introducing the Ceylon Project - Gavin King presentation at QCon Beijing 2011
 

Ähnlich wie Ceylon - the language and its tools

Kotlin for Android Development
Kotlin for Android DevelopmentKotlin for Android Development
Kotlin for Android DevelopmentSpeck&Tech
 
Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...
Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...
Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...Tudor Dragan
 
Scala @ TechMeetup Edinburgh
Scala @ TechMeetup EdinburghScala @ TechMeetup Edinburgh
Scala @ TechMeetup EdinburghStuart Roebuck
 
Effective Scala (JavaDay Riga 2013)
Effective Scala (JavaDay Riga 2013)Effective Scala (JavaDay Riga 2013)
Effective Scala (JavaDay Riga 2013)mircodotta
 
Introduction to Scala for JCConf Taiwan
Introduction to Scala for JCConf TaiwanIntroduction to Scala for JCConf Taiwan
Introduction to Scala for JCConf TaiwanJimin Hsieh
 
CSharp presentation and software developement
CSharp presentation and software developementCSharp presentation and software developement
CSharp presentation and software developementfrwebhelp
 
BCS SPA 2010 - An Introduction to Scala for Java Developers
BCS SPA 2010 - An Introduction to Scala for Java DevelopersBCS SPA 2010 - An Introduction to Scala for Java Developers
BCS SPA 2010 - An Introduction to Scala for Java DevelopersMiles Sabin
 
Exploring Clojurescript
Exploring ClojurescriptExploring Clojurescript
Exploring ClojurescriptLuke Donnet
 
Oscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneOscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneAndres Almiray
 
A Brief Introduction to Scala for Java Developers
A Brief Introduction to Scala for Java DevelopersA Brief Introduction to Scala for Java Developers
A Brief Introduction to Scala for Java DevelopersMiles Sabin
 
Miles Sabin Introduction To Scala For Java Developers
Miles Sabin Introduction To Scala For Java DevelopersMiles Sabin Introduction To Scala For Java Developers
Miles Sabin Introduction To Scala For Java DevelopersSkills Matter
 
sbt, history of JSON libraries, microservices, and schema evolution (Tokyo ver)
sbt, history of JSON libraries, microservices, and schema evolution (Tokyo ver)sbt, history of JSON libraries, microservices, and schema evolution (Tokyo ver)
sbt, history of JSON libraries, microservices, and schema evolution (Tokyo ver)Eugene Yokota
 
Scala: Object-Oriented Meets Functional, by Iulian Dragos
Scala: Object-Oriented Meets Functional, by Iulian DragosScala: Object-Oriented Meets Functional, by Iulian Dragos
Scala: Object-Oriented Meets Functional, by Iulian Dragos3Pillar Global
 
Static or Dynamic Typing? Why not both?
Static or Dynamic Typing? Why not both?Static or Dynamic Typing? Why not both?
Static or Dynamic Typing? Why not both?Mario Camou Riveroll
 
ActiveJDBC - ActiveRecord implementation in Java
ActiveJDBC - ActiveRecord implementation in JavaActiveJDBC - ActiveRecord implementation in Java
ActiveJDBC - ActiveRecord implementation in Javaipolevoy
 

Ähnlich wie Ceylon - the language and its tools (20)

Kotlin for Android Development
Kotlin for Android DevelopmentKotlin for Android Development
Kotlin for Android Development
 
core java
core javacore java
core java
 
Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...
Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...
Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...
 
Scala @ TechMeetup Edinburgh
Scala @ TechMeetup EdinburghScala @ TechMeetup Edinburgh
Scala @ TechMeetup Edinburgh
 
Effective Scala (JavaDay Riga 2013)
Effective Scala (JavaDay Riga 2013)Effective Scala (JavaDay Riga 2013)
Effective Scala (JavaDay Riga 2013)
 
Introduction to Scala for JCConf Taiwan
Introduction to Scala for JCConf TaiwanIntroduction to Scala for JCConf Taiwan
Introduction to Scala for JCConf Taiwan
 
CSharp presentation and software developement
CSharp presentation and software developementCSharp presentation and software developement
CSharp presentation and software developement
 
BCS SPA 2010 - An Introduction to Scala for Java Developers
BCS SPA 2010 - An Introduction to Scala for Java DevelopersBCS SPA 2010 - An Introduction to Scala for Java Developers
BCS SPA 2010 - An Introduction to Scala for Java Developers
 
Object-oriented Basics
Object-oriented BasicsObject-oriented Basics
Object-oriented Basics
 
C# for Java Developers
C# for Java DevelopersC# for Java Developers
C# for Java Developers
 
Clojure Small Intro
Clojure Small IntroClojure Small Intro
Clojure Small Intro
 
Clojure class
Clojure classClojure class
Clojure class
 
Exploring Clojurescript
Exploring ClojurescriptExploring Clojurescript
Exploring Clojurescript
 
Oscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneOscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast Lane
 
A Brief Introduction to Scala for Java Developers
A Brief Introduction to Scala for Java DevelopersA Brief Introduction to Scala for Java Developers
A Brief Introduction to Scala for Java Developers
 
Miles Sabin Introduction To Scala For Java Developers
Miles Sabin Introduction To Scala For Java DevelopersMiles Sabin Introduction To Scala For Java Developers
Miles Sabin Introduction To Scala For Java Developers
 
sbt, history of JSON libraries, microservices, and schema evolution (Tokyo ver)
sbt, history of JSON libraries, microservices, and schema evolution (Tokyo ver)sbt, history of JSON libraries, microservices, and schema evolution (Tokyo ver)
sbt, history of JSON libraries, microservices, and schema evolution (Tokyo ver)
 
Scala: Object-Oriented Meets Functional, by Iulian Dragos
Scala: Object-Oriented Meets Functional, by Iulian DragosScala: Object-Oriented Meets Functional, by Iulian Dragos
Scala: Object-Oriented Meets Functional, by Iulian Dragos
 
Static or Dynamic Typing? Why not both?
Static or Dynamic Typing? Why not both?Static or Dynamic Typing? Why not both?
Static or Dynamic Typing? Why not both?
 
ActiveJDBC - ActiveRecord implementation in Java
ActiveJDBC - ActiveRecord implementation in JavaActiveJDBC - ActiveRecord implementation in Java
ActiveJDBC - ActiveRecord implementation in Java
 

Mehr von Max Andersen

Quarkus Denmark 2019
Quarkus Denmark 2019Quarkus Denmark 2019
Quarkus Denmark 2019Max Andersen
 
Docker Tooling for Eclipse
Docker Tooling for EclipseDocker Tooling for Eclipse
Docker Tooling for EclipseMax Andersen
 
OpenShift: Java EE in the clouds
OpenShift: Java EE in the cloudsOpenShift: Java EE in the clouds
OpenShift: Java EE in the cloudsMax Andersen
 
Case study: JBoss Developer Studio, an IDE for Web, Mobile and Cloud applicat...
Case study: JBoss Developer Studio, an IDE for Web, Mobile and Cloud applicat...Case study: JBoss Developer Studio, an IDE for Web, Mobile and Cloud applicat...
Case study: JBoss Developer Studio, an IDE for Web, Mobile and Cloud applicat...Max Andersen
 
Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7
Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7
Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7Max Andersen
 
Enterprise Maven Repository BOF
Enterprise Maven Repository BOFEnterprise Maven Repository BOF
Enterprise Maven Repository BOFMax Andersen
 
Google analytics for Eclipse Plugins
Google analytics for Eclipse PluginsGoogle analytics for Eclipse Plugins
Google analytics for Eclipse PluginsMax Andersen
 
JBoss Enterprise Maven Repository
JBoss Enterprise Maven RepositoryJBoss Enterprise Maven Repository
JBoss Enterprise Maven RepositoryMax Andersen
 
Tycho - good, bad or ugly ?
Tycho - good, bad or ugly ?Tycho - good, bad or ugly ?
Tycho - good, bad or ugly ?Max Andersen
 
Making Examples Accessible
Making Examples AccessibleMaking Examples Accessible
Making Examples AccessibleMax Andersen
 
OpenShift Express Intro
OpenShift Express IntroOpenShift Express Intro
OpenShift Express IntroMax Andersen
 
JBoss AS 7 from a user perspective
JBoss AS 7 from a user perspectiveJBoss AS 7 from a user perspective
JBoss AS 7 from a user perspectiveMax Andersen
 
How to be effective with JBoss Developer Studio
How to be effective with JBoss Developer StudioHow to be effective with JBoss Developer Studio
How to be effective with JBoss Developer StudioMax Andersen
 
JBoss Asylum Podcast Live from JUDCon 2010
JBoss Asylum Podcast Live from JUDCon 2010JBoss Asylum Podcast Live from JUDCon 2010
JBoss Asylum Podcast Live from JUDCon 2010Max Andersen
 
How To Make A Framework Plugin That Does Not Suck
How To Make A Framework Plugin That Does Not SuckHow To Make A Framework Plugin That Does Not Suck
How To Make A Framework Plugin That Does Not SuckMax Andersen
 

Mehr von Max Andersen (16)

Quarkus Denmark 2019
Quarkus Denmark 2019Quarkus Denmark 2019
Quarkus Denmark 2019
 
Docker Tooling for Eclipse
Docker Tooling for EclipseDocker Tooling for Eclipse
Docker Tooling for Eclipse
 
OpenShift: Java EE in the clouds
OpenShift: Java EE in the cloudsOpenShift: Java EE in the clouds
OpenShift: Java EE in the clouds
 
Case study: JBoss Developer Studio, an IDE for Web, Mobile and Cloud applicat...
Case study: JBoss Developer Studio, an IDE for Web, Mobile and Cloud applicat...Case study: JBoss Developer Studio, an IDE for Web, Mobile and Cloud applicat...
Case study: JBoss Developer Studio, an IDE for Web, Mobile and Cloud applicat...
 
Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7
Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7
Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7
 
Enterprise Maven Repository BOF
Enterprise Maven Repository BOFEnterprise Maven Repository BOF
Enterprise Maven Repository BOF
 
Google analytics for Eclipse Plugins
Google analytics for Eclipse PluginsGoogle analytics for Eclipse Plugins
Google analytics for Eclipse Plugins
 
JBoss Enterprise Maven Repository
JBoss Enterprise Maven RepositoryJBoss Enterprise Maven Repository
JBoss Enterprise Maven Repository
 
Tycho - good, bad or ugly ?
Tycho - good, bad or ugly ?Tycho - good, bad or ugly ?
Tycho - good, bad or ugly ?
 
Making Examples Accessible
Making Examples AccessibleMaking Examples Accessible
Making Examples Accessible
 
OpenShift Express Intro
OpenShift Express IntroOpenShift Express Intro
OpenShift Express Intro
 
JBoss AS 7 from a user perspective
JBoss AS 7 from a user perspectiveJBoss AS 7 from a user perspective
JBoss AS 7 from a user perspective
 
How to be effective with JBoss Developer Studio
How to be effective with JBoss Developer StudioHow to be effective with JBoss Developer Studio
How to be effective with JBoss Developer Studio
 
JBoss Asylum Podcast Live from JUDCon 2010
JBoss Asylum Podcast Live from JUDCon 2010JBoss Asylum Podcast Live from JUDCon 2010
JBoss Asylum Podcast Live from JUDCon 2010
 
How To Make A Framework Plugin That Does Not Suck
How To Make A Framework Plugin That Does Not SuckHow To Make A Framework Plugin That Does Not Suck
How To Make A Framework Plugin That Does Not Suck
 
Kickstart Jpa
Kickstart JpaKickstart Jpa
Kickstart Jpa
 

Kürzlich hochgeladen

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 

Kürzlich hochgeladen (20)

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 

Ceylon - the language and its tools

  • 1. the language and its tools Max Rydahl Andersen Red Hat http://about.me/maxandersen EclipseCon 2012
  • 2. About Me • Max Rydahl Andersen • Lead of JBoss Tools & Developer Studio • Committer on Hibernate Core, Seam & Weld • Co-host of JBoss Community Asylum Podcast • @maxandersen on Twitter • http://about.me/maxandersen
  • 3. Ceylon Origins • Created and lead by Gavin King • Helped by others at JBoss • Frustrated love for Java • Lessons learned working in JCP • Starting blocks • on the JVM • in the spirit of Java • practical • Slashdotted (with no web site)
  • 5. doc "A familiar Rectangle" class SimpleRectangle() { Integer width = 0; Integer height = 0; function area() { return width * height; } }
  • 6. doc "A real Rectangle." shared class Rectangle(Integer width, Integer height) { // initializer if(width <=0 || height <=0) { throw; } shared Integer width = width; shared Integer height = height; shared Integer area() { return width * height; } }
  • 7. Modular by default package com.acme.dotcom.domain package com.acme.dotcom.business shared class Foo class Woo shared class Action class Reaction shared String bar() shared String war() shared String ping() String pong() String baz() String waz()
  • 9. Immutable by default Integer width = w; variable Integer width := w;
  • 10. doc "A variable Rectangle with properties." shared class VariableRectangle(Integer w, Integer h) { shared variable Integer width := w; shared variable Integer height := h; shared Integer badArea { return width * 42; } Text assign badArea { width := badArea/42; } shared actual String string { return "w:" width ",h:" height ""; } }
  • 11. shared class Point(Integer x, Integer y) { shared Integer x = x; shared Integer y = y; } shared class Point3D (Integer x, Integer y, Integer z) extends Point(x, y) { shared Integer z = z; }
  • 12. Integer attribute = 1; Integer attribute2 { return 2; } void topmethod(){} interface Interface{} class Class(Integer x){ Integer attribute = x; Integer attribute2 { return x; } class InnerClass(){} interface InnerInterface{} void method(Integer y){ Integer attribute = x; Integer attribute2 { return y; } class LocalClass(){} interface LocalInterface{} void innerMethod(Integer y){} } }
  • 13. No NullPointerException’s void typesafety() { Rectangle? rectOrNoRect() { return null; } Rectangle? rect = rectOrNoRect(); print(rect.string); // compile error if(exists rect) { print(rect.string); } else { print("No rectangle"); } }
  • 14. What is in a Type ?
  • 15. Union Type • To be able to hold values among a list of types • We must check the actual type before use • `TypeA|TypeB` • `Type?` is an alias for `Type|Nothing`
  • 16. class Apple() { shared void eat() { print("Eat " this ""); }} class Broccoli() { shared void throwAway() { print("Throw " this ""); } } void unions() { Sequence<Apple|Broccoli> plate = {Apple(), Broccoli()}; for (Apple|Broccoli food in plate) { print("Looking at: " food.string ""); if (is Apple food) { food.eat(); } else if (is Broccoli food) { food.throwAway(); } } }
  • 17. Intersection Type interface Food { shared formal void eat(); } interface Drink { shared formal void drink(); } class Guinness() satisfies Food & Drink { shared actual void drink() {} shared actual void eat() {} } void intersections(){ Food & Drink specialStuff = Guinness(); specialStuff.drink(); specialStuff.eat(); }
  • 19. No Overloading • WTF!?
  • 20. No Overloading • WTF!? • is overloading evil ?
  • 21. No Overloading • WTF!? • is overloading evil ?
  • 22. No Overloading • WTF!? • is overloading evil ? • Only usecase: • Optional parameters • Work on different subtypes
  • 23. class Rectangle(Integer width = 2, Integer height = 3) { shared Integer area(){ return width * height; } } void method() { Rectangle rectangle = Rectangle(); Rectangle rectangle2 = Rectangle { width = 3; height = 4; }; }
  • 24. interface Shape2D of Triangle|Circle|Figure2D {} class Triangle() satisfies Shape2D {} class Circle() satisfies Shape2D {} class Figure2D() satisfies Shape2D {} void workWithRectangle(Triangle rect){} void workWithCircle(Circle circle){} void workWithFigure2D(Figure2D fig){} void supportsSubTyping(Shape2D fig) { switch(fig) case(is Triangle) { workWithRectangle(fig); } case(is Circle) { workWithCircle(fig); } case(is Figure2D) { workWithFigure2D(fig); } }
  • 25. Other features • Interface based Operator overloading • Closures • Annotations • Type aliases • Meta-model • Interception • Interface with default implementations / “multiple inheritance” • Declarative syntax for datastructures • ...and more
  • 26. Table table = Table { title="Squares"; rows=5; border = Border { padding=2; weight=1; }; Column { heading="x"; width=10; String content(Natural row) { return row.string; } }, Column { heading="x**2"; width=12; String content(Natural row) { return (row**2).string; } } };
  • 27. Ceylon Today • Website (http://ceylon-lang.org) • Active and growing community • Fully open source (http://github.com/ceylon) • Targets JVM and JS (http://try.ceylon-lang.org) • Milestone 2 just released • Java interopability • Full IDE support
  • 29. Ceylon IDE • Incremental compiler and error reporting • Full editor with outline, folding and navigation • Refactoring, Quick fixes, Search • Wizards, Module repository integration • Debugging
  • 30. Ceylon IDE - Behind the Scenes • Considered XText, DLTK, IMP & “DIY” • XText - very complete, but does not allow Antlr and require XText custom parser and typechecker • DLTK - allows Antlr, but at the time no good documentation and a preference to by “too dynamic language focused” • IMP - allows antlr and custom typechecker and just worked, but..
  • 31. Ceylon IDE - Next Steps • IMP has many limitations when you push it • XText still too much “XText” • DLTK looks interesting • End result probably a mix of the above in a “DIY” solution • Contributors welcome!
  • 32. Ceylon - Tomorrow • M3: • - Annotations • - Reified type parameters • - Interception • - Meta-model • <Your Name Here>
  • 33. ? • http://try.ceylon-lang.org • http://ceylon-lang.org • http://ceylon.github.com/ Text Text bit.ly/ec12ceylon

Hinweis der Redaktion

  1. \n
  2. \n
  3. JBoss: Emmanuel, Pete Muir, David Lloyd, Ales Justin, and more...\n\n\n
  4. \n
  5. simple class, should be nice and familiar.\nA few rules: classes always starts with a capital letter, and methods/attributes always starts with a lowercase letter.\n\nThe doc is a string/annotation to help \narea is a function using type inference.\n\nBut where is the constructor ?\n
  6. constructor in the blocks\n\nThe area now have to be explicit about its type to avoid exposing too specific types.\n\nstarting to use shared for scope/visibility.\n\n\n
  7. shared is the only scope modifier.\nmodule, package, class/methods\n\nshared are seen by those within my parent and outside if parent is shared too.\nYou can talk to the kids if you also can see the parents.\n\nTo be public you really need to mean it\n
  8. To have mutable data you really need to mean it.\n
  9. variable properties with values and methods (badArea)\n\n\n
  10. class extends - parameters passed into the class constructor.\n
  11. Ceylon is extremely regular - everything can be nested, allowing a lot more modularity than we are used to in java.\n
  12. There is no way ceylon code can get an NPE. Its checked by the compiler and if you must you use if exists or the elvis operator ?.\n\n
  13. One of the exotic but key features of Ceylon is its type system - it is after all a strongly typed language. \n\n
  14. You are used to having a variable just having &amp;#x201C;one type&amp;#x201D; but in Ceylon they can actually be representing multiple types all at the same time.\n\n
  15. Notice that I can call shared methods on union types - such as food.string.\nIf I tried to call food.eat() before it would not let me. \n
  16. Here Guiness is both a food and drink and thus I can call both Food and Drink methods - but I can&amp;#x2019;t assign just a Food.\n
  17. \n
  18. \n
  19. \n
  20. \n
  21. Just one rectangle constructor/method - all handled with default parameters.\n\nYou can use named parameters too.\n
  22. use type switch for handling visitor patterns and similar type based &amp;#x2018;overloading&amp;#x2019;\n\n\n\n\n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n