User:JimTittsler/Clojure-py

From WikiEducator
Jump to: navigation, search

Lightning Talk, Kiwi PyCon 2012, Dunedin, New Zealand

Clojure-py

Jim Tittsler <jwt@python.net>

Twitter: @jtittsler

A language that doesn't affect the way you think about programming, is not worth knowing.

Alan J. Perlis

Clojure

  • Lisp re-imagined (circa 2007)
    • persistent data structures (sequences, maps)
    • concurrency
  • functional programming
  • JVM
    • symbiotic with platform (and existing libraries)

Clojure

  • JVM
  • CLR
  • Javascript (Clojurescript, Google Closure)
  • Clojure-py
  • Clojure-lua
  • Clojure-scheme (Clojurescript -> Gambit Scheme -> C)

Clojure

(ns hello)
 
(def population {:snakes 10000 :planes 2})
 
(defn greet [n]
  (println "Hello" n))
 
(defn manifest [who]
  (greet who)
  (println (/ (:snakes population)
              (:planes population))
           "snakes per plane"))
 
(manifest "Jim")

Clojure-py

  • dynamic virtual machine
  • faster startup time
  • access Python libraries
    • Numeric, PySide