SlideShare une entreprise Scribd logo
1  sur  26
Télécharger pour lire hors ligne
Introduction
                                            To
                                       Clojure
                               BBC lunch & learn, July 18th 2012
                       Renzo Borgatti, Developer in Test, A/V Team



Welcome to this introduction to the Clojure language. Clojure had a lot of attraction lately as
well other well known languages based on the functional paradigm like Erlang or inspired
from the functional paradigm like Scala. There is definitely a reason for the return of the
functional paradigm nowadays that we are going to explain briefly in this talk.

My name is Renzo Borgatti, blah blah
the functional re-emergence
        roots in λ-calculus 1930
      re-discovered with Lisp 1958



The functional paradigm has its root in the Lambda calculus, a method for notations and
manipulation of mathematical functions introduced by Alonso Church around 1930.
Lambda calculus was then rediscovered as a versatile programming tool by McCarthy in 1958
when Lisp was introduced as a programming language able to deal with mathematical
notation.
Moore’s failure for cpu clock
   but cpu density growing fast
  software is the new bottleneck
  need to design for concurrency



Moore’s law recently failed on one of its axis. CPU speed is not doubling or tripling every year
anymore. It used to be the case in the late ’90. But the demand of computing power is
growing as usual.

Hardware manufacturer resorted to other means to increase power, such as transistor
density. Right now is not uncommon to see cheap laptops sold with 4 cpu cores out of the
box. Change on chip density requires a change in software scalability. Software must be
written for concurrency to take advantage of multi-core architectures.
OOP encapsulates state
        changes overwrite state
      state has multiple observers
      concurrency requires locking
         locking is complicated



Object Oriented Programming confines state using specific language constructs like classes.
The Program flows as a series of state changes.
When state needs concurrent access it must be protected using locks because there could be
multiple computations going on at the same time.
A change on the state delete previous values and the history is lost
The problem is that “identity” and “values” are overlapping

A clear example is a date object. A date is created to hold a value, maybe the the hottest day
of the year. If there is a new record this year, that is the new hottest day. But what about the
previous one? Why it should be completely replaced by changing the date and removing the
information from the system? What about all the threads that were observing the value
producing metrics for the old date? Should that information being lost by changing the date
instance or should each thread just keep going observing the old value until they decide
otherwise?

State based languages are hard to understand and to debug. Looking at some method,
chances are you can’t be sure until runtime about what that method is supposed to behave in
certain condition. Sometimes even at runtime the portion of state influencing the
computation is so big that is impossible to handle correctly.

Concurrency based on locks is complicated, generating deadlock conditions and all sort of
synchronisation issues.
Clojure, Scala, F#, Erlang...
        focus on immutability
     semantic for changing values
     “new” model for concurrency



Hence why the resurgence of the “old” and “academic” functional model.

Why not Lisp or Haskell?

Clojure Scala and F# all have in common the fact that they are hosted, so interoperability with
known languages it’s easy. Erlang is a special case of non-hosted functional language that
became popular. Erlang is very focused on high availability and performs great in that kind of
environments.
A dynamically-typed
           jvm-based Lisp dialect

                           Rich Hickey
                              2007
                             now 1.4

What about Clojure in specific? Clojure is a relatively young programming language based on
Lisp but running on the JVM.

It comes out from the frustration of Rich Hickey developing highly concurrent systems as a
Java and .NET consultant.

Rich Hickey developed dotLisp for the .NET environment before Clojure.

He spent then 2.5 years designing and implementing Clojure. Clojure was officially
announced in 2007.
interactive
                               hosted
                              dynamic
                             it’s a Lisp
                             functional
                            concurrent

These are the main Clojure design principles. Clojure is a “consenting adults” language. It sits
someway between the functional pureness of Haskell and the lazy-evaluate-everything of
Scheme. Checking for functions that aren’t pure in Clojure is technically possible, but that
will make more than half of the JDK or CLR unusable.
interactive



          REPL read-eval-print loop
           suitable for exploration
          introspection capabilities
            fast development loop


                                                demo
Show off REPL in action:
- repl special variables *1 *2 *3 etc
- the content of (pst) after an exception
- doc searching and print sources
- (find-doc “some”)
- (use ‘clojure.repl) (source func)
hosted




        built with Java interop in mind
                use Java directly
                   no wrappers
              lots of syntatic sugar


                                                                          demo
-   java interop demo
-   (filter #(re-seq #"pper" (.getName %)) (seq (.getMethods String)))
-   (import 'java.util.Date) (def now (Date.))
-   (.. "" getClass getMethods)
dynamic




        less ceremony: speed
      concise: where’s my code
     ~1:1 ratio sudocode real code



Clojure is dynamic in two ways. It’s dynamically typed, so it doesn’t specify types. Explicit
typing would be more useful for a language that at compile time can check if the current
functions are producing side effects and issue warnings. For Clojure dynamic typing means to
be more concise and more flexible.

Second, Clojure it’s dynamic in the way programmers can approach development with it:
firing up a REPL, test live code that gets automatically re-evaluated (when needed) and tweak
the main program on the go. Less ceremony means speed: less code to type, less potential
bugs, code is more readable.

Conciseness measures the quantity of code needed to express a “task” in the language. When
the language is concise it’s easier for the programmer to focus on business logic. Potentially
a 1:1 ratio between sudocode and the actual code would be ideal.
dynamic




           by the way, not this kind...

                  ...of expressiveness!




That’s the APL one liner for the game of life.
http://catpad.net/michael/apl/
dynamic

     but instead of




                                            something like

This is the isBlank static method in StringUtils from Apache commons. I have a quiz for you. I
removed the name of the method. By reading the java and the clojure version of the same
behaviour, could you tell what the method is actually doing? If yes, was the Java or the
Clojure version more helpful?
It’s a Lisp




      homoiconic data as code
     powerful macro programming
         define new syntax



                                                                            demo
In Clojure everything that the compiler sees are just data structure although there is some
syntactic sugar to make it easier to program.

But before the compiler there is a Reader in Clojure which transforms the textual input into
data structures.

Homoiconic means just that, that everything is a data structure. Why this is important?
Because the syntax is much simpler and more abstract constructs can be built in term of a
bunch of primitives. It also make it easier for macro programming.

Macros are special constructs which are interpreted by the reader and will influence the final
output which is going to the compiler. With Macros you can effectively extend the language.
Clojure “when”, “for” or syntax like the arrow operator “->” are effectively macros.

(macroexpand '(when (= "a" "a") (def renzo ", renzo") (str "this is also true" renzo)))
(macroexpand '(for [x (range 10)] (str x)))
functional



        focus on immutability
      side-effects free functions
        caching and laziness
    “consenting adults” pureness



Finally, Clojure is functional. It should be already clear at this point of the presentation.
Clojure main data structures are immutable, requiring a specific semantic to be altered. Being
functional means that the output of a function can only be influenced by its inputs. The
parameters must hence be immutable. If they were mutable then the function would have a
chance to be impure by altering them.

When a function is pure there are no side effects so it is producing repeatable results which
are independent from the state of the system. Repeatable means caching can be
implemented easily. Laziness follows because there is no need to “render” the result of a
function until it’s actually needed. Laziness means more optimisation opportunities for the
compiler.

Clojure always allows you to skip all of that and introduce side effects all around. It does not
have the assignment operator though.
concurrent




   immutable core data structures
    constrained change semantic
         atom, ref, agent, var



                                                                          demo
Clojure has been built with a focus on concurrency. Main data structures are immutable
requiring special semantic to be altered. There are four types of clojure construct to alter
immutable structures.

Atoms are simple CAS (compare and swap) semantic. You create an atom and then you can
change it by just calling swap! on it passing the function that should alter the content of the
atom. The swap! will succeed or not, based on a comparison with the current value in the
atom. If the value is changed by another thread in the middle, the swap! will be attempted
again over the new value. Needless to say, the altering function needs to be side effects free.

Atoms cannot coordinate over multiple values. You need Refs for that. A ref is similar to a
database transaction. You need to open a transaction before attempting to change any of the
Refs. Transactions can be attempt an arbitrary number of times.

Agents are similar to Atoms in the sense that they are uncoordinated. But an action sent to an
Agent will be executed at some later point in time, on a thread pool.

Vars is thread-local state that can be altered by using the (binding) form. They can be used
where too many repeating parameters are unpractical (like Java).
Clojure is not a replacement
     not just for list comprehension
           radical approach
         steeper learning curve

                what about all those
                  parenthesis?

Clojure has not been built to be a replacement for Java as other languages. It was built with
imperative and state based languages drawbacks to solve the problem entirely.

Another thing that is valid for all functionally inspired languages is that the functional
paradigm is not about having functions as variables that can be sent around and used on
collections. Ruby and Python aren’t certainly functional but they are heavily based on closures
(aka lambdas). Scala is more functional in this respect but it allows assignment and support
object orientation with instance variables that are clearly used to obtain side effects.

If you come from another paradigm and usually programming in Java the Clojure learning
curve will be probably steeper than Groovy or Scala.

Java people tend to try to match parenthesis as soon as they see them. Brackets mostly
delimit scope and give structure to the code. Lispers don’t need to match parenthesis.
Who is using Clojure?

The always evolving lists:
http://dev.clojure.org/display/community/Clojure+Success+Stories
http://www.quora.com/Whos-using-Clojure-in-production
Clojure is a good hiring tool
            attract smart people
        diversify company mindset



There is an higher probability to attract the Lisp community with Clojure than Scala.

The Lisp community includes a very fine selected crowd of people who must have been in
deeply love with their language if they remained outside the mainstream languages for
something like half a century! Apart from jokes, the average mathematical and algorithmic
background of the Lisp community is very high and a nice addition for you team.

An useful link: the london clojurians jobs page (requires to join the mailing list):
- https://groups.google.com/forum/?fromgroups#!forum/london-clojurian-jobs
Scala                                     Clojure


           type system                        change semantic models
  complicated type system                          clever sequences
       actor concurrency                                no objects
       good java interops                           harder to recruit
       friendly java syntax                    top-notch java interops
        object/functional                       steeper learning curve
                                                    Lisp community




The not-definitive Scala to Clojure comparison chart in no specific order of priority.

The two languages have completely different philosophies but the impression is that at the
end they have more in common than expected.

There are hiring and people factors to consider when choosing one or the other. Clojure is a
radical approach that refuses objects as the main tool to model the world, especially a
concurrent world. Scala embraces both styles and let object oriented developers depart from
the paradigm when needed.

The choice between the two language is almost impossible to make outside a specific
context. They both have pro and cons that compensate each other on an absolute scale. What
should not happen in both cases is that you choose the language because you can “send
methods to collections and around”. There is much more about the functional paradigm that
has nothing to do with closures.
General resources
the main clojure website:
http://www.clojure.org
easily browsable documentation:
http://clojuredocs.org
the london clojure dojo and group:
http://londonclojurians.org
who is using Clojure?
http://dev.clojure.org/display/community/Clojure+Success+Stories
paper introducing lamda calculus to programmers:
http://www.cs.bham.ac.uk/~axj/pub/papers/lambda-calculus.pdf
introducing clojure in the organization:
http://blog.jayfields.com/2012/01/lessons-learned-while-introducing-new.html
BBC resources

The BBC clojure weekly dojo, every Thu 12:30 van gogh:
https://confluence.dev.bbc.co.uk/display/~renzo.borgatti@bbc.co.uk/clojure-ug
BBC Clojure forge mailing list:
https://lists.forge.bbc.co.uk/mailman/listinfo/clojure
BBC Clojure forge IRC channel:
#clojure
Talk

Slides PDF available here:
https://confluence.dev.bbc.co.uk/display/~renzo.borgatti@bbc.co.uk/clojure-ug
Please rate my talk:
sdfdfd
Video will be available soon
Me
@reborg
renzo.borgatti@bbc.co.uk
http://reborg.net
http://github.com/reborg
Questions?




Or, let me help...
if Java had closures today
       (they’ll be in Java 8)
would you still consider Scala or
             Groovy?

 Is it still worth learning a new
     language for that only?
(let [audience people-present-today]
  (map #(str “THANK YOU, ” %) audience))

Contenu connexe

Tendances

Java jdk-update-nov10-sde-v3m
Java jdk-update-nov10-sde-v3mJava jdk-update-nov10-sde-v3m
Java jdk-update-nov10-sde-v3mSteve Elliott
 
Functional programming in scala
Functional programming in scalaFunctional programming in scala
Functional programming in scalaStratio
 
Mixing Source and Bytecode: A Case for Compilation By Normalization (OOPSLA 2...
Mixing Source and Bytecode: A Case for Compilation By Normalization (OOPSLA 2...Mixing Source and Bytecode: A Case for Compilation By Normalization (OOPSLA 2...
Mixing Source and Bytecode: A Case for Compilation By Normalization (OOPSLA 2...lennartkats
 
Functional programming with Java 8
Functional programming with Java 8Functional programming with Java 8
Functional programming with Java 8LivePerson
 
Lambda: A Peek Under The Hood - Brian Goetz
Lambda: A Peek Under The Hood - Brian GoetzLambda: A Peek Under The Hood - Brian Goetz
Lambda: A Peek Under The Hood - Brian GoetzJAX London
 
Ppl for students unit 4 and 5
Ppl for students unit 4 and 5Ppl for students unit 4 and 5
Ppl for students unit 4 and 5Akshay Nagpurkar
 
The Road to Lambda - Mike Duigou
The Road to Lambda - Mike DuigouThe Road to Lambda - Mike Duigou
The Road to Lambda - Mike Duigoujaxconf
 
Overview Of .Net 4.0 Sanjay Vyas
Overview Of .Net 4.0   Sanjay VyasOverview Of .Net 4.0   Sanjay Vyas
Overview Of .Net 4.0 Sanjay Vyasrsnarayanan
 
Objective-c for Java Developers
Objective-c for Java DevelopersObjective-c for Java Developers
Objective-c for Java DevelopersMuhammad Abdullah
 
An Introduction to Java Compiler and Runtime
An Introduction to Java Compiler and RuntimeAn Introduction to Java Compiler and Runtime
An Introduction to Java Compiler and RuntimeOmar Bashir
 
I know Java, why should I consider Clojure?
I know Java, why should I consider Clojure?I know Java, why should I consider Clojure?
I know Java, why should I consider Clojure?sbjug
 
Java Course 7: Text processing, Charsets & Encodings
Java Course 7: Text processing, Charsets & EncodingsJava Course 7: Text processing, Charsets & Encodings
Java Course 7: Text processing, Charsets & EncodingsAnton Keks
 
Functional programming with Java 8
Functional programming with Java 8Functional programming with Java 8
Functional programming with Java 8Talha Ocakçı
 

Tendances (20)

Java jdk-update-nov10-sde-v3m
Java jdk-update-nov10-sde-v3mJava jdk-update-nov10-sde-v3m
Java jdk-update-nov10-sde-v3m
 
Functional programming in scala
Functional programming in scalaFunctional programming in scala
Functional programming in scala
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
 
camel-scala.pdf
camel-scala.pdfcamel-scala.pdf
camel-scala.pdf
 
Mixing Source and Bytecode: A Case for Compilation By Normalization (OOPSLA 2...
Mixing Source and Bytecode: A Case for Compilation By Normalization (OOPSLA 2...Mixing Source and Bytecode: A Case for Compilation By Normalization (OOPSLA 2...
Mixing Source and Bytecode: A Case for Compilation By Normalization (OOPSLA 2...
 
Functional programming with Java 8
Functional programming with Java 8Functional programming with Java 8
Functional programming with Java 8
 
Lambda: A Peek Under The Hood - Brian Goetz
Lambda: A Peek Under The Hood - Brian GoetzLambda: A Peek Under The Hood - Brian Goetz
Lambda: A Peek Under The Hood - Brian Goetz
 
Ppl for students unit 4 and 5
Ppl for students unit 4 and 5Ppl for students unit 4 and 5
Ppl for students unit 4 and 5
 
Java SE 8 best practices
Java SE 8 best practicesJava SE 8 best practices
Java SE 8 best practices
 
The Road to Lambda - Mike Duigou
The Road to Lambda - Mike DuigouThe Road to Lambda - Mike Duigou
The Road to Lambda - Mike Duigou
 
Overview Of .Net 4.0 Sanjay Vyas
Overview Of .Net 4.0   Sanjay VyasOverview Of .Net 4.0   Sanjay Vyas
Overview Of .Net 4.0 Sanjay Vyas
 
Java SE 8 library design
Java SE 8 library designJava SE 8 library design
Java SE 8 library design
 
Objective-c for Java Developers
Objective-c for Java DevelopersObjective-c for Java Developers
Objective-c for Java Developers
 
An Introduction to Java Compiler and Runtime
An Introduction to Java Compiler and RuntimeAn Introduction to Java Compiler and Runtime
An Introduction to Java Compiler and Runtime
 
Core Java Tutorial
Core Java TutorialCore Java Tutorial
Core Java Tutorial
 
I know Java, why should I consider Clojure?
I know Java, why should I consider Clojure?I know Java, why should I consider Clojure?
I know Java, why should I consider Clojure?
 
Core java
Core javaCore java
Core java
 
Java Course 7: Text processing, Charsets & Encodings
Java Course 7: Text processing, Charsets & EncodingsJava Course 7: Text processing, Charsets & Encodings
Java Course 7: Text processing, Charsets & Encodings
 
Functional programming with Java 8
Functional programming with Java 8Functional programming with Java 8
Functional programming with Java 8
 
Core java
Core javaCore java
Core java
 

En vedette

Trabajo práctico sobre Clojure, Evaluación de un Lenguaje de Programación
Trabajo práctico sobre Clojure, Evaluación de un Lenguaje de ProgramaciónTrabajo práctico sobre Clojure, Evaluación de un Lenguaje de Programación
Trabajo práctico sobre Clojure, Evaluación de un Lenguaje de ProgramaciónEmmanuel Fontán
 
Introduction to Clojure and why it's hot for Sart-Ups
Introduction to Clojure and why it's hot for Sart-UpsIntroduction to Clojure and why it's hot for Sart-Ups
Introduction to Clojure and why it's hot for Sart-Upsedlich
 
Fase 5 ciclo for
Fase 5 ciclo forFase 5 ciclo for
Fase 5 ciclo forluisoctis
 
Functional programming in clojure
Functional programming in clojureFunctional programming in clojure
Functional programming in clojureJuan-Manuel Gimeno
 

En vedette (8)

Clojure Intro
Clojure IntroClojure Intro
Clojure Intro
 
Trabajo práctico sobre Clojure, Evaluación de un Lenguaje de Programación
Trabajo práctico sobre Clojure, Evaluación de un Lenguaje de ProgramaciónTrabajo práctico sobre Clojure, Evaluación de un Lenguaje de Programación
Trabajo práctico sobre Clojure, Evaluación de un Lenguaje de Programación
 
Clojure
ClojureClojure
Clojure
 
Introduction to Clojure and why it's hot for Sart-Ups
Introduction to Clojure and why it's hot for Sart-UpsIntroduction to Clojure and why it's hot for Sart-Ups
Introduction to Clojure and why it's hot for Sart-Ups
 
Clojure: Java y Lisp, unidos
Clojure: Java y Lisp, unidosClojure: Java y Lisp, unidos
Clojure: Java y Lisp, unidos
 
Fase 5 ciclo for
Fase 5 ciclo forFase 5 ciclo for
Fase 5 ciclo for
 
Clojure入門
Clojure入門Clojure入門
Clojure入門
 
Functional programming in clojure
Functional programming in clojureFunctional programming in clojure
Functional programming in clojure
 

Similaire à Introduction to Clojure

Languages used by web app development services remotestac x
Languages used by web app development services  remotestac xLanguages used by web app development services  remotestac x
Languages used by web app development services remotestac xRemote Stacx
 
Get Functional Programming with Clojure
Get Functional Programming with ClojureGet Functional Programming with Clojure
Get Functional Programming with ClojureJohn Stevenson
 
Java Closures
Java ClosuresJava Closures
Java ClosuresBen Evans
 
The Rise of Functional Programming
The Rise of Functional ProgrammingThe Rise of Functional Programming
The Rise of Functional ProgrammingTjerk Wolterink
 
Principled io in_scala_2019_distribution
Principled io in_scala_2019_distributionPrincipled io in_scala_2019_distribution
Principled io in_scala_2019_distributionRaymond Tay
 
Fun with Functional Programming in Clojure
Fun with Functional Programming in ClojureFun with Functional Programming in Clojure
Fun with Functional Programming in ClojureCodemotion
 
Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Espen Brækken
 
A Taste of Clojure
A Taste of ClojureA Taste of Clojure
A Taste of ClojureDavid Leung
 
Something for Nothing
Something for NothingSomething for Nothing
Something for NothingKevlin Henney
 
Introduction to functional programming
Introduction to functional programmingIntroduction to functional programming
Introduction to functional programmingThang Mai
 
Thinking Functionally - John Stevenson - Codemotion Rome 2017
Thinking Functionally - John Stevenson - Codemotion Rome 2017Thinking Functionally - John Stevenson - Codemotion Rome 2017
Thinking Functionally - John Stevenson - Codemotion Rome 2017Codemotion
 
Thinking Functionally with Clojure
Thinking Functionally with ClojureThinking Functionally with Clojure
Thinking Functionally with ClojureJohn Stevenson
 
Functional programming is the most extreme programming
Functional programming is the most extreme programmingFunctional programming is the most extreme programming
Functional programming is the most extreme programmingsamthemonad
 
Scala - The Simple Parts, SFScala presentation
Scala - The Simple Parts, SFScala presentationScala - The Simple Parts, SFScala presentation
Scala - The Simple Parts, SFScala presentationMartin Odersky
 
Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)Martijn Verburg
 

Similaire à Introduction to Clojure (20)

Seeking Clojure
Seeking ClojureSeeking Clojure
Seeking Clojure
 
Languages used by web app development services remotestac x
Languages used by web app development services  remotestac xLanguages used by web app development services  remotestac x
Languages used by web app development services remotestac x
 
Get Functional Programming with Clojure
Get Functional Programming with ClojureGet Functional Programming with Clojure
Get Functional Programming with Clojure
 
Java Closures
Java ClosuresJava Closures
Java Closures
 
The Rise of Functional Programming
The Rise of Functional ProgrammingThe Rise of Functional Programming
The Rise of Functional Programming
 
Principled io in_scala_2019_distribution
Principled io in_scala_2019_distributionPrincipled io in_scala_2019_distribution
Principled io in_scala_2019_distribution
 
Graphql
GraphqlGraphql
Graphql
 
Fun with Functional Programming in Clojure
Fun with Functional Programming in ClojureFun with Functional Programming in Clojure
Fun with Functional Programming in Clojure
 
Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex
 
A Taste of Clojure
A Taste of ClojureA Taste of Clojure
A Taste of Clojure
 
Something for Nothing
Something for NothingSomething for Nothing
Something for Nothing
 
Introduction to functional programming
Introduction to functional programmingIntroduction to functional programming
Introduction to functional programming
 
Thinking Functionally - John Stevenson - Codemotion Rome 2017
Thinking Functionally - John Stevenson - Codemotion Rome 2017Thinking Functionally - John Stevenson - Codemotion Rome 2017
Thinking Functionally - John Stevenson - Codemotion Rome 2017
 
Thinking Functionally with Clojure
Thinking Functionally with ClojureThinking Functionally with Clojure
Thinking Functionally with Clojure
 
Functional programming is the most extreme programming
Functional programming is the most extreme programmingFunctional programming is the most extreme programming
Functional programming is the most extreme programming
 
Scala - The Simple Parts, SFScala presentation
Scala - The Simple Parts, SFScala presentationScala - The Simple Parts, SFScala presentation
Scala - The Simple Parts, SFScala presentation
 
Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)
 
Stay fresh
Stay freshStay fresh
Stay fresh
 
Java 8 features
Java 8 featuresJava 8 features
Java 8 features
 
PARADIGM IT.pptx
PARADIGM IT.pptxPARADIGM IT.pptx
PARADIGM IT.pptx
 

Plus de Renzo Borgatti

Clojure beasts-euroclj-2014
Clojure beasts-euroclj-2014Clojure beasts-euroclj-2014
Clojure beasts-euroclj-2014Renzo Borgatti
 
Introduzione a macruby
Introduzione a macrubyIntroduzione a macruby
Introduzione a macrubyRenzo Borgatti
 
MacRuby For Ruby Developers
MacRuby For Ruby DevelopersMacRuby For Ruby Developers
MacRuby For Ruby DevelopersRenzo Borgatti
 
You Say Tomato I Say Pomodoro
You Say Tomato I Say PomodoroYou Say Tomato I Say Pomodoro
You Say Tomato I Say PomodoroRenzo Borgatti
 
Agile Pomodoro Development
Agile Pomodoro DevelopmentAgile Pomodoro Development
Agile Pomodoro DevelopmentRenzo Borgatti
 
Writing Apps with HotCocoa and MacRuby
Writing Apps with HotCocoa and MacRubyWriting Apps with HotCocoa and MacRuby
Writing Apps with HotCocoa and MacRubyRenzo Borgatti
 
Introduction to Agile Development with Scrum
Introduction to Agile Development with ScrumIntroduction to Agile Development with Scrum
Introduction to Agile Development with ScrumRenzo Borgatti
 
You say Tomato, I say Pomodoro
You say Tomato, I say PomodoroYou say Tomato, I say Pomodoro
You say Tomato, I say PomodoroRenzo Borgatti
 

Plus de Renzo Borgatti (10)

Clojure beasts-euroclj-2014
Clojure beasts-euroclj-2014Clojure beasts-euroclj-2014
Clojure beasts-euroclj-2014
 
Introduzione a macruby
Introduzione a macrubyIntroduzione a macruby
Introduzione a macruby
 
MacRuby For Ruby Developers
MacRuby For Ruby DevelopersMacRuby For Ruby Developers
MacRuby For Ruby Developers
 
Lavorare Da Remoto
Lavorare Da RemotoLavorare Da Remoto
Lavorare Da Remoto
 
You Say Tomato I Say Pomodoro
You Say Tomato I Say PomodoroYou Say Tomato I Say Pomodoro
You Say Tomato I Say Pomodoro
 
Agile Pomodoro Development
Agile Pomodoro DevelopmentAgile Pomodoro Development
Agile Pomodoro Development
 
Writing Apps with HotCocoa and MacRuby
Writing Apps with HotCocoa and MacRubyWriting Apps with HotCocoa and MacRuby
Writing Apps with HotCocoa and MacRuby
 
Introduction to Agile Development with Scrum
Introduction to Agile Development with ScrumIntroduction to Agile Development with Scrum
Introduction to Agile Development with Scrum
 
You say Tomato, I say Pomodoro
You say Tomato, I say PomodoroYou say Tomato, I say Pomodoro
You say Tomato, I say Pomodoro
 
Ruby BDD for Java
Ruby BDD for JavaRuby BDD for Java
Ruby BDD for Java
 

Dernier

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Dernier (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 

Introduction to Clojure

  • 1. Introduction To Clojure BBC lunch & learn, July 18th 2012 Renzo Borgatti, Developer in Test, A/V Team Welcome to this introduction to the Clojure language. Clojure had a lot of attraction lately as well other well known languages based on the functional paradigm like Erlang or inspired from the functional paradigm like Scala. There is definitely a reason for the return of the functional paradigm nowadays that we are going to explain briefly in this talk. My name is Renzo Borgatti, blah blah
  • 2. the functional re-emergence roots in λ-calculus 1930 re-discovered with Lisp 1958 The functional paradigm has its root in the Lambda calculus, a method for notations and manipulation of mathematical functions introduced by Alonso Church around 1930. Lambda calculus was then rediscovered as a versatile programming tool by McCarthy in 1958 when Lisp was introduced as a programming language able to deal with mathematical notation.
  • 3. Moore’s failure for cpu clock but cpu density growing fast software is the new bottleneck need to design for concurrency Moore’s law recently failed on one of its axis. CPU speed is not doubling or tripling every year anymore. It used to be the case in the late ’90. But the demand of computing power is growing as usual. Hardware manufacturer resorted to other means to increase power, such as transistor density. Right now is not uncommon to see cheap laptops sold with 4 cpu cores out of the box. Change on chip density requires a change in software scalability. Software must be written for concurrency to take advantage of multi-core architectures.
  • 4. OOP encapsulates state changes overwrite state state has multiple observers concurrency requires locking locking is complicated Object Oriented Programming confines state using specific language constructs like classes. The Program flows as a series of state changes. When state needs concurrent access it must be protected using locks because there could be multiple computations going on at the same time. A change on the state delete previous values and the history is lost The problem is that “identity” and “values” are overlapping A clear example is a date object. A date is created to hold a value, maybe the the hottest day of the year. If there is a new record this year, that is the new hottest day. But what about the previous one? Why it should be completely replaced by changing the date and removing the information from the system? What about all the threads that were observing the value producing metrics for the old date? Should that information being lost by changing the date instance or should each thread just keep going observing the old value until they decide otherwise? State based languages are hard to understand and to debug. Looking at some method, chances are you can’t be sure until runtime about what that method is supposed to behave in certain condition. Sometimes even at runtime the portion of state influencing the computation is so big that is impossible to handle correctly. Concurrency based on locks is complicated, generating deadlock conditions and all sort of synchronisation issues.
  • 5. Clojure, Scala, F#, Erlang... focus on immutability semantic for changing values “new” model for concurrency Hence why the resurgence of the “old” and “academic” functional model. Why not Lisp or Haskell? Clojure Scala and F# all have in common the fact that they are hosted, so interoperability with known languages it’s easy. Erlang is a special case of non-hosted functional language that became popular. Erlang is very focused on high availability and performs great in that kind of environments.
  • 6. A dynamically-typed jvm-based Lisp dialect Rich Hickey 2007 now 1.4 What about Clojure in specific? Clojure is a relatively young programming language based on Lisp but running on the JVM. It comes out from the frustration of Rich Hickey developing highly concurrent systems as a Java and .NET consultant. Rich Hickey developed dotLisp for the .NET environment before Clojure. He spent then 2.5 years designing and implementing Clojure. Clojure was officially announced in 2007.
  • 7. interactive hosted dynamic it’s a Lisp functional concurrent These are the main Clojure design principles. Clojure is a “consenting adults” language. It sits someway between the functional pureness of Haskell and the lazy-evaluate-everything of Scheme. Checking for functions that aren’t pure in Clojure is technically possible, but that will make more than half of the JDK or CLR unusable.
  • 8. interactive REPL read-eval-print loop suitable for exploration introspection capabilities fast development loop demo Show off REPL in action: - repl special variables *1 *2 *3 etc - the content of (pst) after an exception - doc searching and print sources - (find-doc “some”) - (use ‘clojure.repl) (source func)
  • 9. hosted built with Java interop in mind use Java directly no wrappers lots of syntatic sugar demo - java interop demo - (filter #(re-seq #"pper" (.getName %)) (seq (.getMethods String))) - (import 'java.util.Date) (def now (Date.)) - (.. "" getClass getMethods)
  • 10. dynamic less ceremony: speed concise: where’s my code ~1:1 ratio sudocode real code Clojure is dynamic in two ways. It’s dynamically typed, so it doesn’t specify types. Explicit typing would be more useful for a language that at compile time can check if the current functions are producing side effects and issue warnings. For Clojure dynamic typing means to be more concise and more flexible. Second, Clojure it’s dynamic in the way programmers can approach development with it: firing up a REPL, test live code that gets automatically re-evaluated (when needed) and tweak the main program on the go. Less ceremony means speed: less code to type, less potential bugs, code is more readable. Conciseness measures the quantity of code needed to express a “task” in the language. When the language is concise it’s easier for the programmer to focus on business logic. Potentially a 1:1 ratio between sudocode and the actual code would be ideal.
  • 11. dynamic by the way, not this kind... ...of expressiveness! That’s the APL one liner for the game of life. http://catpad.net/michael/apl/
  • 12. dynamic but instead of something like This is the isBlank static method in StringUtils from Apache commons. I have a quiz for you. I removed the name of the method. By reading the java and the clojure version of the same behaviour, could you tell what the method is actually doing? If yes, was the Java or the Clojure version more helpful?
  • 13. It’s a Lisp homoiconic data as code powerful macro programming define new syntax demo In Clojure everything that the compiler sees are just data structure although there is some syntactic sugar to make it easier to program. But before the compiler there is a Reader in Clojure which transforms the textual input into data structures. Homoiconic means just that, that everything is a data structure. Why this is important? Because the syntax is much simpler and more abstract constructs can be built in term of a bunch of primitives. It also make it easier for macro programming. Macros are special constructs which are interpreted by the reader and will influence the final output which is going to the compiler. With Macros you can effectively extend the language. Clojure “when”, “for” or syntax like the arrow operator “->” are effectively macros. (macroexpand '(when (= "a" "a") (def renzo ", renzo") (str "this is also true" renzo))) (macroexpand '(for [x (range 10)] (str x)))
  • 14. functional focus on immutability side-effects free functions caching and laziness “consenting adults” pureness Finally, Clojure is functional. It should be already clear at this point of the presentation. Clojure main data structures are immutable, requiring a specific semantic to be altered. Being functional means that the output of a function can only be influenced by its inputs. The parameters must hence be immutable. If they were mutable then the function would have a chance to be impure by altering them. When a function is pure there are no side effects so it is producing repeatable results which are independent from the state of the system. Repeatable means caching can be implemented easily. Laziness follows because there is no need to “render” the result of a function until it’s actually needed. Laziness means more optimisation opportunities for the compiler. Clojure always allows you to skip all of that and introduce side effects all around. It does not have the assignment operator though.
  • 15. concurrent immutable core data structures constrained change semantic atom, ref, agent, var demo Clojure has been built with a focus on concurrency. Main data structures are immutable requiring special semantic to be altered. There are four types of clojure construct to alter immutable structures. Atoms are simple CAS (compare and swap) semantic. You create an atom and then you can change it by just calling swap! on it passing the function that should alter the content of the atom. The swap! will succeed or not, based on a comparison with the current value in the atom. If the value is changed by another thread in the middle, the swap! will be attempted again over the new value. Needless to say, the altering function needs to be side effects free. Atoms cannot coordinate over multiple values. You need Refs for that. A ref is similar to a database transaction. You need to open a transaction before attempting to change any of the Refs. Transactions can be attempt an arbitrary number of times. Agents are similar to Atoms in the sense that they are uncoordinated. But an action sent to an Agent will be executed at some later point in time, on a thread pool. Vars is thread-local state that can be altered by using the (binding) form. They can be used where too many repeating parameters are unpractical (like Java).
  • 16. Clojure is not a replacement not just for list comprehension radical approach steeper learning curve what about all those parenthesis? Clojure has not been built to be a replacement for Java as other languages. It was built with imperative and state based languages drawbacks to solve the problem entirely. Another thing that is valid for all functionally inspired languages is that the functional paradigm is not about having functions as variables that can be sent around and used on collections. Ruby and Python aren’t certainly functional but they are heavily based on closures (aka lambdas). Scala is more functional in this respect but it allows assignment and support object orientation with instance variables that are clearly used to obtain side effects. If you come from another paradigm and usually programming in Java the Clojure learning curve will be probably steeper than Groovy or Scala. Java people tend to try to match parenthesis as soon as they see them. Brackets mostly delimit scope and give structure to the code. Lispers don’t need to match parenthesis.
  • 17. Who is using Clojure? The always evolving lists: http://dev.clojure.org/display/community/Clojure+Success+Stories http://www.quora.com/Whos-using-Clojure-in-production
  • 18. Clojure is a good hiring tool attract smart people diversify company mindset There is an higher probability to attract the Lisp community with Clojure than Scala. The Lisp community includes a very fine selected crowd of people who must have been in deeply love with their language if they remained outside the mainstream languages for something like half a century! Apart from jokes, the average mathematical and algorithmic background of the Lisp community is very high and a nice addition for you team. An useful link: the london clojurians jobs page (requires to join the mailing list): - https://groups.google.com/forum/?fromgroups#!forum/london-clojurian-jobs
  • 19. Scala Clojure type system change semantic models complicated type system clever sequences actor concurrency no objects good java interops harder to recruit friendly java syntax top-notch java interops object/functional steeper learning curve Lisp community The not-definitive Scala to Clojure comparison chart in no specific order of priority. The two languages have completely different philosophies but the impression is that at the end they have more in common than expected. There are hiring and people factors to consider when choosing one or the other. Clojure is a radical approach that refuses objects as the main tool to model the world, especially a concurrent world. Scala embraces both styles and let object oriented developers depart from the paradigm when needed. The choice between the two language is almost impossible to make outside a specific context. They both have pro and cons that compensate each other on an absolute scale. What should not happen in both cases is that you choose the language because you can “send methods to collections and around”. There is much more about the functional paradigm that has nothing to do with closures.
  • 20. General resources the main clojure website: http://www.clojure.org easily browsable documentation: http://clojuredocs.org the london clojure dojo and group: http://londonclojurians.org who is using Clojure? http://dev.clojure.org/display/community/Clojure+Success+Stories paper introducing lamda calculus to programmers: http://www.cs.bham.ac.uk/~axj/pub/papers/lambda-calculus.pdf introducing clojure in the organization: http://blog.jayfields.com/2012/01/lessons-learned-while-introducing-new.html
  • 21. BBC resources The BBC clojure weekly dojo, every Thu 12:30 van gogh: https://confluence.dev.bbc.co.uk/display/~renzo.borgatti@bbc.co.uk/clojure-ug BBC Clojure forge mailing list: https://lists.forge.bbc.co.uk/mailman/listinfo/clojure BBC Clojure forge IRC channel: #clojure
  • 22. Talk Slides PDF available here: https://confluence.dev.bbc.co.uk/display/~renzo.borgatti@bbc.co.uk/clojure-ug Please rate my talk: sdfdfd Video will be available soon
  • 25. if Java had closures today (they’ll be in Java 8) would you still consider Scala or Groovy? Is it still worth learning a new language for that only?
  • 26. (let [audience people-present-today] (map #(str “THANK YOU, ” %) audience))