Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Joy of Clojure
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
John Biesnecker
March 02, 2012
Programming
610
4
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Joy of Clojure
A very brief introduction to Clojure delivered at Barcamp Shanghai on March 3, 2012.
John Biesnecker
March 02, 2012
More Decks by John Biesnecker
See All by John Biesnecker
Product Design for Chimps
biesnecker
0
140
Other Decks in Programming
See All in Programming
作って学ぶSpring BootのAuto Configuration / JJUG Night Seminar 2026-10-19
rshindo
0
220
Railsバージョンを4倍にした話
optim
0
920
Getting Started with Vibe Coding
miccheng
0
180
オーケストレーション記述言語 Katari
yukikurage
0
220
Kotlinの15年とServer-Side Kotlin
n_takehata
1
190
TS 7.0 で baseUrl が使えなくなった今、パスエイリアスをどうするか
bicstone
2
460
React Native経験者が Flutterを30⽇間触って驚いたこと
3saito
0
140
高橋メソッドでCVE解説シリーズ 〜CVE-2026-112816〜
hakkadaikon
0
200
Lambda durable functionsでHuman in the Loopを楽に…楽に……
har1101
2
260
선언형 햅틱 라이브러리 진동을 소개합니다
l2hyunwoo
1
280
社内AIエージェント「Askワンバン」における コストチューニングの取り組み
t0yohei
0
150
느린 네트워크와 저사양 디바이스 사용자를 위한 웹뷰 로딩 시간 개선기
kmkim
1
170
Featured
See All Featured
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.7k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.2k
The browser strikes back
jonoalderson
0
1.9k
How to train your dragon (web standard)
notwaldorf
96
6.9k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
670
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
360
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
480
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
47k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
740
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
2
1k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
680
Transcript
The Joy of Clojure Clojure之乐 John Biesnecker twitter: @biesnecker 新浪微博:
@岳撼 Barcamp Shanghai, 03 March 2012
Quick show of hands. Clojure junkies? LISP hackers? Functional Programming
aficionados? Java nerds? How many of you are ...
(= :clojure [:lisp :functional :jvm])
(= :clojure [:lisp :functional :jvm])
http://xkcd.com/297/
(= :data :code) (= :code :data) homoiconicity
(+ 1 2) ;; => 3
(eval (list (symbol “+”) 1 2)) ;; => 3
macros extend the language seamlessly
(defmacro unless [condition & body] `(if (not ~condition) (do ~@body)))
;; (unless (= true false) ;; (println “You don’t understand booleans, do you?”))
(= :clojure [:lisp :functional :jvm])
functional, but not pedantic about it (sorry Haskell... we can
still be friends though, right?)
immutable by default (with managed mutability when you need it)
easier to reason about
expressive
;; sum of multiples of 27 under one million (reduce
+ (filter #(zero? (mod % 27)) (range 0 1e6))) ;; 18518981481
composable (small pieces, loosely joined)
;; functions are first-class object (defn increment-by-three [x] (+ x
3)) (defn contrived-example [avector afunction] (map afunction avector) ;; (contrived-example [1 2 3] increment-by-three) ;; => (4 5 6)
;; anonymous functions are easy (defn contrived-example [avector afunction] (map
afunction avector) ;; (contrived-example [1 2 3] #(+ % 3)) ;; => (4 5 6)
(= :clojure [:lisp :functional :jvm])
(almost) seamless interop with Java
(BigInteger. “12345678900987654321”) ;; returns a java.math.BigInteger object
most new languages have poor library support
Clojure has every library ever written in Java
;; writing a high-performance thread-safe cache is hard (import ‘com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap)
(import ‘com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap$Builder) (-> (ConcurrentLinkedHashMap$Builder.) (.maximumWeightedCapacity 1000) (.build)) ;; thanks, Google ;-)
(= :clojure [:lisp :functional :jvm])
did I mention killer concurrency support?
questions?
谢谢 Thank you