1 of 15

Clojure & Me

2 of 15

Who Am I

  • Tim Washington
  • Software Developer - InterruptSoftware.ca

3 of 15

My Progression

  • OO
  • Design Patterns
  • Language Design
  • Functional Programming

Guiding Principle: maximize expressive power

4 of 15

Concept of Computation

What does it mean to compute?

Me: to compute is an actualization (or concrete version) of a mathematical function.

Alan Turing: his ideas of computation can be found in

  • his contributions to the concept of an algorithm and
  • his description of a turing machine

5 of 15

Algorithm

  • An algorithm is just a step-by-step procedure for calculations.
  • Those steps are expressed as a finite list of well-defined instructions for calculating a function.

6 of 15

Turing Machine (a gross simplification)

A theoretical computer, that

  • i) consumes an infinite ribbon of tape and
  • ii) can perform read and write operations on the tape and
  • iii) alters its own state

The concept is that a Turing machine can calculate anything that is computable, no matter the complexity (ie. anything for which there is a function).

7 of 15

Let's look at 2 programming models and how they address the question of how we should go about computing...

  • Object-Oriented Languages
  • Lisp

8 of 15

OBJECT-ORIENTED

OO is actually a programming paradigm, based on what Alan Kay called the "Actors Model"

  • 1. Everything Is An Object.
  • 2. Objects communicate by sending and receiving messages
  • 3. Objects have their own memory
  • 4. Every object is an instance of a class
  • 5. The class holds the shared behavior for its instances
  • 6. To eval a program list, control is passed to the first object and the remainder is treated as its message.

This definition is derived from early versions of Smalltalk. Rule 6 shows Smalltalk's Lisp heritage

9 of 15

LISP

  • 1. Code is Data. You can think of your source file as an AST that gets loaded into the running system.
  • 2. Functions is a first class object
  • 3. Recursion

10 of 15

Bookkeeping System in Java (OO)

  • XML / Java binding framework
  • XPath module
  • Language Design
  • Custom DSL implementation
  • Custom Shell to run language implementation

11 of 15

Bringing in Clojure (LISP)

s-expressions (code is data) meant I didn't need XML as an extra data transfer language between my systems

  • XML / Java binding framework
  • XPath module

functions and macros removed need for a separate DSL and library

  • Language Design
  • Custom DSL implementation
  • Custom Shell to run language implementation

12 of 15

Other Benefits

Much smaller code size

  • clojure syntax
  • immutable data
  • lazy evaluation
  • dynamic typing
  • concurrency primitives

13 of 15

Compare...

14 of 15

Bkeeping Alpha

15 of 15

Thanks :)