SlideShare a Scribd company logo
  Programming Language Nerd

  Co-founder & CTO, Infinitely Beta

  Clojure programmer since the early
   days

  Curator of Planet Clojure

  Author of “Clojure in Practice” (ETA
   Sep, 2011)
  History             Metadata

  Data Structures     Java Inter-op

  Syntax              Concurrency

  Functions           Multi-methods

  Sequences           Macros

  Namespaces          Clojure Contrib
  Created by Rich Hickey in
   2007
  Open Sourced in 2008
  First large deployment in Jan,
   2009

  Second in Apr, same year
  We’ve come a long way since
   then!
  Programming languages      OO is overrated
   haven’t really changed
   much                       Polymorphism is good

  Creating large-scale,      Multi-core is the future
   concurrent software is
   still hard                 VMs are the next-gen
                               platforms
  Functional Programming
   rocks                      Ecosystem matters

  Lisp is super power        Dynamic development
  Numbers 1	
  3.14	
  22/7	
       Characters a	
  b	
  c	
  
  Booleans true	
  false	
          Comments ;;	
  Ignore	
  

  Strings “foobar”	
                Nothing nil	
  
  Symbols thisfn	
  

  Keywords :this	
  :that	
  
  RegEx Patterns #“[a-­‐zA-­‐
    Z0-­‐9]+”	
  
  Lists (1	
  2	
  3)	
  (list	
  “foo”	
  “bar”	
  “baz”)	
  

  Vectors [1	
  2	
  3]	
  (vector	
  “foo”	
  “bar”	
  “baz”)	
  

  Maps {:x	
  1,	
  :y	
  2}	
  (hash-­‐map	
  :foo	
  1	
  :bar	
  2)	
  

  Sets #{a	
  e	
  i	
  o	
  u}	
  (hash-­‐set	
  “cat”	
  “dog”)	
  
  There is no other syntax!
  Data structures are the code
  No other text based syntax, only different
   interpretations
  Everything is an expression (s-exp)
  All data literals stand for themselves, except symbols &
   lists
  Function calls (function	
  arguments*)	
  


(def	
  hello	
  (fn	
  []	
  “Hello,	
  world!”))	
  
-­‐>	
  #’user/hello	
  
(hello)	
  
-­‐>	
  “Hello,	
  world!”	
  

(defn	
  hello	
  
	
  	
  ([]	
  (hello	
  “world”))	
  
	
  	
  ([name]	
  (str	
  “Hello,	
  ”	
  name	
  “!”)))	
  
“It is better to have 100 functions operate on one data structure
             than 10 functions on 10 data-structures.”
                          Alan J. Perlis
  An abstraction over traditional Lisp lists

  Provides an uniform way of walking through different
   data-structures

  Sample sequence functions seq	
  first	
  rest	
  filter	
  
    remove	
  for	
  partition	
  reverse	
  sort	
  map	
  reduce	
  doseq
  Analogous to Java packages, but with added dynamism

  A mapping of symbols to actual vars/classes

  Can be queried and modified dynamically

  Usually manipulated via the ns macro
  Data about data

  Can annotate any symbol or collection

  Mainly used by developers to mark data structures with
   some special information

  Clojure itself uses it heavily

(def	
  x	
  (with-­‐meta	
  {:x	
  1}	
  {:source	
  :provider-­‐1}))	
  
-­‐>	
  #’user/x	
  
(meta	
  x)	
  
-­‐>	
  {:source	
  :provider-­‐1}	
  
  Wrapper free interface to Java
  Syntactic sugar makes calling Java easy & readable
  Core Clojure abstractions are Java interfaces (will
   change)
  Clojure functions implement Callable & Runnable
  Clojure sequence lib works with Java iterables
  Near native speed
(ClassName.	
  args*)	
  
(instanceMember	
  instance	
  args*)	
  
(ClassName/staticMethod	
  args*)	
  
ClassName/STATIC_FIELD	
  

(.toUpperCase	
  “clojure”)	
  
-­‐>	
  “CLOJURE”	
  
(System/getProperty	
  “java.vm.version”)	
  
-­‐>	
  “16.3-­‐b01-­‐279”	
  
Math/PI	
  
-­‐>	
  3.14…	
  
(..	
  System	
  (getProperties)	
  (get	
  “os.name”))	
  
-­‐>	
  “Mac	
  OS	
  X”	
  
  A technique of doing structural binding in a function
   arg list or let binding



(defn	
  list-­‐xyz	
  [xyz-­‐map]	
  
	
  	
  (list	
  (:x	
  xyz-­‐map)	
  (:y	
  xyz-­‐map)	
  (:z	
  xyz-­‐map)))	
  

(list-­‐xyz	
  {:x	
  1,	
  :y	
  2	
  :z	
  3})	
  
-­‐>	
  (1	
  2	
  3)	
  
//	
  From	
  Apache	
  Commons	
  Lang,	
  http://commons.apache.org/lang/	
  
	
  	
  public	
  static	
  int	
  indexOfAny(String	
  str,	
  char[]	
  searchChars)	
  {	
  
	
  	
  	
  	
  	
  	
  if	
  (isEmpty(str)	
  ||	
  ArrayUtils.isEmpty(searchChars))	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  return	
  -­‐1;	
  
	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  for	
  (int	
  i	
  =	
  0;	
  i	
  <	
  str.length();	
  i++)	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  char	
  ch	
  =	
  str.charAt(i);	
  
	
  	
  	
  	
  	
  	
  	
  	
  for	
  (int	
  j	
  =	
  0;	
  j	
  <	
  searchChars.length;	
  j++)	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  if	
  (searchChars[j]	
  ==	
  ch)	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  return	
  i;	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  return	
  -­‐1;	
  
	
  	
  }	
  
(defn	
  indexed	
  [coll]	
  (map	
  vector	
  (iterate	
  inc	
  0)	
  coll))	
  
(defn	
  indexed	
  [coll]	
  (map	
  vector	
  (iterate	
  inc	
  0)	
  coll))	
  

(defn	
  index-­‐filter	
  [pred	
  coll]	
  
	
  	
  	
  	
  (for	
  [[idx	
  elt]	
  (indexed	
  coll)	
  :when	
  (pred	
  elt)]	
  
	
  	
  	
  	
  	
  	
  idx))	
  
(defn	
  indexed	
  [coll]	
  (map	
  vector	
  (iterate	
  inc	
  0)	
  coll))	
  

(defn	
  index-­‐filter	
  [pred	
  coll]	
  
	
  	
  	
  	
  (when	
  pred	
  	
  
	
  	
  	
  	
  	
  	
  (for	
  [[idx	
  elt]	
  (indexed	
  coll)	
  :when	
  (pred	
  elt)]	
  idx)))	
  

(index-­‐filter	
  #{a	
  e	
  i	
  o	
  o}	
  "The	
  quick	
  brown	
  fox")	
  
-­‐>	
  (2	
  6	
  12	
  17)	
  

(index-­‐filter	
  #(>	
  (.length	
  %)	
  3)	
  ["The"	
  "quick"	
  "brown"	
  "fox"])	
  
-­‐>	
  (1	
  2)	
  
for	
   doseq	
   if	
   cond	
   condp	
   partition	
   loop	
   recur	
   str	
   map	
  
reduce	
   filter	
   defmacro	
   apply	
   comp	
   complement	
  	
  
defstruct	
   drop	
   drop-­‐last	
   drop-­‐while	
   format	
   iterate	
  
juxt	
   map	
   mapcat	
   memoize	
   merge	
   partial	
   partition	
  
partition-­‐all	
   re-­‐seq	
   reductions	
   reduce	
   remove	
   repeat	
  
repeatedly	
  zipmap	
  
  Simultaneous execution

  Avoid reading; yielding inconsistent data

                      Synchronous    Asynchronous
      Coordinated     ref	
  
      Independent     atom	
         agent	
  
      Unshared        var	
  
  Generalised indirect dispatch

  Dispatch on an arbitrary function of the arguments

  Call sequence
     Call dispatch function on args to get dispatch value
     Find method associated with dispatch value
        Else call default method
        Else error
  Encapsulation through closures

  Polymorphism through multi-methods

  Inheritance through duck-typing
(defmulti	
  interest	
  :type)	
  
(defmethod	
  interest	
  :checking	
  [a]	
  0)	
  
(defmethod	
  interest	
  :savings	
  [a]	
  0.05)	
  

(defmulti	
  service-­‐charge	
  	
  
	
  	
  	
  	
  (fn	
  [acct]	
  [(account-­‐level	
  acct)	
  (:tag	
  acct)]))	
  
(defmethod	
  service-­‐charge	
  [::Basic	
  ::Checking]	
  	
  	
  [_]	
  25)	
  	
  
(defmethod	
  service-­‐charge	
  [::Basic	
  ::Savings]	
  	
  	
  	
  [_]	
  10)	
  
(defmethod	
  service-­‐charge	
  [::Premium	
  ::Checking]	
  [_]	
  0)	
  
(defmethod	
  service-­‐charge	
  [::Premium	
  ::Savings]	
  	
  [_]	
  0)	
  
  A facility to extend the compiler with user code

  Used to define syntactic constructs which would
   otherwise require primitives/built-in support


 (try-­‐or	
  
 	
  	
  (/	
  1	
  0)	
  
 	
  	
  (reduce	
  +	
  [1	
  2	
  3	
  4])	
  
 	
  	
  (partition	
  (range	
  10)	
  2)	
  
 	
  	
  (map	
  +	
  [1	
  2	
  3	
  4]))	
  	
  
  clojure.contrib.http.agent

  clojure.contrib.io

  clojure.contrib.json

  clojure.contrib.seq-utils

  clojure.contrib.pprint

  clojure.contrib.string
  Compojure          Cascalog

  ClojureQL          Enlive

  Incanter           Congomongo

  Leiningen          Pallet

  FleetDB            Many more!

  clojure-hadoop
  Clojure http://clojure.org

  Clojure group http://bit.ly/clojure-group

  IRC #clojure on irc.freenode.net

  Source http://github.com/clojure

  Wikibook http://bit.ly/clojure-wikibook
http://infinitelybeta.com/jobs/
Pune Clojure Course Outline
Pune Clojure Course Outline

More Related Content

What's hot

Demystifying functional programming with Scala
Demystifying functional programming with ScalaDemystifying functional programming with Scala
Demystifying functional programming with Scala
Denis
 
Scala - where objects and functions meet
Scala - where objects and functions meetScala - where objects and functions meet
Scala - where objects and functions meetMario Fusco
 
If You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are WrongIf You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are WrongMario Fusco
 
Clojure for Data Science
Clojure for Data ScienceClojure for Data Science
Clojure for Data Science
Mike Anderson
 
From Lisp to Clojure/Incanter and RAn Introduction
From Lisp to Clojure/Incanter and RAn IntroductionFrom Lisp to Clojure/Incanter and RAn Introduction
From Lisp to Clojure/Incanter and RAn Introductionelliando dias
 
Enter The Matrix
Enter The MatrixEnter The Matrix
Enter The Matrix
Mike Anderson
 
MTL Versus Free
MTL Versus FreeMTL Versus Free
MTL Versus Free
John De Goes
 
Hey! There's OCaml in my Rust!
Hey! There's OCaml in my Rust!Hey! There's OCaml in my Rust!
Hey! There's OCaml in my Rust!
Kel Cecil
 
Collections forceawakens
Collections forceawakensCollections forceawakens
Collections forceawakens
RichardWarburton
 
The Easy-Peasy-Lemon-Squeezy, Statically-Typed, Purely Functional Programming...
The Easy-Peasy-Lemon-Squeezy, Statically-Typed, Purely Functional Programming...The Easy-Peasy-Lemon-Squeezy, Statically-Typed, Purely Functional Programming...
The Easy-Peasy-Lemon-Squeezy, Statically-Typed, Purely Functional Programming...
John De Goes
 
All Aboard The Scala-to-PureScript Express!
All Aboard The Scala-to-PureScript Express!All Aboard The Scala-to-PureScript Express!
All Aboard The Scala-to-PureScript Express!
John De Goes
 
Functional Algebra: Monoids Applied
Functional Algebra: Monoids AppliedFunctional Algebra: Monoids Applied
Functional Algebra: Monoids Applied
Susan Potter
 
Optimizing Tcl Bytecode
Optimizing Tcl BytecodeOptimizing Tcl Bytecode
Optimizing Tcl BytecodeDonal Fellows
 
Spark 4th Meetup Londond - Building a Product with Spark
Spark 4th Meetup Londond - Building a Product with SparkSpark 4th Meetup Londond - Building a Product with Spark
Spark 4th Meetup Londond - Building a Product with Spark
samthemonad
 
Clojure for Data Science
Clojure for Data ScienceClojure for Data Science
Clojure for Data Science
henrygarner
 
Making an Object System with Tcl 8.5
Making an Object System with Tcl 8.5Making an Object System with Tcl 8.5
Making an Object System with Tcl 8.5
Donal Fellows
 
Comparing JVM languages
Comparing JVM languagesComparing JVM languages
Comparing JVM languages
Jose Manuel Ortega Candel
 
Sneaking inside Kotlin features
Sneaking inside Kotlin featuresSneaking inside Kotlin features
Sneaking inside Kotlin features
Chandra Sekhar Nayak
 
Haskell in the Real World
Haskell in the Real WorldHaskell in the Real World
Haskell in the Real World
osfameron
 

What's hot (20)

Demystifying functional programming with Scala
Demystifying functional programming with ScalaDemystifying functional programming with Scala
Demystifying functional programming with Scala
 
Scala - where objects and functions meet
Scala - where objects and functions meetScala - where objects and functions meet
Scala - where objects and functions meet
 
If You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are WrongIf You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are Wrong
 
Clojure for Data Science
Clojure for Data ScienceClojure for Data Science
Clojure for Data Science
 
From Lisp to Clojure/Incanter and RAn Introduction
From Lisp to Clojure/Incanter and RAn IntroductionFrom Lisp to Clojure/Incanter and RAn Introduction
From Lisp to Clojure/Incanter and RAn Introduction
 
Enter The Matrix
Enter The MatrixEnter The Matrix
Enter The Matrix
 
MTL Versus Free
MTL Versus FreeMTL Versus Free
MTL Versus Free
 
Hey! There's OCaml in my Rust!
Hey! There's OCaml in my Rust!Hey! There's OCaml in my Rust!
Hey! There's OCaml in my Rust!
 
Collections forceawakens
Collections forceawakensCollections forceawakens
Collections forceawakens
 
Clojure class
Clojure classClojure class
Clojure class
 
The Easy-Peasy-Lemon-Squeezy, Statically-Typed, Purely Functional Programming...
The Easy-Peasy-Lemon-Squeezy, Statically-Typed, Purely Functional Programming...The Easy-Peasy-Lemon-Squeezy, Statically-Typed, Purely Functional Programming...
The Easy-Peasy-Lemon-Squeezy, Statically-Typed, Purely Functional Programming...
 
All Aboard The Scala-to-PureScript Express!
All Aboard The Scala-to-PureScript Express!All Aboard The Scala-to-PureScript Express!
All Aboard The Scala-to-PureScript Express!
 
Functional Algebra: Monoids Applied
Functional Algebra: Monoids AppliedFunctional Algebra: Monoids Applied
Functional Algebra: Monoids Applied
 
Optimizing Tcl Bytecode
Optimizing Tcl BytecodeOptimizing Tcl Bytecode
Optimizing Tcl Bytecode
 
Spark 4th Meetup Londond - Building a Product with Spark
Spark 4th Meetup Londond - Building a Product with SparkSpark 4th Meetup Londond - Building a Product with Spark
Spark 4th Meetup Londond - Building a Product with Spark
 
Clojure for Data Science
Clojure for Data ScienceClojure for Data Science
Clojure for Data Science
 
Making an Object System with Tcl 8.5
Making an Object System with Tcl 8.5Making an Object System with Tcl 8.5
Making an Object System with Tcl 8.5
 
Comparing JVM languages
Comparing JVM languagesComparing JVM languages
Comparing JVM languages
 
Sneaking inside Kotlin features
Sneaking inside Kotlin featuresSneaking inside Kotlin features
Sneaking inside Kotlin features
 
Haskell in the Real World
Haskell in the Real WorldHaskell in the Real World
Haskell in the Real World
 

Similar to Pune Clojure Course Outline

Full Stack Clojure
Full Stack ClojureFull Stack Clojure
Full Stack Clojure
Michiel Borkent
 
Getting started with Clojure
Getting started with ClojureGetting started with Clojure
Getting started with Clojure
John Stevenson
 
ClojureScript for the web
ClojureScript for the webClojureScript for the web
ClojureScript for the web
Michiel Borkent
 
Exploring Clojurescript
Exploring ClojurescriptExploring Clojurescript
Exploring Clojurescript
Luke Donnet
 
Introduction to clojure
Introduction to clojureIntroduction to clojure
Introduction to clojure
Abbas Raza
 
The Curious Clojurist - Neal Ford (Thoughtworks)
The Curious Clojurist - Neal Ford (Thoughtworks)The Curious Clojurist - Neal Ford (Thoughtworks)
The Curious Clojurist - Neal Ford (Thoughtworks)
jaxLondonConference
 
ClojureScript loves React, DomCode May 26 2015
ClojureScript loves React, DomCode May 26 2015ClojureScript loves React, DomCode May 26 2015
ClojureScript loves React, DomCode May 26 2015
Michiel Borkent
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with ClojureDmitry Buzdin
 
(map Clojure everyday-tasks)
(map Clojure everyday-tasks)(map Clojure everyday-tasks)
(map Clojure everyday-tasks)
Jacek Laskowski
 
(first '(Clojure.))
(first '(Clojure.))(first '(Clojure.))
(first '(Clojure.))
niklal
 
Scala clojure techday_2011
Scala clojure techday_2011Scala clojure techday_2011
Scala clojure techday_2011
Thadeu Russo
 
Introduction to R
Introduction to RIntroduction to R
Introduction to Ragnonchik
 
Real Time Big Data Management
Real Time Big Data ManagementReal Time Big Data Management
Real Time Big Data Management
Albert Bifet
 
Леонид Шевцов «Clojure в деле»
Леонид Шевцов «Clojure в деле»Леонид Шевцов «Clojure в деле»
Леонид Шевцов «Clojure в деле»
DataArt
 
Clojure And Swing
Clojure And SwingClojure And Swing
Clojure And Swing
Skills Matter
 
Clojure made-simple - John Stevenson
Clojure made-simple - John StevensonClojure made-simple - John Stevenson
Clojure made-simple - John Stevenson
JAX London
 
(How) can we benefit from adopting scala?
(How) can we benefit from adopting scala?(How) can we benefit from adopting scala?
(How) can we benefit from adopting scala?Tomasz Wrobel
 
C# programming
C# programming C# programming
C# programming
umesh patil
 

Similar to Pune Clojure Course Outline (20)

Full Stack Clojure
Full Stack ClojureFull Stack Clojure
Full Stack Clojure
 
Getting started with Clojure
Getting started with ClojureGetting started with Clojure
Getting started with Clojure
 
ClojureScript for the web
ClojureScript for the webClojureScript for the web
ClojureScript for the web
 
Exploring Clojurescript
Exploring ClojurescriptExploring Clojurescript
Exploring Clojurescript
 
Introduction to clojure
Introduction to clojureIntroduction to clojure
Introduction to clojure
 
The Curious Clojurist - Neal Ford (Thoughtworks)
The Curious Clojurist - Neal Ford (Thoughtworks)The Curious Clojurist - Neal Ford (Thoughtworks)
The Curious Clojurist - Neal Ford (Thoughtworks)
 
ClojureScript loves React, DomCode May 26 2015
ClojureScript loves React, DomCode May 26 2015ClojureScript loves React, DomCode May 26 2015
ClojureScript loves React, DomCode May 26 2015
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
 
(map Clojure everyday-tasks)
(map Clojure everyday-tasks)(map Clojure everyday-tasks)
(map Clojure everyday-tasks)
 
(first '(Clojure.))
(first '(Clojure.))(first '(Clojure.))
(first '(Clojure.))
 
Scala clojure techday_2011
Scala clojure techday_2011Scala clojure techday_2011
Scala clojure techday_2011
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
 
Java
JavaJava
Java
 
Real Time Big Data Management
Real Time Big Data ManagementReal Time Big Data Management
Real Time Big Data Management
 
Clojure intro
Clojure introClojure intro
Clojure intro
 
Леонид Шевцов «Clojure в деле»
Леонид Шевцов «Clojure в деле»Леонид Шевцов «Clojure в деле»
Леонид Шевцов «Clojure в деле»
 
Clojure And Swing
Clojure And SwingClojure And Swing
Clojure And Swing
 
Clojure made-simple - John Stevenson
Clojure made-simple - John StevensonClojure made-simple - John Stevenson
Clojure made-simple - John Stevenson
 
(How) can we benefit from adopting scala?
(How) can we benefit from adopting scala?(How) can we benefit from adopting scala?
(How) can we benefit from adopting scala?
 
C# programming
C# programming C# programming
C# programming
 

Recently uploaded

Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 

Recently uploaded (20)

Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 

Pune Clojure Course Outline

  • 1.
  • 2.
  • 3.   Programming Language Nerd   Co-founder & CTO, Infinitely Beta   Clojure programmer since the early days   Curator of Planet Clojure   Author of “Clojure in Practice” (ETA Sep, 2011)
  • 4.   History   Metadata   Data Structures   Java Inter-op   Syntax   Concurrency   Functions   Multi-methods   Sequences   Macros   Namespaces   Clojure Contrib
  • 5.   Created by Rich Hickey in 2007   Open Sourced in 2008   First large deployment in Jan, 2009   Second in Apr, same year   We’ve come a long way since then!
  • 6.   Programming languages   OO is overrated haven’t really changed much   Polymorphism is good   Creating large-scale,   Multi-core is the future concurrent software is still hard   VMs are the next-gen platforms   Functional Programming rocks   Ecosystem matters   Lisp is super power   Dynamic development
  • 7.   Numbers 1  3.14  22/7     Characters a  b  c     Booleans true  false     Comments ;;  Ignore     Strings “foobar”     Nothing nil     Symbols thisfn     Keywords :this  :that     RegEx Patterns #“[a-­‐zA-­‐ Z0-­‐9]+”  
  • 8.   Lists (1  2  3)  (list  “foo”  “bar”  “baz”)     Vectors [1  2  3]  (vector  “foo”  “bar”  “baz”)     Maps {:x  1,  :y  2}  (hash-­‐map  :foo  1  :bar  2)     Sets #{a  e  i  o  u}  (hash-­‐set  “cat”  “dog”)  
  • 9.   There is no other syntax!   Data structures are the code   No other text based syntax, only different interpretations   Everything is an expression (s-exp)   All data literals stand for themselves, except symbols & lists
  • 10.   Function calls (function  arguments*)   (def  hello  (fn  []  “Hello,  world!”))   -­‐>  #’user/hello   (hello)   -­‐>  “Hello,  world!”   (defn  hello      ([]  (hello  “world”))      ([name]  (str  “Hello,  ”  name  “!”)))  
  • 11. “It is better to have 100 functions operate on one data structure than 10 functions on 10 data-structures.” Alan J. Perlis
  • 12.   An abstraction over traditional Lisp lists   Provides an uniform way of walking through different data-structures   Sample sequence functions seq  first  rest  filter   remove  for  partition  reverse  sort  map  reduce  doseq
  • 13.   Analogous to Java packages, but with added dynamism   A mapping of symbols to actual vars/classes   Can be queried and modified dynamically   Usually manipulated via the ns macro
  • 14.   Data about data   Can annotate any symbol or collection   Mainly used by developers to mark data structures with some special information   Clojure itself uses it heavily (def  x  (with-­‐meta  {:x  1}  {:source  :provider-­‐1}))   -­‐>  #’user/x   (meta  x)   -­‐>  {:source  :provider-­‐1}  
  • 15.   Wrapper free interface to Java   Syntactic sugar makes calling Java easy & readable   Core Clojure abstractions are Java interfaces (will change)   Clojure functions implement Callable & Runnable   Clojure sequence lib works with Java iterables   Near native speed
  • 16. (ClassName.  args*)   (instanceMember  instance  args*)   (ClassName/staticMethod  args*)   ClassName/STATIC_FIELD   (.toUpperCase  “clojure”)   -­‐>  “CLOJURE”   (System/getProperty  “java.vm.version”)   -­‐>  “16.3-­‐b01-­‐279”   Math/PI   -­‐>  3.14…   (..  System  (getProperties)  (get  “os.name”))   -­‐>  “Mac  OS  X”  
  • 17.   A technique of doing structural binding in a function arg list or let binding (defn  list-­‐xyz  [xyz-­‐map]      (list  (:x  xyz-­‐map)  (:y  xyz-­‐map)  (:z  xyz-­‐map)))   (list-­‐xyz  {:x  1,  :y  2  :z  3})   -­‐>  (1  2  3)  
  • 18. //  From  Apache  Commons  Lang,  http://commons.apache.org/lang/      public  static  int  indexOfAny(String  str,  char[]  searchChars)  {              if  (isEmpty(str)  ||  ArrayUtils.isEmpty(searchChars))  {                  return  -­‐1;              }              for  (int  i  =  0;  i  <  str.length();  i++)  {                  char  ch  =  str.charAt(i);                  for  (int  j  =  0;  j  <  searchChars.length;  j++)  {                      if  (searchChars[j]  ==  ch)  {                          return  i;                      }                  }              }              return  -­‐1;      }  
  • 19. (defn  indexed  [coll]  (map  vector  (iterate  inc  0)  coll))  
  • 20. (defn  indexed  [coll]  (map  vector  (iterate  inc  0)  coll))   (defn  index-­‐filter  [pred  coll]          (for  [[idx  elt]  (indexed  coll)  :when  (pred  elt)]              idx))  
  • 21. (defn  indexed  [coll]  (map  vector  (iterate  inc  0)  coll))   (defn  index-­‐filter  [pred  coll]          (when  pred                (for  [[idx  elt]  (indexed  coll)  :when  (pred  elt)]  idx)))   (index-­‐filter  #{a  e  i  o  o}  "The  quick  brown  fox")   -­‐>  (2  6  12  17)   (index-­‐filter  #(>  (.length  %)  3)  ["The"  "quick"  "brown"  "fox"])   -­‐>  (1  2)  
  • 22. for   doseq   if   cond   condp   partition   loop   recur   str   map   reduce   filter   defmacro   apply   comp   complement     defstruct   drop   drop-­‐last   drop-­‐while   format   iterate   juxt   map   mapcat   memoize   merge   partial   partition   partition-­‐all   re-­‐seq   reductions   reduce   remove   repeat   repeatedly  zipmap  
  • 23.   Simultaneous execution   Avoid reading; yielding inconsistent data Synchronous Asynchronous Coordinated ref   Independent atom   agent   Unshared var  
  • 24.   Generalised indirect dispatch   Dispatch on an arbitrary function of the arguments   Call sequence   Call dispatch function on args to get dispatch value   Find method associated with dispatch value   Else call default method   Else error
  • 25.   Encapsulation through closures   Polymorphism through multi-methods   Inheritance through duck-typing (defmulti  interest  :type)   (defmethod  interest  :checking  [a]  0)   (defmethod  interest  :savings  [a]  0.05)   (defmulti  service-­‐charge            (fn  [acct]  [(account-­‐level  acct)  (:tag  acct)]))   (defmethod  service-­‐charge  [::Basic  ::Checking]      [_]  25)     (defmethod  service-­‐charge  [::Basic  ::Savings]        [_]  10)   (defmethod  service-­‐charge  [::Premium  ::Checking]  [_]  0)   (defmethod  service-­‐charge  [::Premium  ::Savings]    [_]  0)  
  • 26.   A facility to extend the compiler with user code   Used to define syntactic constructs which would otherwise require primitives/built-in support (try-­‐or      (/  1  0)      (reduce  +  [1  2  3  4])      (partition  (range  10)  2)      (map  +  [1  2  3  4]))    
  • 27.   clojure.contrib.http.agent   clojure.contrib.io   clojure.contrib.json   clojure.contrib.seq-utils   clojure.contrib.pprint   clojure.contrib.string
  • 28.   Compojure   Cascalog   ClojureQL   Enlive   Incanter   Congomongo   Leiningen   Pallet   FleetDB   Many more!   clojure-hadoop
  • 29.   Clojure http://clojure.org   Clojure group http://bit.ly/clojure-group   IRC #clojure on irc.freenode.net   Source http://github.com/clojure   Wikibook http://bit.ly/clojure-wikibook