SlideShare a Scribd company logo
Developing Android
applications with
Ceylon
Enrique Zamudio
@chochosmx
github.com/chochos
@ceylonlang
#CeylonLang
• Programming since 1982
• Professionally since 1994
• Java since 2000
• FOSS projects:
• j8583
• jAlarms
• Ceylon
• Java Champion 2015
Why Ceylon?
• Many Android devs are not too keen on Java
• Some don't even consider it to be a "real" Java
• Type system is somewhat limited
• Lots of anonymous classes throughout
codebase
Ceylon advantages
• Functions are first-class citizens
• Higher-order functions
• Union and intersection types
• Easier to manage generics
• No checked exceptions
• More typesafe (typesafer?) than Java
• Typesafe null, bounded generics
User|LoginError login(
String username,
String password);
String password);
String password);
Union type
if (is User r = login(u,p)) {
//it's a user
print(r.username);
} else {
//it's an error
print(r.reason);
}
}
}
}
}
}
Object obj = ...;
if (obj instanceof Foo) {
print(((Foo)obj).foo);
}
}
}
}
Object obj = ...;
if (obj instanceof Foo) {
print(((Bar)obj).bar);
}
}
}
}
Serializing
Runnables
void send(??? task) {
//send task over the wire
//is run on the other side
}
}
}
}
interface MyTask
extends Runnable,
Serializable {}
Serializable {}
Serializable {}
void send(MyTask task) {
//send task over the wire
//is run on the other side
}
}
}
}
class WeirdlyNamedApacheTask
implements Runnable,
Serializable {
...
}
}
}
}
}
class CumbersomeWrapper
implements MyTask {
final WeirdlyNamedApacheTask
wrappedTask;
}
}
}
}
}
void send(
Runnable & Serializable task) {
//send task over the wire
//is run on the other side
}
}
}
}
}
void send(
Runnable & Serializable task) {
//send task over the wire
//is run on the other side
}
}
}
}
}
Intersection type
null
ObjectObjectObjectObject
ObjectObjectObjectObject NullNullNullNull
ObjectObjectObjectObject NullNullNullNull
AnythingAnythingAnythingAnything
ObjectObjectObjectObject NullNullNullNull
AnythingAnythingAnythingAnything
StringStringStringString NumberNumberNumberNumber
ObjectObjectObjectObject NullNullNullNull
AnythingAnythingAnythingAnything
StringStringStringString NumberNumberNumberNumber nullnullnullnull
String s = null;
Integer s = null;
Null n = null;
Null n = null;
Null n = null;
String s = null;
Integer s = null;
Null n = null;
Null n = null;
Null n = null;
✘
String | Integer
String | Null
String | Null
String | Null
String|Integer a = 1;
String|Integer b = "one";
String|Null s1 = "s";
String|Null s2 = null;
;
;
;
;
String|Integer a = 1;
String|Integer b = "one";
String? s1 = "s";
String? s2 = null;
;
;
;
;
String? s = foo();
print(s.size); //WON'T COMPILE
if (exists s) {
...
}
}
}
}
}
ObjectObjectObjectObject NullNullNullNull
AnythingAnythingAnythingAnything
StringStringStringString NumberNumberNumberNumber nullnullnullnull
Algebraic
(enumerated) types
(enumerated) types
of Object|Null
class Null of null
object null extends Null
Null
Null
Null
Null
class Boolean
of true|false
class Comparison
of larger|smaller|equal
larger|smaller|equal
larger|smaller|equal
larger|smaller|equal
larger|smaller|equal
ObjectObjectObjectObject NullNullNullNull
AnythingAnythingAnythingAnything
StringStringStringString NumberNumberNumberNumber nullnullnullnull
Bottom type
ObjectObjectObjectObject NullNullNullNull
AnythingAnythingAnythingAnything
NothingNothingNothingNothing
NumberNumberNumberNumberStringStringStringString nullnullnullnull
Iterable<String,Nothing>
Object & Null
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Demo time!
Code dive
¿?
try.ceylon-lang.org
github.com/ceylon
@ceylonlang
enrique@ceylon-lang.org
@chochosmx
gitter.im/ceylon

More Related Content

PPTX
TypeScript Modules
PPTX
TypeScript
PDF
A Type-level Ruby Interpreter for Testing and Understanding
PPTX
JavaScript Beyond jQuery
PPTX
study of java
PPTX
Java object
PDF
WDB005.1 - JavaScript for Java Developers (Lecture 1)
PDF
"Scala in Goozy", Alexey Zlobin
TypeScript Modules
TypeScript
A Type-level Ruby Interpreter for Testing and Understanding
JavaScript Beyond jQuery
study of java
Java object
WDB005.1 - JavaScript for Java Developers (Lecture 1)
"Scala in Goozy", Alexey Zlobin

What's hot (20)

PPTX
Introduction to f#
PPTX
I18nize Scala programs à la gettext
PDF
A Deep Dive into Javascript
ODP
JavaScript global object, execution contexts & closures
PPTX
PDF
Akka actorstotherescue nirmalya sengupta
PPT
Introduction to java programming
PPT
JavaScript iteration
PDF
New c sharp4_features_part_v
ODP
JavaScript Object Oriented Programming Cheat Sheet
PDF
Java Serialization Deep Dive
PDF
A Static Type Analyzer of Untyped Ruby Code for Ruby 3
PDF
Real-World Scala Design Patterns
PDF
JavaScript: Patterns, Part 3
PPTX
Children of Ruby
PPTX
AngularConf2015
PPTX
Beginning Java for .NET developers
PDF
Javascript for Intermediates
PDF
Lock-free algorithms for Kotlin Coroutines
PPSX
JAVA VIRTUAL MACHINE
Introduction to f#
I18nize Scala programs à la gettext
A Deep Dive into Javascript
JavaScript global object, execution contexts & closures
Akka actorstotherescue nirmalya sengupta
Introduction to java programming
JavaScript iteration
New c sharp4_features_part_v
JavaScript Object Oriented Programming Cheat Sheet
Java Serialization Deep Dive
A Static Type Analyzer of Untyped Ruby Code for Ruby 3
Real-World Scala Design Patterns
JavaScript: Patterns, Part 3
Children of Ruby
AngularConf2015
Beginning Java for .NET developers
Javascript for Intermediates
Lock-free algorithms for Kotlin Coroutines
JAVA VIRTUAL MACHINE
Ad

Viewers also liked (20)

PPTX
Highway failure & their maintenance ppt
PPTX
Inclusión educativa
PPTX
La religion
PPTX
Accidentes de trabajo causas, efectos y prevencion
PPTX
Mapa mental gerencia industrial (lesbia)
PPTX
AgileDays 2017: Особенности фасилитации больших команд
DOC
Lo1 workbook
DOCX
PPTX
La narración y sus partes
DOCX
Lo2 workbook
DOCX
Lo3 workbook
PPTX
Känsla av sammanhang och mening genom att leva i treenighetens kärleksflöde
PPTX
Generics and Lambda survival guide - DevNexus 2017
PDF
Practical tipsmakemobilefaster oscon2016
PDF
Reaching the lambda heaven
PDF
Java Puzzlers NG S02: Down the Rabbit Hole as presented at DevNexus 2017
PDF
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at DevNexus 2017
PDF
Agile Metrics : Velocity is NOT the Goal - NDC Oslo 2014
PDF
Post-Modern CSS: Start learning CSS Grid, Flexbox and other new properties
PPTX
Intro to Microsoft Cognitive Services
Highway failure & their maintenance ppt
Inclusión educativa
La religion
Accidentes de trabajo causas, efectos y prevencion
Mapa mental gerencia industrial (lesbia)
AgileDays 2017: Особенности фасилитации больших команд
Lo1 workbook
La narración y sus partes
Lo2 workbook
Lo3 workbook
Känsla av sammanhang och mening genom att leva i treenighetens kärleksflöde
Generics and Lambda survival guide - DevNexus 2017
Practical tipsmakemobilefaster oscon2016
Reaching the lambda heaven
Java Puzzlers NG S02: Down the Rabbit Hole as presented at DevNexus 2017
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at DevNexus 2017
Agile Metrics : Velocity is NOT the Goal - NDC Oslo 2014
Post-Modern CSS: Start learning CSS Grid, Flexbox and other new properties
Intro to Microsoft Cognitive Services
Ad

Similar to Developing Android applications with Ceylon (20)

KEY
Ceylon - the language and its tools
PDF
Abstracting over Execution with Higher Kinded Types
PDF
Mixing Source and Bytecode: A Case for Compilation By Normalization (OOPSLA 2...
PDF
Ceylon SDK by Stéphane Épardaud
PDF
06_Overloading_Overriding_this_super.pdf
PDF
Ceylon/Java interop by Tako Schotanus
PPTX
Lecture38
KEY
Charles nutter star techconf 2011 - jvm languages
PPTX
Kotlin Language Features - A Java comparison
PDF
Programming with Millions of Examples (HRL)
PDF
How to create a programming language
PDF
Scala at HUJI PL Seminar 2008
PPTX
JVM languages "flame wars"
PDF
7li7w devcon5
PDF
What I learned from Seven Languages in Seven Weeks (IPRUG)
PDF
Kotlin @ Devoxx 2011
PDF
Kotlin Slides from Devoxx 2011
PDF
Crystal presentation in NY
PDF
scala reloaded
Ceylon - the language and its tools
Abstracting over Execution with Higher Kinded Types
Mixing Source and Bytecode: A Case for Compilation By Normalization (OOPSLA 2...
Ceylon SDK by Stéphane Épardaud
06_Overloading_Overriding_this_super.pdf
Ceylon/Java interop by Tako Schotanus
Lecture38
Charles nutter star techconf 2011 - jvm languages
Kotlin Language Features - A Java comparison
Programming with Millions of Examples (HRL)
How to create a programming language
Scala at HUJI PL Seminar 2008
JVM languages "flame wars"
7li7w devcon5
What I learned from Seven Languages in Seven Weeks (IPRUG)
Kotlin @ Devoxx 2011
Kotlin Slides from Devoxx 2011
Crystal presentation in NY
scala reloaded

More from Enrique Zamudio López (8)

PDF
Bulletproofing your foot for Kotlin
PPTX
Introducción a Protocol Buffers
PDF
Sistemas de tipos: Lo bueno, lo malo y lo feo
PPT
Criptografía para simples mortales
PDF
Diseño de compiladores: Un vistazo a Ceylon-JS
ODP
Introducción a Ceylon
ODP
PCJ Sesión 9: Threads
ODP
Introducción a jAlarms
Bulletproofing your foot for Kotlin
Introducción a Protocol Buffers
Sistemas de tipos: Lo bueno, lo malo y lo feo
Criptografía para simples mortales
Diseño de compiladores: Un vistazo a Ceylon-JS
Introducción a Ceylon
PCJ Sesión 9: Threads
Introducción a jAlarms

Recently uploaded (20)

PDF
KodekX | Application Modernization Development
PPTX
Spectroscopy.pptx food analysis technology
PDF
Machine learning based COVID-19 study performance prediction
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Electronic commerce courselecture one. Pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Encapsulation theory and applications.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
KodekX | Application Modernization Development
Spectroscopy.pptx food analysis technology
Machine learning based COVID-19 study performance prediction
Network Security Unit 5.pdf for BCA BBA.
NewMind AI Weekly Chronicles - August'25 Week I
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Reach Out and Touch Someone: Haptics and Empathic Computing
The AUB Centre for AI in Media Proposal.docx
Mobile App Security Testing_ A Comprehensive Guide.pdf
Big Data Technologies - Introduction.pptx
Electronic commerce courselecture one. Pdf
Understanding_Digital_Forensics_Presentation.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
20250228 LYD VKU AI Blended-Learning.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Per capita expenditure prediction using model stacking based on satellite ima...
Encapsulation theory and applications.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows

Developing Android applications with Ceylon