Clojure and Android - raw.githubusercontent.com · Clojureand Android DanielSolano Gómez...

88
Clojure and Android Daniel Solano Gómez Sattvik Software & Technology Resources, Ltd. Co. Clojure/conj 2011

Transcript of Clojure and Android - raw.githubusercontent.com · Clojureand Android DanielSolano Gómez...

Clojure and Android

Daniel Solano GómezSattvik Software & Technology Resources, Ltd. Co.

Clojure/conj 2011

Clojure in Small Places

Daniel Solano GómezSattvik Software & Technology Resources, Ltd. Co.

Clojure/conj 2011

Clojure to go

Daniel Solano GómezSattvik Software & Technology Resources, Ltd. Co.

Clojure/conj 2011

Overview

Android and the Dalvik VM

Dynamic compilation

Performance

Improving the Clojure/Android experience

Closing thoughts

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Android and the Dalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to a running appWhat it all means

Dynamic compilation

Performance

Improving the Clojure/Android experience

Closing thoughts

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

What is Android?

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Android architecture

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Android architecture

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Android architecture

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Android architecture

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Android architecture

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

The good news

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

The bad news

(= JavaVM DalvikVM)

; => false

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

The bad news

(= JavaVM DalvikVM); => false

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Java VM vs. Dalvik VM

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Java VM vs. Dalvik VM

Java VM Dalvik VM

VM type stack-based register-basedJIT type method traceParallel GC? Yes Only Android 2.3+

Processing power Up to 2×1.2GHz Up to lotsMax heap size 256MiB+ 16-48 MiB

APIs Java SE Not quite Java SEExecutable format class Dalvik EXecutable (DEX)

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Java VM vs. Dalvik VM

Java VM Dalvik VM

VM type stack-based register-basedJIT type method traceParallel GC? Yes Only Android 2.3+

Processing power Up to 2×1.2GHz Up to lotsMax heap size 256MiB+ 16-48 MiB

APIs Java SE Not quite Java SEExecutable format class Dalvik EXecutable (DEX)

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Java VM vs. Dalvik VM

Java VM Dalvik VM

VM type stack-based register-basedJIT type method traceParallel GC? Yes Only Android 2.3+

Processing power Up to 2×1.2GHz Up to lotsMax heap size 256MiB+ 16-48 MiB

APIs Java SE Not quite Java SEExecutable format class Dalvik EXecutable (DEX)

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

A class file

Class file

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

A class file

Class file

Header

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

A class file

Class file

Header

Constant pool

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

A class file

Class file

Header

Constant pool

Other data/code

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

An application

C.classA.class B.classB.class

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

An application

App.jar

C.classA.class B.classB.class

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

A problem

App.jar

C.classA.class B.classB.class

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Creating a DEX

App.jar

C.classA.class B.classB.class

classes.dex

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Creating a DEX

App.jar

C.classA.class B.classB.class

classes.dex

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Creating a DEX

App.jar

C.classA.class B.classB.class

classes.dex

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Creating a DEX

App.jar

C.classA.class B.classB.class

classes.dex

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Creating a DEX

App.jar

C.classA.class B.classB.class

classes.dex

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Creating a DEX

App.jar

C.classA.class B.classB.class

classes.dex

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

An Android application

App.apk

classes.dex

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Installing the application

App.apk

classes.dex

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Installing the application

App.apk

classes.dex

DEX

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Installing the application

App.apk

classes.dex

DEX ODEX

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Installing the application

ODEX

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Consequences

▶ Loading bytecode in Android is aheavy-weight process.

▶ Dynamically loading bytecode isnot currently supported.

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Android programminglanguagesStaticly (AOT) compiled

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VMWhat is Android?Java VM vs. Dalvik VMFrome source to arunning appWhat it all means

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Android programminglanguagesInterpreted

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

DynamiccompilationWhy?How?Implementation details

Performance

Improving theClojure/Androidexperience

Closing thoughts

Android and the Dalvik VM

Dynamic compilationWhy?How?Implementation details

Performance

Improving the Clojure/Android experience

Closing thoughts

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

DynamiccompilationWhy?How?Implementation details

Performance

Improving theClojure/Androidexperience

Closing thoughts

Dynamic compilation onAndroid

Why?

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

DynamiccompilationWhy?How?Implementation details

Performance

Improving theClojure/Androidexperience

Closing thoughts

Benefits of dynamiccompilation

▶ Make the Clojure REPL possible▶ Make Android development fasterand easier

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

DynamiccompilationWhy?How?Implementation details

Performance

Improving theClojure/Androidexperience

Closing thoughts

A review(defn hello [name] (str "Hello, " name \!))

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

DynamiccompilationWhy?How?Implementation details

Performance

Improving theClojure/Androidexperience

Closing thoughts

A review

name

defn hello

str "Hello, " name \!

(defn hello [name] (str "Hello, " name \!))

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

DynamiccompilationWhy?How?Implementation details

Performance

Improving theClojure/Androidexperience

Closing thoughts

A review

name

defn hello

str "Hello, " name \!

(defn hello [name] (str "Hello, " name \!))

Class

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

DynamiccompilationWhy?How?Implementation details

Performance

Improving theClojure/Androidexperience

Closing thoughts

What about Android?

name

defn hello

str "Hello, " name \!

(defn hello [name] (str "Hello, " name \!))

Class

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

DynamiccompilationWhy?How?Implementation details

Performance

Improving theClojure/Androidexperience

Closing thoughts

What about Android?

name

defn hello

str "Hello, " name \!

(defn hello [name] (str "Hello, " name \!))

ODEX

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

DynamiccompilationWhy?How?Implementation details

Performance

Improving theClojure/Androidexperience

Closing thoughts

What about Android?

name

defn hello

str "Hello, " name \!

(defn hello [name] (str "Hello, " name \!))

ODEX

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

DynamiccompilationWhy?How?Implementation details

Performance

Improving theClojure/Androidexperience

Closing thoughts

A new class loader

URLClassLoader

defineClass()

DynamicClassLoader

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

DynamiccompilationWhy?How?Implementation details

Performance

Improving theClojure/Androidexperience

Closing thoughts

A new class loader

URLClassLoader

defineClass()

DynamicClassLoader

defineMissingClass()

JvmDynamicClassLoader DalvikDynamicClassLoader

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

DynamiccompilationWhy?How?Implementation details

Performance

Improving theClojure/Androidexperience

Closing thoughts

The Dalvik process

(defn hello [name] (str "Hello, " name \!))

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

DynamiccompilationWhy?How?Implementation details

Performance

Improving theClojure/Androidexperience

Closing thoughts

The Dalvik process

name

defn hello

str "Hello, " name \!

(defn hello [name] (str "Hello, " name \!))

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

DynamiccompilationWhy?How?Implementation details

Performance

Improving theClojure/Androidexperience

Closing thoughts

The Dalvik process

name

defn hello

str "Hello, " name \!

(defn hello [name] (str "Hello, " name \!))

Class

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

DynamiccompilationWhy?How?Implementation details

Performance

Improving theClojure/Androidexperience

Closing thoughts

The Dalvik process

name

defn hello

str "Hello, " name \!

(defn hello [name] (str "Hello, " name \!))

ClassDEX

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

DynamiccompilationWhy?How?Implementation details

Performance

Improving theClojure/Androidexperience

Closing thoughts

The Dalvik process

name

defn hello

str "Hello, " name \!

(defn hello [name] (str "Hello, " name \!))

ClassAPK DEX

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

DynamiccompilationWhy?How?Implementation details

Performance

Improving theClojure/Androidexperience

Closing thoughts

The Dalvik process

name

defn hello

str "Hello, " name \!

(defn hello [name] (str "Hello, " name \!))

ODEX ClassAPK DEX

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

DynamiccompilationWhy?How?Implementation details

Performance

Improving theClojure/Androidexperience

Closing thoughts

Choosing the rightDynamicClassLoader

▶ New var:clojure.core/*vm-type*

▶ May be either :dalvik-vm or:java-vm

▶ Setting depends on java.vm.namesystem property

▶ Decision takes place inRT.makeClassLoader()

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

DynamiccompilationWhy?How?Implementation details

Performance

Improving theClojure/Androidexperience

Closing thoughts

New dependency

▶ Relies on code from Android SDKto perform class → DEXtransformation

▶ Current process extracts codefrom dx.jar

▶ A source-based dependencywould be better

▶ Source available under ApacheLicense 2.0

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

DynamiccompilationWhy?How?Implementation details

Performance

Improving theClojure/Androidexperience

Closing thoughts

Android compatibility

▶ Doesn’t work on versions earlierthan 2.1

▶ Contains workaround for bug 5697(fixed in Android 2.2)

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

DynamiccompilationWhy?How?Implementation details

Performance

Improving theClojure/Androidexperience

Closing thoughts

Clojure compatibility

▶ All Dalvik-related code is loadedreflectively

▶ Some complex macros may notcompile due to size limitations

▶ clojure.core/bean not availabledue lack of java.beans API

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

Dynamiccompilation

PerformanceBenchmarksAnalysis

Improving theClojure/Androidexperience

Closing thoughts

Android and the Dalvik VM

Dynamic compilation

PerformanceBenchmarksAnalysis

Improving the Clojure/Android experience

Closing thoughts

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

Dynamiccompilation

PerformanceBenchmarksAnalysis

Improving theClojure/Androidexperience

Closing thoughts

Benchmarking Clojure andthe competition

▶ Clojure 1.2.1 (Android version)▶ Clojure 1.3 (unmodified)▶ Java▶ Scala (Scala 2.9.1)▶ Ruby (JRuby 1.6.5,ruboto-core-0.5.1)

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

Dynamiccompilation

PerformanceBenchmarksAnalysis

Improving theClojure/Androidexperience

Closing thoughts

Package size (MB)

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

Dynamiccompilation

PerformanceBenchmarksAnalysis

Improving theClojure/Androidexperience

Closing thoughts

Installed size (MB)

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

Dynamiccompilation

PerformanceBenchmarksAnalysis

Improving theClojure/Androidexperience

Closing thoughts

Startup time (s)

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

Dynamiccompilation

PerformanceBenchmarksAnalysis

Improving theClojure/Androidexperience

Closing thoughts

Heap size (MB)

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

Dynamiccompilation

PerformanceBenchmarksAnalysis

Improving theClojure/Androidexperience

Closing thoughts

Question

Where did all thetime and spacego?

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

Dynamiccompilation

PerformanceBenchmarksAnalysis

Improving theClojure/Androidexperience

Closing thoughts

Answer

clojure.core

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

Dynamiccompilation

PerformanceBenchmarksAnalysis

Improving theClojure/Androidexperience

Closing thoughts

Top 10 space hogsBy retained heap in bytes

clojure.core/*out* 8,608Class clojure.java.io.__init 12,784Class clojure.lang.Compiler 13,152Class clojure.deftype__init 14,024clojure.core/*in* 25,056clojure.core.protocols namespace 25,584Class clojure.lang.Namespace 26,480clojure.java.io namespace 31,488clojure.core namespace 34,992Class clojure.core__init 203,616

TOTAL 395,784

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

Dynamiccompilation

PerformanceBenchmarksAnalysis

Improving theClojure/Androidexperience

Closing thoughts

Measuring time, a test

// equivalent to (+ 1 2 3)RT.var(”clojure.core”,”+”)

.invoke(1,2,3);

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

Dynamiccompilation

PerformanceBenchmarksAnalysis

Improving theClojure/Androidexperience

Closing thoughts

Test resultsTimes are in milliseconds

Iteration RT.var() Var.invoke() Total

1 0.240 0.397 7,856.7732 0.299 0.345 0.686

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

Dynamiccompilation

PerformanceBenchmarksAnalysis

Improving theClojure/Androidexperience

Closing thoughts

Where did 7.8 seconds go?CPU time

clojure.lang.RT.doInit()

95.8%

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

Dynamiccompilation

PerformanceBenchmarksAnalysis

Improving theClojure/Androidexperience

Closing thoughts

Where did 7.8 seconds go?CPU time

RT.load("clojure/core")

83.2%

12.5%

(in-ns 'user)

(refer 'clojure.core)

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

Dynamiccompilation

PerformanceBenchmarksAnalysis

Improving theClojure/Androidexperience

Closing thoughts

Where did 7.8 seconds go?Object churn

Count Size (MiB)Allocated 128,280 4.65Freed 91,259 3.63Net 37,021 1.02

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

Dynamiccompilation

PerformanceBenchmarksAnalysis

Improving theClojure/Androidexperience

Closing thoughts

Improving performance

▶ Remove user namespace▶ Remove metadata▶ Transients during initialization▶ Serializable clojure.core▶ Source-level tree shaker

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Android and the Dalvik VM

Dynamic compilation

Performance

Improving the Clojure/Android experience

Closing thoughts

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Making Clojure a first-classlanguage for Androiddevelopment

▶ Improve performance▶ Standard library▶ Development tools

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Neko: The Clojure/AndroidToolkit

▶ Available fromgithub.com/sattvik/neko

▶ Ease object-oriented/functionalimpedance mismatch

▶ Reduce boilerplate▶ Integrate into Clojure-contrib?

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Development tools

▶ Android development version ofClojure

▶ Build tools▶ REPL/dynamic development tools

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Android developmentversion of Clojure

▶ Available fromgithub.com/sattvik/clojure

▶ Needs:▶ Upgrade to Clojure 1.3▶ Better handling of dx tool integration

▶ Merge upstream?

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Build tools

▶ Neko provides some helper codefor Ant/Android SDK

▶ Would be nice to see support frommainstream Clojure tools

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

REPL/dynamicdevelopment tools

▶ Requires Android developmentversion of Clojure

▶ VimClojure works with some minormodifications

▶ Would be good to see toolscompatible with nrepl, Emacs, etc.

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Android and the Dalvik VM

Dynamic compilation

Performance

Improving the Clojure/Android experience

Closing thoughts

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Android and Clojure

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Android and Clojure

▶ Clojure has the potential to be afirst-class language for Androiddevelopment.

▶ Dynamic development on Androidis a killer feature.

▶ It needs better tool andcommunity support.

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

What about ClojureScript?

▶ Should work for web apps▶ Might work with mobiledevelopment frameworks

▶ For native development,constrained by availability ofJavaScript engines

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Decaffeinated AndroidDeveloping on Android without Java

Daniel Solano Gómez

Decaffeinated Android

Clojure andAndroid

Daniel SolanoGómez

Android and theDalvik VM

Dynamiccompilation

Performance

Improving theClojure/Androidexperience

Closing thoughts

Questions?Blog www.deepbluelambda.org

Twitter @deepbluelambdaE-mail [email protected] groups.google.com/group/

clojure-androidClojure REPL for Android: