Welcome to the World
                                of


                                Clojure

                         The language for
                          Web startups?



                           railando                  .com
                           Gain%%Speed%with%%Ruby%on% Rails
Berlin, Sep 21, 2012
Welcome to the World
                                of


                                Clojure

                         The language for
                          Web startups?



                           railando                  .com
                           Gain%%Speed%with%%Ruby%on% Rails
Berlin, Sep 21, 2012
What to expect in this presentation?




                         railando                  .com
                         Gain%%Speed%with%%Ruby%on% Rails
Berlin, Sep 21, 2012
What to expect in this presentation?




                         railando                  .com
                         Gain%%Speed%with%%Ruby%on% Rails
Berlin, Sep 21, 2012
What to expect in this presentation?

                       •Understand what Clojure is
                       •Understand what functional programming is
                       •Understand its benefits and drawbacks
                       •Inspiration to your own thoughts   
                       •Hear about practical experience
                       •Know where to get help:

                                    railando                  .com
                                    Gain%%Speed%with%%Ruby%on% Rails
Berlin, Sep 21, 2012
Some problems



that plague people today

       with regards to

 software development
Subpar language extensibility




Languages are extensible: libraries, gems, etc.

          But not extensible enough

        Example: Machine Learning, R
New langugages build libraries slowly




   Some language’s greatest reason to use
      (even reason to be in existence)
          is great library support

Otherwise great languages are not being widely
  used because of (still) poor library support
Parallel Processing


    Making an existing application thread-safe
    means basically rebuilding it from scratch
 if written in an imperative language (OO or not)

Moore’s Law (double performance every two years)
          is still observed (as of 2012)

Change: Since a physical barrier in semiconductor
 speed has been reached, Moore’s Law can only
         materialize through parallelism

  Proof in the real world: multi-core processors
Mutable State


 It’s been a given in programming since Turing
     Machines, so hardly anyone questions it

  Tools like LOGO or SCRATCH teach kids that
programming is equivalent to managing mutable
                     state

    Makes it incredibly hard to reuse code!

    Makes it incredibly hard to parallelize.
What now?


          How is

          Clojure

an answer to these problems?
Functional Programming


   Mutable State is a well-managed exception,
                   not the rule

      Pure functions: Don’t depend on state

 Makes it easy to reason about code and to reuse
         code (OO was a step, but small)

Contrasting paradigm to imperative prpgramming.
Parallelism


    Clojure manages mutable state well, taking
   parallelism (in different flavors) carefully into
                       account

    Clojure code can easily be made parallel

Even automatic parallelization is possible to some
                     extent

Remember: Who does not manage parallelism well,
        will be non-existent by 2020!
Extensibilty


Clojure’s extensibility mechanism (called “Macros”,
  an all-day name for a world-class concept) is
                      unrivaled

                   Examples:
    Machine Learning/Statistics: R vs. cloj-ml
    Logic Programming: Prolog vs. core-logic
Libraries / Communities


             Based on Java / JVM

Can fully profit from Java’s enormous community,
      battle-proven libraries and tools, etc.

                     Plus:
                Clojure is fast.
                   FAST!
LISP syntax


           Clojure is a dialect of LISP!

       Syntax is simple. I mean: simple.
    No LR parsing, Chomsky grammars, yni.

Who knows for sure all operator precedence in C,
      C++, Java, Perl, Python, Ruby, ... ???

    Fully parenthesized notation removes all
                   ambiguity

      “Polish” notation. (Remember RPN?)
Our experience
               Surprising amount of libraries available

Web develpment greatly simplified. Many things that require gems in
              ruby work “just like that” in Clojure

              Better performance than Ruby or Python

              Extremely helpful and vibrant community

                           Incredible fun!

      We expect enormous productivity gains in new projects.

Enables us to do things that matter, that wouldn’t be possible before!

                Matching database system: Datomic!

  Webapps: Clojure on the server and ClojureScript in the browser:
                         How cool is that?
A real life example


       See
      Demo
A real life example


       See
      Demo
What now?

  Try it !
Finally

               Care for

             help?
          consulting?
           support?
           training?

Don’t forget to give us a call ;-)

  bernd.blume@railando.com

         railando                  .com
         Gain%%Speed%with%%Ruby%on% Rails

Clojure

  • 1.
    Welcome to theWorld of Clojure The language for Web startups? railando .com Gain%%Speed%with%%Ruby%on% Rails Berlin, Sep 21, 2012
  • 2.
    Welcome to theWorld of Clojure The language for Web startups? railando .com Gain%%Speed%with%%Ruby%on% Rails Berlin, Sep 21, 2012
  • 3.
    What to expectin this presentation? railando .com Gain%%Speed%with%%Ruby%on% Rails Berlin, Sep 21, 2012
  • 4.
    What to expectin this presentation? railando .com Gain%%Speed%with%%Ruby%on% Rails Berlin, Sep 21, 2012
  • 5.
    What to expectin this presentation? •Understand what Clojure is •Understand what functional programming is •Understand its benefits and drawbacks •Inspiration to your own thoughts    •Hear about practical experience •Know where to get help: railando .com Gain%%Speed%with%%Ruby%on% Rails Berlin, Sep 21, 2012
  • 6.
    Some problems that plaguepeople today with regards to software development
  • 7.
    Subpar language extensibility Languagesare extensible: libraries, gems, etc. But not extensible enough Example: Machine Learning, R
  • 8.
    New langugages buildlibraries slowly Some language’s greatest reason to use (even reason to be in existence) is great library support Otherwise great languages are not being widely used because of (still) poor library support
  • 9.
    Parallel Processing Making an existing application thread-safe means basically rebuilding it from scratch if written in an imperative language (OO or not) Moore’s Law (double performance every two years) is still observed (as of 2012) Change: Since a physical barrier in semiconductor speed has been reached, Moore’s Law can only materialize through parallelism Proof in the real world: multi-core processors
  • 10.
    Mutable State It’sbeen a given in programming since Turing Machines, so hardly anyone questions it Tools like LOGO or SCRATCH teach kids that programming is equivalent to managing mutable state Makes it incredibly hard to reuse code! Makes it incredibly hard to parallelize.
  • 11.
    What now? How is Clojure an answer to these problems?
  • 12.
    Functional Programming Mutable State is a well-managed exception, not the rule Pure functions: Don’t depend on state Makes it easy to reason about code and to reuse code (OO was a step, but small) Contrasting paradigm to imperative prpgramming.
  • 13.
    Parallelism Clojure manages mutable state well, taking parallelism (in different flavors) carefully into account Clojure code can easily be made parallel Even automatic parallelization is possible to some extent Remember: Who does not manage parallelism well, will be non-existent by 2020!
  • 14.
    Extensibilty Clojure’s extensibility mechanism(called “Macros”, an all-day name for a world-class concept) is unrivaled Examples: Machine Learning/Statistics: R vs. cloj-ml Logic Programming: Prolog vs. core-logic
  • 15.
    Libraries / Communities Based on Java / JVM Can fully profit from Java’s enormous community, battle-proven libraries and tools, etc. Plus: Clojure is fast. FAST!
  • 16.
    LISP syntax Clojure is a dialect of LISP! Syntax is simple. I mean: simple. No LR parsing, Chomsky grammars, yni. Who knows for sure all operator precedence in C, C++, Java, Perl, Python, Ruby, ... ??? Fully parenthesized notation removes all ambiguity “Polish” notation. (Remember RPN?)
  • 17.
    Our experience Surprising amount of libraries available Web develpment greatly simplified. Many things that require gems in ruby work “just like that” in Clojure Better performance than Ruby or Python Extremely helpful and vibrant community Incredible fun! We expect enormous productivity gains in new projects. Enables us to do things that matter, that wouldn’t be possible before! Matching database system: Datomic! Webapps: Clojure on the server and ClojureScript in the browser: How cool is that?
  • 18.
    A real lifeexample See Demo
  • 19.
    A real lifeexample See Demo
  • 20.
    What now? Try it !
  • 21.
    Finally Care for help? consulting? support? training? Don’t forget to give us a call ;-) bernd.blume@railando.com railando .com Gain%%Speed%with%%Ruby%on% Rails