- Started in 2007
- Created by Rich Hickey
- Under Eclipse Public License
TAKING NOTES.
Slide 9
Slide 9 text
“ Clojure is a dialect of Lisp, and shares with
Lisp the code-as-data philosophy and a
powerful macro system. Clojure is predominantly
a functional programming language ”
TAKING NOTES.
Slide 10
Slide 10 text
FUNCIONAL PARADIGM?
Slide 11
Slide 11 text
Back to the Past.
Slide 12
Slide 12 text
λ - 1930
The Lambda Calculus Appears
Back to the Past.
Slide 13
Slide 13 text
Lisp - 1958
Introduced a programming language able
to deal with mathematical notation
Back to the Past.
Slide 14
Slide 14 text
Lisp - 1958
Introduced a programming language able
to deal with mathematical notation
* IPL (Information Processing Language) is sometimes cited as the first
computer-based functional programming language. First appeared in 1956.
Back to the Past.
Slide 15
Slide 15 text
“Can Programming Be Liberated
from the von Neumann Style?” - 1978
John Backus (FORTRAN creator) criticizes hardware architecture
based on von Neuman model.
Back to the Past.
Slide 16
Slide 16 text
The Boom- 1980
Innovative techniques have been proposed, such as: Lazy Evaluation
Emergence of other languages such as: Lazy ML, Orwell, Alfl, Id,
Clean, Ponder e Daisy
Back to the Past.
Slide 17
Slide 17 text
Definitions
Slide 18
Slide 18 text
Treats computation as the evaluation of mathematical
functions and avoids changing-state and mutable data.
Collections (all of them are immutable)
- Lists ( '(1 2 3 4) )
- sequential and counted, not associative
- first and rest
- Vector ( [ 1 2 101 85 ] )
- sequential, counted and associative
- access by key
Slide 29
Slide 29 text
Collections (all of them are immutable)
- Maps ( { “raphael” 20, “richard" 25, “chuck” 99 } )
- counted and associative, not sequential
- access by key
- Sets ( #{“hugo” “raphael” “vianna”} )
- counted, not sequential, not associative
- lookup for containment
Slide 30
Slide 30 text
Clojure REPL
Slide 31
Slide 31 text
There’s NO interpreter
Slide 32
Slide 32 text
"Laziness is a virtue"
Slide 33
Slide 33 text
"Laziness is a virtue"
Slide 34
Slide 34 text
Clojure Concurrency?
Slide 35
Slide 35 text
Clojure Concurrency
Slide 36
Slide 36 text
Clojure Concurrency
Slide 37
Slide 37 text
Today…
To avoid Deadlocks:
Slide 38
Slide 38 text
Timeout and Retry?
Specific Lock Order?
Coarse Locks?
Slide 39
Slide 39 text
“ Locks are the Enemy ”
Slide 40
Slide 40 text
STM
Software Transactional Memory
Slide 41
Slide 41 text
NO BLOCKING
Slide 42
Slide 42 text
NO LOCKS
Slide 43
Slide 43 text
PERSISTENT COLLECTIONS
Slide 44
Slide 44 text
Clojure IS much more…
Slide 45
Slide 45 text
• Clojure:Functional Concurrency for the JVM - Howard M. Lewis Ship
• Clojure: A dynamic programming language for the JVM - Rich Hickey
• Intro to Clojure by Balint Erdi ( https://speakerdeck.com/balint/intro-
to-clojure )
• Clojure Intro ( http://www.slideshare.net/thnetos/clojure-intro )
• Introduction to Clojure by Renzo Borgatti ( http://pt.slideshare.net/
reborg/introduction-to-clojure-13679039 )
References