Slide 1

Slide 1 text

4/16/2014 Clojure From A JVM Dev Perspective file:///Users/p_brc/src/clojure-via-java/presentation/index.html 1/10 Why Would You Want To Go From Java To Clojure? 1. Simpler, more elegant • Focus on the problem you are trying to solve not the ceremony around your implementation language 2. Dynamic, but good performance 3. Powerful extensibility 4. FP and concurrency features 1

Slide 2

Slide 2 text

4/16/2014 Clojure From A JVM Dev Perspective file:///Users/p_brc/src/clojure-via-java/presentation/index.html 2/10 What I Am Going To Show You Today 1. Entry points to get started with Clojure 2. Basic syntax for people coming from a C-style language 2

Slide 3

Slide 3 text

4/16/2014 Clojure From A JVM Dev Perspective file:///Users/p_brc/src/clojure-via-java/presentation/index.html 3/10 To Get a First Taste of Clojure 1. There are multiple web-based offerings • http://tryclj.com/ • http://clojurescriptkoans.com/ 2. No installation, no hassle 3. Get to know the basics 3

Slide 4

Slide 4 text

4/16/2014 Clojure From A JVM Dev Perspective file:///Users/p_brc/src/clojure-via-java/presentation/index.html 4/10 http://clojurescriptkoans.com

Slide 5

Slide 5 text

4/16/2014 Clojure From A JVM Dev Perspective file:///Users/p_brc/src/clojure-via-java/presentation/index.html 5/10 If You Want To Install It On Your Machine 1. You need Java. I assume you've got that already 2. Leiningen is the easiest way to get started 3. lein new your-new-app 5

Slide 6

Slide 6 text

4/16/2014 Clojure From A JVM Dev Perspective file:///Users/p_brc/src/clojure-via-java/presentation/index.html 6/10 http://leiningen.org/

Slide 7

Slide 7 text

4/16/2014 Clojure From A JVM Dev Perspective file:///Users/p_brc/src/clojure-via-java/presentation/index.html 7/10 http://dev.clojure.org

Slide 8

Slide 8 text

4/16/2014 Clojure From A JVM Dev Perspective file:///Users/p_brc/src/clojure-via-java/presentation/index.html 8/10 Let's look at some code

Slide 9

Slide 9 text

4/16/2014 Clojure From A JVM Dev Perspective file:///Users/p_brc/src/clojure-via-java/presentation/index.html 9/10 Java Clojure int i = 5 (def i 5) if(x == 0) return y else return z (cond (zero? x) y z) x * y * z (* x y z) foo(x, y, z) (foo x y z) foo.bar(x) (. foo bar x) 9

Slide 10

Slide 10 text

4/16/2014 Clojure From A JVM Dev Perspective file:///Users/p_brc/src/clojure-via-java/presentation/index.html 10/10 Sources: • Rich Hickey: Clojure. An Introduction for Java Programmers. (YouTube) • Michael Fogus/Chris Houser: The Joy of Clojure. Manning 2014 (MEAP) • Luke VanderHart, Ryan Neufeld: Clojure Cookbook. O'Reilly 2014 10