Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Intro to Clojure - Week 1

Ian Bishop
September 17, 2013

Intro to Clojure - Week 1

Week 1 slides of Introduction to Clojure @ UNB, Fall 2013

Ian Bishop

September 17, 2013
Tweet

More Decks by Ian Bishop

Other Decks in Programming

Transcript

  1. Studied at UNB (CS/Math) Work at UserEvents Open Source (Official

    Clojure ZMQ) (Unofficial Clojure LMAX Disruptor)
  2. Modern dialect of Lisp Created by Rich Hickey in 2007

    General purpose functional language Runs on a number of platforms (JVM, CLR, Javascript)
  3. Modern dialect of Lisp Created by Rich Hickey in 2007

    General purpose functional language Runs on a number of platforms (JVM, CLR, Javascript)
  4. Invented in 1958 by John McCarthy Second oldest modern programming

    language Introduced fundamental ideas of modern programming Tree Data Structures Garbage Collection Dynamic Typing Conditionals Recursion Higher-order functions
  5. Some may say Ruby is a bad rip- off of

    Lisp or Smalltalk, and I admit that. But it is nicer to ordinary people Matz, creator of the Ruby programming language
  6. Some may say Ruby is a bad rip- off of

    Lisp or Smalltalk, and I admit that. But it is nicer to ordinary people Matz, creator of the Ruby programming language
  7. any sufficiently complicated C or Fortran program contains an ad

    hoc informally- specified bug-ridden slow implementation of half of Common Lisp Philip Greenspun
  8. any sufficiently complicated C or Fortran program contains an ad

    hoc informally- specified bug-ridden slow implementation of half of Common Lisp Philip Greenspun
  9. Lisp is worth learning for the profound enlightenment experience you

    will have when you finally get it; that experience will make you a better programmer for the rest of your days, even if you never actually use Lisp itself a lot. Eric Raymond, Essayist & Open Source demigod
  10. Lisp is worth learning for the profound enlightenment experience you

    will have when you finally get it; that experience will make you a better programmer for the rest of your days, even if you never actually use Lisp itself a lot. Eric Raymond, Essayist & Open Source demigod
  11. I suppose I should learn Lisp, but it seems so

    foreign Paul Graham, Author of “On Lisp” & creator of Y Combinator
  12. I suppose I should learn Lisp, but it seems so

    foreign Paul Graham, Author of “On Lisp” & creator of Y Combinator
  13. (if (= 1 1) (list 1 2 "foo") (list 1

    2 "bar")) => (1 2 "foo")
  14. Reducing incidental complexity is a primary focus of Clojure. For

    example, mutable state is an incidental complexity. The mechanics of it seem simple, or at least familiar, but the reality is quite complex. So, Clojure makes immutable data the default. Rich Hickey, creator of Clojure
  15. Reducing incidental complexity is a primary focus of Clojure. For

    example, mutable state is an incidental complexity. The mechanics of it seem simple, or at least familiar, but the reality is quite complex. So, Clojure makes immutable data the default. Rich Hickey, creator of Clojure
  16. Reducing incidental complexity is a primary focus of Clojure. For

    example, mutable state is an incidental complexity. The mechanics of it seem simple, or at least familiar, but the reality is quite complex. So, Clojure makes immutable data the default. Rich Hickey, creator of Clojure
  17. Inventing a class with its own interface to hold a

    piece of information is like inventing a new language to write every short story. This is anti- reuse, and, I think, results in an explosion of code in typical OO applications. Rich Hickey, creator of Clojure
  18. Inventing a class with its own interface to hold a

    piece of information is like inventing a new language to write every short story. This is anti- reuse, and, I think, results in an explosion of code in typical OO applications. Rich Hickey, creator of Clojure
  19. Inventing a class with its own interface to hold a

    piece of information is like inventing a new language to write every short story. This is anti- reuse, and, I think, results in an explosion of code in typical OO applications. Rich Hickey, creator of Clojure
  20. As you've noted, existing languages change slowly, if at all.

    Are we getting better languages? Many of the hot 'new' languages like Haskell and Erlang are in fact pretty old. Clojure builds on Lisp, which is really old. What is new is the willingness to utilize these languages in mainstream production environments. And that is a great thing, as we have largely maxed out the expressive capabilities of the C++/Java/C# languages, as evidenced by the prominence of XML and IDEs. Rich Hickey, creator of Clojure
  21. As you've noted, existing languages change slowly, if at all.

    Are we getting better languages? Many of the hot 'new' languages like Haskell and Erlang are in fact pretty old. Clojure builds on Lisp, which is really old. What is new is the willingness to utilize these languages in mainstream production environments. And that is a great thing, as we have largely maxed out the expressive capabilities of the C++/Java/C# languages, as evidenced by the prominence of XML and IDEs. Rich Hickey, creator of Clojure