ClojureScript
Why?
The simplicity and power of Clojure
combined with the reach of Javascript.
combined with the reach of Javascript.
Simplicity
- Simple, not necessarily easy
- Data over syntax
-
Pure functions
- Composable
- Immutable data
Power
- Great namespacing and library support
- Persistent collections
- Abstractions, seqs
- Extensible through macros
-
Embraces the underlying platform
- REPL
Reach
- Clojure in the browser
- Clojure in mobile devices
-
Clojure in NodeJS
- ...
How?
-
Compiles a subset of Clojure to Javascript
- Uses the Closure Compiler and Library
Closure Compiler
- Minification
- Optimization
- Dead code elimination
Alpha
ClojureScript is still very young.
There are rough edges!
ClojureScript Koans
LightTable
- lein compile
- Open index.html in LightTable
- Open file in browser
- Add a tabset
- Open src/clojurescript_koans.cljs
- Move tab to next tabset
- Eval a form in the editor (CMD+Enter)
core.async
core.async Examples
bit.ly/1c5OFC9- Clone the project
- Open examples/*.cljs
- Add connection > Clojure > Open project.clj
- Go wild
ClojureScript 101
Bonus #1: Dommy
for DOM queries and templating
Bonus #2: OM
Port to github.com/swannodette/om,
refer to examples/typeahead
Stuff we did
Comment app in Om
Thank you!
ClojureScript
By oskarwickstrom
ClojureScript
- 601