KEMBAR78
Intro to Clojure 4 Developers | PPTX
Intro to Clojure
For programmers
• a dialect of LISP
• Runs on JVM, CLI, Javascript
• Functional
• Immutable
• Designed by Programmers for
Programmers
Rich Hickey
created in 2007
What is it?
Syntax
• Keyword ... :a :b
• Symbol ... println
• String ... "Hi Mom"
• Integer ... 42
List All The Things
• Everything is a list with ( )
• (function-name
parameter parameter)
• (println "hello world")
• (+ 1 2)
Data Structures
• Vector (collection)
• [1 2 3]
• Map (hash)
• {:a 1 :b 2 :c 3}
• Set (unique collection)
• #{1 2 3 }
( ) aren’t that bad!
nREPL
• Sort of like IRB/Pry for ruby,
but better
• Built in to Light Table
• Add-in for Emacs, Sublime
and others
Cool Libraries
• OM - Facebook react
library
• compojure - websites
• korma - object relation
mapper for databases
• play-clj - game library
More Cool Things
• quil - a wrapper around Processing
for drawing/animation
• overtone - playing musical tones
• synaptic - neural networks
• cascalog - data processing
• datomic - query engine built on top
of database storage
The tooling
Leiningen
for automating
Clojure projects
without setting
your hair on fire
1. Download the lein script (or on Windows lein.bat)
2. Place it on your $PATH where your shell can find it
3. Set it to be executable (chmod a+x ~/bin/lein)
4. Run it (lein) and it will download the self-install
package
lein new app my-stuff
$ cd my-stuff
$ find .
.
./.gitignore
./doc
./doc/intro.md
./LICENSE
./project.clj
./README.md
./resources
./src
./src/my_stuff
./src/my_stuff/core.clj
./test
./test/my_stuff
./test/my_stuff/core_test.clj
• install dependancies
lein deps
• create projects
lein new app my-stuff
• start a repl
lein repl
Oh the things it can do….
Austin ClojureBridge
• March 13, 14
• Rackspace North Campus
• Friday night install fest 6pm-8pm
• Saturday workshop 9am-3:30pm
• Saturday night after party at Pinballz
Arcade
• Food/beverages provided by sponsors
• Sponsors: Rackspace, DRW, Pragmatic
40% off print,
50% off digital
see Nola
for code
Live Coding

Intro to Clojure 4 Developers

  • 1.
  • 2.
    • a dialectof LISP • Runs on JVM, CLI, Javascript • Functional • Immutable • Designed by Programmers for Programmers Rich Hickey created in 2007 What is it?
  • 3.
    Syntax • Keyword ...:a :b • Symbol ... println • String ... "Hi Mom" • Integer ... 42
  • 4.
    List All TheThings • Everything is a list with ( ) • (function-name parameter parameter) • (println "hello world") • (+ 1 2)
  • 5.
    Data Structures • Vector(collection) • [1 2 3] • Map (hash) • {:a 1 :b 2 :c 3} • Set (unique collection) • #{1 2 3 }
  • 6.
    ( ) aren’tthat bad!
  • 7.
    nREPL • Sort oflike IRB/Pry for ruby, but better • Built in to Light Table • Add-in for Emacs, Sublime and others
  • 8.
    Cool Libraries • OM- Facebook react library • compojure - websites • korma - object relation mapper for databases • play-clj - game library
  • 9.
    More Cool Things •quil - a wrapper around Processing for drawing/animation • overtone - playing musical tones • synaptic - neural networks • cascalog - data processing • datomic - query engine built on top of database storage
  • 10.
  • 11.
    Leiningen for automating Clojure projects withoutsetting your hair on fire 1. Download the lein script (or on Windows lein.bat) 2. Place it on your $PATH where your shell can find it 3. Set it to be executable (chmod a+x ~/bin/lein) 4. Run it (lein) and it will download the self-install package
  • 12.
    lein new appmy-stuff $ cd my-stuff $ find . . ./.gitignore ./doc ./doc/intro.md ./LICENSE ./project.clj ./README.md ./resources ./src ./src/my_stuff ./src/my_stuff/core.clj ./test ./test/my_stuff ./test/my_stuff/core_test.clj
  • 14.
    • install dependancies leindeps • create projects lein new app my-stuff • start a repl lein repl Oh the things it can do….
  • 15.
    Austin ClojureBridge • March13, 14 • Rackspace North Campus • Friday night install fest 6pm-8pm • Saturday workshop 9am-3:30pm • Saturday night after party at Pinballz Arcade • Food/beverages provided by sponsors • Sponsors: Rackspace, DRW, Pragmatic
  • 16.
    40% off print, 50%off digital see Nola for code
  • 17.

Editor's Notes

  • #3 LISP second language made After Fortran
  • #9 OM is a wrapper around the Facebook React library Compojure is somewhat like ruby Rack Korma is a ORM, where you can create entities and have easy access to data, awesome play-cli is a wrapper around libGDX, desktop, mobile apps quil - creates graphics and animations synaptic - neural networks used for machine learning casalog - query language for hadoop datomic - a database, which separates storage from queries in a unique way
  • #10 Ever heard of processing? its a graphics library kind of neat Variety of problem domains for Clojure
  • #16 First Workshop, there will probably be more :) Should have about 6 months experience