Skip to content

Latest commit

 

History

History
97 lines (91 loc) · 3.43 KB

skeleton.org

File metadata and controls

97 lines (91 loc) · 3.43 KB

Skeleton of the workshop

Summary

SectionDuration (h)Timing
Get your hands dirty209:30-11:30
Tea Break0.511:30-12:00
Intro0.512:00-12:30
Persistent data structures112:30-01:30
Lunch101:30-02:30
Collections continued1.502:30-04:00
(Day 2) Solve a problem5.59:30-04:00
- Modelling
- Java Interop
- Concurrency and Parallelism
- Macros

Day 1

Get your hands dirty [2h] [9:30-11:30]

  1. Intro [45m] [9:30-10:15] [srihari]
    • Emacs, Leiningen, Cider, Paredit
    • Arithmetic (numerics, rational)
    • Symbols, Keywords, Vars
    • Booleans, Strings
    • metadata, nil punning
    • Control structures
    • Bindings
    • Vectors
    • Destructuring
  2. Functions [45m] [10:15-11:00] [abnv]
    • syntax, defining and calling functions
    • multiple argument
    • docstring
    • mutli-arity
    • varargs
    • destructuring args
    • contracts
    • recursion
    • higher order function: map, filter, reduce
    • anonymous functions
    • partial application
    • composing functions - comp, juxt
    • closures
  3. Excercise [0.5h] [11:00-11:30]

Tea Break [0.5h] [11:30-12:00]

Intro [0.5h] [12:00-12:30] [srihari]

  • The Lisp philosophy
  • The Clojure philosophy (fp, simplicity, jvm, immutability)
  • Contrast with other JVM languages (Java, JRuby)
  • Clojure community, libraries and books
  • Where to find help

Clojure’s persistent data structures [1h]

  1. Sequences (lists and vectors) [1h] [12:30-1:30] [govind]
    • Create and manipulate sequences (map, filter, reduce)
    • Laziness (infinite sequences, utilizing laziness)
    • Immutability with persistent data structures (trie)

Lunch [1:30-2:30]

[unni]

Clojure’s persistent data structures continued [1.5h]

  1. Maps and Sets [1h] [2:30-3:30] [unni]
    • Create and manipulate maps and sets
    • How to use maps and sets idiomatically
  2. Excercise [0.5h] [3:30-4:00]

Day 2

Some practical examples

  • Working with libraries
  • require/import
  • read/load/compile and how it works
  • Read from the filesystem, parse json, etc

Modeling

  • Proper use of maps, vectors and schema to model the domain
  • Horizontal layering and vertical partitioning of code using namespaces
  • Create and extend abstractions with Multimethods, Protocols, and Records
  • Connect code and configs to build up a final app

Java interop

  • Calling java code (like java.util.concurrent classes or jsoup) from clojure
  • Type hinting
  • Extending java code in clojure

Concurrency and parallelism

  • pmap
  • futures, promises
  • java.util.concurrent utilities
  • Concurrency primitives in clojure (atom, agent, var, ref)

Macros

  • A couple of very simple macros to give a feel for manipulating code as data

Spec

  • A couple of very simple examples to demonstrate clojure.spec

Getting things done

  • When to use clojure, when not to.
  • Popular libraries
    • ring, schema, honeysql, compojure, etc