clojure intro

19
Clojure Intro Misha Kozik @mishadoff

Upload: misha-kozik

Post on 10-May-2015

774 views

Category:

Technology


0 download

DESCRIPTION

Brief Introduction to Clojure

TRANSCRIPT

Page 1: Clojure Intro

Clojure Intro

Misha Kozik@mishadoff

Page 2: Clojure Intro

Yet Another JVM Language?

Page 3: Clojure Intro

Rationale

A Lisp for Functional Programming symbiotic with an Established Platform designed for Concurrency

                       ­ Rich Hickey

Page 4: Clojure Intro

Clojure Philosophy

Page 5: Clojure Intro

Clojure Philosophy

Page 6: Clojure Intro

Lots of Irritating Stupid Parentheses

(defn concat [xs ys]  (if (empty? xs) ys      (let [[h & t] xs]        (cons h (concat t ys)))))

Page 7: Clojure Intro

LISt Processing

(defn concat [xs ys]  (if (empty? xs) ys      (let [[h & t] xs]        (cons h (concat t ys)))))

Page 8: Clojure Intro

LISt Processing

(defn concat [xs ys]  (if (empty? xs) ys      (let [[h & t] xs]        (cons h (concat t ys)))))

Page 9: Clojure Intro

LISt Processing

(defn concat [xs ys]  (if (empty? xs) ys      (let [[h & t] xs]        (cons h (concat t ys)))))

Page 10: Clojure Intro

(+ (* 2 5)     (/ 1 7))

 Prefix notation

  Do you speak it?

Page 11: Clojure Intro

Syntax

Code Mode:

Data Mode:

Special Mode:

'(1 2 3 4)

(+ 1 2 3 4)

 (def a 42)

Page 12: Clojure Intro

Quick Tour● Value● Function● Scope● List● Vector● Map● Set● Functional Features● Automatic Promotion● Destructuring● Loop/Recur● Time● Memoization● Lazy Sequences

● Threading macro● Meta● IO● Regexps● Record● Protocol● Type Hints● Multimethods● Exceptions● Macro● Concurrency● Java­>Clojure● Clojure­>Java● Bonus!

Page 14: Clojure Intro

IDE

Page 15: Clojure Intro

IDE

VimClojure

LightTable

Counter Clockwise

Enclojure

La Clojure

Page 16: Clojure Intro

Infrastructure

●Leiningen, Clojars●Ring, Compojure, Enlive●ClojureScript●Pedestal●Seesaw●Datomic, Korma, Carmine, Monger●Overtone, Incanter●core.logic, core.match, core.async●AppEngine, Heroku●Write your own wrapper!

Page 18: Clojure Intro

Books

Page 19: Clojure Intro

Q?