Clojure and Android Daniel Solano Gmez Sattvik Software & T - - PowerPoint PPT Presentation

clojure and android
SMART_READER_LITE
LIVE PREVIEW

Clojure and Android Daniel Solano Gmez Sattvik Software & T - - PowerPoint PPT Presentation

Clojure and Android Daniel Solano Gmez Sattvik Software & T echnology Resources, Ltd. Co. Clojure/conj 2011 Clojure in Small Places Daniel Solano Gmez Sattvik Software & T echnology Resources, Ltd. Co. Clojure/conj 2011 Clojure


slide-1
SLIDE 1

Clojure and Android

Daniel Solano Gómez

Sattvik Software & T echnology Resources, Ltd. Co.

Clojure/conj 2011

slide-2
SLIDE 2

Clojure in Small Places

Daniel Solano Gómez

Sattvik Software & T echnology Resources, Ltd. Co.

Clojure/conj 2011

slide-3
SLIDE 3

Clojure to go

Daniel Solano Gómez

Sattvik Software & T echnology Resources, Ltd. Co.

Clojure/conj 2011

slide-4
SLIDE 4

Overview

Android and the Dalvik VM Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

slide-5
SLIDE 5

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Android and the Dalvik VM What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

slide-6
SLIDE 6

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

What is Android?

slide-7
SLIDE 7

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Android architecture

slide-8
SLIDE 8

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Android architecture

slide-9
SLIDE 9

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Android architecture

slide-10
SLIDE 10

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Android architecture

slide-11
SLIDE 11

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Android architecture

slide-12
SLIDE 12

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

The good news

slide-13
SLIDE 13

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

The bad news (= JavaVM DalvikVM) ; => false

slide-14
SLIDE 14

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

The bad news (= JavaVM DalvikVM) ; => false

slide-15
SLIDE 15

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Java VM vs. Dalvik VM

slide-16
SLIDE 16

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Java VM vs. Dalvik VM

Java VM Dalvik VM VM type stack-based register-based JIT type method trace Parallel GC? Yes Only Android 2.3+ Processing power Up to 2 1.2GHz Up to lots Max heap size 256MiB+ 16-48 MiB APIs Java SE Not quite Java SE Executable format class Dalvik EXecutable (DEX)

slide-17
SLIDE 17

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Java VM vs. Dalvik VM

Java VM Dalvik VM VM type stack-based register-based JIT type method trace Parallel GC? Yes Only Android 2.3+ Processing power Up to 2×1.2GHz Up to lots Max heap size 256MiB+ 16-48 MiB APIs Java SE Not quite Java SE Executable format class Dalvik EXecutable (DEX)

slide-18
SLIDE 18

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Java VM vs. Dalvik VM

Java VM Dalvik VM VM type stack-based register-based JIT type method trace Parallel GC? Yes Only Android 2.3+ Processing power Up to 2×1.2GHz Up to lots Max heap size 256MiB+ 16-48 MiB APIs Java SE Not quite Java SE Executable format class Dalvik EXecutable (DEX)

slide-19
SLIDE 19

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

A class file

Class file

slide-20
SLIDE 20

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

A class file

Class file

Header

slide-21
SLIDE 21

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

A class file

Class file

Header Constant pool

slide-22
SLIDE 22

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

A class file

Class file

Header Constant pool Other data/code

slide-23
SLIDE 23

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

An application

C.class A.class B.class B.class

slide-24
SLIDE 24

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

An application

App.jar

C.class A.class B.class B.class

slide-25
SLIDE 25

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

A problem

App.jar

C.class A.class B.class B.class

slide-26
SLIDE 26

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Creating a DEX

App.jar

C.class A.class B.class B.class

classes.dex

slide-27
SLIDE 27

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Creating a DEX

App.jar

C.class A.class B.class B.class

classes.dex

slide-28
SLIDE 28

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Creating a DEX

App.jar

C.class A.class B.class B.class

classes.dex

slide-29
SLIDE 29

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Creating a DEX

App.jar

C.class A.class B.class B.class

classes.dex

slide-30
SLIDE 30

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Creating a DEX

App.jar

C.class A.class B.class B.class

classes.dex

slide-31
SLIDE 31

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Creating a DEX

App.jar

C.class A.class B.class B.class

classes.dex

slide-32
SLIDE 32

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

An Android application

App.apk

classes.dex

slide-33
SLIDE 33

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Installing the application

App.apk

classes.dex

slide-34
SLIDE 34

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Installing the application

App.apk

classes.dex DEX

slide-35
SLIDE 35

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Installing the application

App.apk

classes.dex DEX ODEX

slide-36
SLIDE 36

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Installing the application

ODEX

slide-37
SLIDE 37

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Consequences

▶ Loading bytecode in Android is a

heavy-weight process.

▶ Dynamically loading bytecode is

not currently supported.

slide-38
SLIDE 38

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Android programming languages

Staticly (AOT) compiled

slide-39
SLIDE 39

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM

What is Android? Java VM vs. Dalvik VM Frome source to a running app What it all means

Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Android programming languages

Interpreted

slide-40
SLIDE 40

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation

Why? How? Implementation details

Performance Improving the Clojure/Android experience Closing thoughts

Android and the Dalvik VM Dynamic compilation Why? How? Implementation details Performance Improving the Clojure/Android experience Closing thoughts

slide-41
SLIDE 41

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation

Why? How? Implementation details

Performance Improving the Clojure/Android experience Closing thoughts

Dynamic compilation on Android

Why?

slide-42
SLIDE 42

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation

Why? How? Implementation details

Performance Improving the Clojure/Android experience Closing thoughts

Benefits of dynamic compilation

▶ Make the Clojure REPL possible ▶ Make Android development faster

and easier

slide-43
SLIDE 43

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation

Why? How? Implementation details

Performance Improving the Clojure/Android experience Closing thoughts

A review

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

slide-44
SLIDE 44

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation

Why? How? Implementation details

Performance Improving the Clojure/Android experience Closing thoughts

A review

name defn hello str "Hello, " name \!

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

slide-45
SLIDE 45

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation

Why? How? Implementation details

Performance Improving the Clojure/Android experience Closing thoughts

A review

name defn hello str "Hello, " name \!

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

Class

slide-46
SLIDE 46

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation

Why? How? Implementation details

Performance Improving the Clojure/Android experience Closing thoughts

What about Android?

name defn hello str "Hello, " name \!

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

Class

slide-47
SLIDE 47

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation

Why? How? Implementation details

Performance Improving the Clojure/Android experience Closing thoughts

What about Android?

name defn hello str "Hello, " name \!

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

ODEX

slide-48
SLIDE 48

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation

Why? How? Implementation details

Performance Improving the Clojure/Android experience Closing thoughts

What about Android?

name defn hello str "Hello, " name \!

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

ODEX

slide-49
SLIDE 49

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation

Why? How? Implementation details

Performance Improving the Clojure/Android experience Closing thoughts

A new class loader

URLClassLoader defineClass() DynamicClassLoader

slide-50
SLIDE 50

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation

Why? How? Implementation details

Performance Improving the Clojure/Android experience Closing thoughts

A new class loader

URLClassLoader defineClass() DynamicClassLoader defineMissingClass() JvmDynamicClassLoader DalvikDynamicClassLoader

slide-51
SLIDE 51

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation

Why? How? Implementation details

Performance Improving the Clojure/Android experience Closing thoughts

The Dalvik process

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

slide-52
SLIDE 52

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation

Why? How? Implementation details

Performance Improving the Clojure/Android experience Closing thoughts

The Dalvik process

name defn hello str "Hello, " name \!

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

slide-53
SLIDE 53

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation

Why? How? Implementation details

Performance Improving the Clojure/Android experience Closing thoughts

The Dalvik process

name defn hello str "Hello, " name \!

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

Class

slide-54
SLIDE 54

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation

Why? How? Implementation details

Performance Improving the Clojure/Android experience Closing thoughts

The Dalvik process

name defn hello str "Hello, " name \!

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

Class DEX

slide-55
SLIDE 55

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation

Why? How? Implementation details

Performance Improving the Clojure/Android experience Closing thoughts

The Dalvik process

name defn hello str "Hello, " name \!

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

Class APK DEX

slide-56
SLIDE 56

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation

Why? How? Implementation details

Performance Improving the Clojure/Android experience Closing thoughts

The Dalvik process

name defn hello str "Hello, " name \!

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

ODEX Class APK DEX

slide-57
SLIDE 57

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation

Why? How? Implementation details

Performance Improving the Clojure/Android experience Closing thoughts

Choosing the right DynamicClassLoader

▶ New var:

clojure.core/*vm-type*

▶ May be either :dalvik-vm or

:java-vm

▶ Setting depends on java.vm.name

system property

▶ Decision takes place in

RT.makeClassLoader()

slide-58
SLIDE 58

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation

Why? How? Implementation details

Performance Improving the Clojure/Android experience Closing thoughts

New dependency

▶ Relies on code from Android SDK

to perform class → DEX transformation

▶ Current process extracts code

from dx.jar

▶ A source-based dependency

would be better

▶ Source available under Apache

License 2.0

slide-59
SLIDE 59

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation

Why? How? Implementation details

Performance Improving the Clojure/Android experience Closing thoughts

Android compatibility

▶ Doesn’t work on versions earlier

than 2.1

▶ Contains workaround for bug 5697

(fixed in Android 2.2)

slide-60
SLIDE 60

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation

Why? How? Implementation details

Performance Improving the Clojure/Android experience Closing thoughts

Clojure compatibility

▶ All Dalvik-related code is loaded

reflectively

▶ Some complex macros may not

compile due to size limitations

▶ clojure.core/bean not available

due lack of java.beans API

slide-61
SLIDE 61

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation Performance

Benchmarks Analysis

Improving the Clojure/Android experience Closing thoughts

Android and the Dalvik VM Dynamic compilation Performance Benchmarks Analysis Improving the Clojure/Android experience Closing thoughts

slide-62
SLIDE 62

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation Performance

Benchmarks Analysis

Improving the Clojure/Android experience Closing thoughts

Benchmarking Clojure and the 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)

slide-63
SLIDE 63

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation Performance

Benchmarks Analysis

Improving the Clojure/Android experience Closing thoughts

Package size (MB)

slide-64
SLIDE 64

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation Performance

Benchmarks Analysis

Improving the Clojure/Android experience Closing thoughts

Installed size (MB)

slide-65
SLIDE 65

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation Performance

Benchmarks Analysis

Improving the Clojure/Android experience Closing thoughts

Startup time (s)

slide-66
SLIDE 66

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation Performance

Benchmarks Analysis

Improving the Clojure/Android experience Closing thoughts

Heap size (MB)

slide-67
SLIDE 67

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation Performance

Benchmarks Analysis

Improving the Clojure/Android experience Closing thoughts

Question

Where did all the time and space go?

slide-68
SLIDE 68

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation Performance

Benchmarks Analysis

Improving the Clojure/Android experience Closing thoughts

Answer

clojure.core

slide-69
SLIDE 69

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation Performance

Benchmarks Analysis

Improving the Clojure/Android experience Closing thoughts

T

  • p 10 space hogs

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

slide-70
SLIDE 70

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation Performance

Benchmarks Analysis

Improving the Clojure/Android experience Closing thoughts

Measuring time, a test

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

slide-71
SLIDE 71

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation Performance

Benchmarks Analysis

Improving the Clojure/Android experience Closing thoughts

T est results

Times are in milliseconds Iteration RT.var() Var.invoke() T

  • tal

1 0.240 0.397 7,856.773 2 0.299 0.345 0.686

slide-72
SLIDE 72

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation Performance

Benchmarks Analysis

Improving the Clojure/Android experience Closing thoughts

Where did 7.8 seconds go?

CPU time clojure.lang.RT.doInit()

95.8%

slide-73
SLIDE 73

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation Performance

Benchmarks Analysis

Improving the Clojure/Android experience Closing thoughts

Where did 7.8 seconds go?

CPU time RT.load("clojure/core")

83.2% 12.5%

(in-ns 'user) (refer 'clojure.core)

slide-74
SLIDE 74

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation Performance

Benchmarks Analysis

Improving the Clojure/Android experience Closing thoughts

Where did 7.8 seconds go?

Object churn

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

slide-75
SLIDE 75

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation Performance

Benchmarks Analysis

Improving the Clojure/Android experience Closing thoughts

Improving performance

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

slide-76
SLIDE 76

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Android and the Dalvik VM Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

slide-77
SLIDE 77

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Making Clojure a first-class language for Android development

▶ Improve performance ▶ Standard library ▶ Development tools

slide-78
SLIDE 78

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Neko: The Clojure/Android T

  • olkit

▶ Available from

github.com/sattvik/neko

▶ Ease object-oriented/functional

impedance mismatch

▶ Reduce boilerplate ▶ Integrate into Clojure-contrib?

slide-79
SLIDE 79

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Development tools

▶ Android development version of

Clojure

▶ Build tools ▶ REPL/dynamic development tools

slide-80
SLIDE 80

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Android development version of Clojure

▶ Available from

github.com/sattvik/clojure

▶ Needs:

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

▶ Merge upstream?

slide-81
SLIDE 81

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Build tools

▶ Neko provides some helper code

for Ant/Android SDK

▶ Would be nice to see support from

mainstream Clojure tools

slide-82
SLIDE 82

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

REPL/dynamic development tools

▶ Requires Android development

version of Clojure

▶ VimClojure works with some minor

modifications

▶ Would be good to see tools

compatible with nrepl, Emacs, etc.

slide-83
SLIDE 83

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Android and the Dalvik VM Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

slide-84
SLIDE 84

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Android and Clojure

slide-85
SLIDE 85

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Android and Clojure

▶ Clojure has the potential to be a

first-class language for Android development.

▶ Dynamic development on Android

is a killer feature.

▶ It needs better tool and

community support.

slide-86
SLIDE 86

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

What about ClojureScript?

▶ Should work for web apps ▶ Might work with mobile

development frameworks

▶ For native development,

constrained by availability of JavaScript engines

slide-87
SLIDE 87

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Decaffeinated Android

Developing on Android without Java

Daniel Solano Gómez

Decaffeinated Android

slide-88
SLIDE 88

Clojure and Android Daniel Solano Gómez Android and the Dalvik VM Dynamic compilation Performance Improving the Clojure/Android experience Closing thoughts

Questions?

Blog www.deepbluelambda.org T witter @deepbluelambda E-mail daniel@solanogomez.org Group groups.google.com/group/ clojure-android Clojure REPL for Android: