SlideShare a Scribd company logo
(parens
(all(the(way(down)))))

    A web app in pure clojure
Clojure For
Clojure For
   Web Server
   HTML
   Css
   Javascript
   Web Sockets
   Data Transfer
   Deployment
Clojure Scramble
Clojure Scramble
  • A multiplayer game for practicing clojure
Clojure Scramble
  • A multiplayer game for practicing clojure
  • Transform given clojure collection into a new
     one in as many different ways as you can
     using list of permitted values
Clojure Scramble
  • A multiplayer game for practicing clojure
  • Transform given clojure collection into a new
     one in as many different ways as you can
     using list of permitted values

  • Compete against other clojurians for high score
Clojure Scramble
  • A multiplayer game for practicing clojure
  • Transform given clojure collection into a new
     one in as many different ways as you can
     using list of permitted values

  • Compete against other clojurians for high score
  • A work in progress - will launch at
     www.clojurescramble.com soon
Clojure For
Clojure For
   Web Server
   HTML
   Css
   Javascript
   Web Sockets
   Data Transfer
   Deployment
Clojure For
   Web Server      • Noir -   github.com/noir-clojure/noir



   HTML
   Css
   Javascript
   Web Sockets
   Data Transfer
   Deployment
Clojure For
   Web Server      • Noir -   github.com/noir-clojure/noir



   HTML            • Hiccup -      github.com/weavejester/hiccup



   Css
   Javascript
   Web Sockets
   Data Transfer
   Deployment
Clojure For
   Web Server      • Noir -   github.com/noir-clojure/noir



   HTML            • Hiccup -      github.com/weavejester/hiccup



   Css             • Cssgen-       github.com/paraseba/cssgen



   Javascript
   Web Sockets
   Data Transfer
   Deployment
Clojure For
   Web Server      • Noir -   github.com/noir-clojure/noir



   HTML            • Hiccup -      github.com/weavejester/hiccup



   Css             • Cssgen-       github.com/paraseba/cssgen



   Javascript      • Clojurescript -          github.com/clojure/clojurescript



   Web Sockets
   Data Transfer
   Deployment
Clojure For
   Web Server      • Noir -   github.com/noir-clojure/noir



   HTML            • Hiccup -      github.com/weavejester/hiccup



   Css             • Cssgen-       github.com/paraseba/cssgen



   Javascript      • Clojurescript -          github.com/clojure/clojurescript



   Web Sockets     • Web Sockets -            aleph, lamina, noir-async



   Data Transfer
   Deployment
Clojure For
   Web Server      • Noir -   github.com/noir-clojure/noir



   HTML            • Hiccup -      github.com/weavejester/hiccup



   Css             • Cssgen-       github.com/paraseba/cssgen



   Javascript      • Clojurescript -          github.com/clojure/clojurescript



   Web Sockets     • Web Sockets -            aleph, lamina, noir-async



   Data Transfer   • Data Transfer -             strings/reader. outgoing only!



   Deployment
Clojure For
   Web Server      • Noir -   github.com/noir-clojure/noir



   HTML            • Hiccup -      github.com/weavejester/hiccup



   Css             • Cssgen-       github.com/paraseba/cssgen



   Javascript      • Clojurescript -          github.com/clojure/clojurescript



   Web Sockets     • Web Sockets -            aleph, lamina, noir-async



   Data Transfer   • Data Transfer -             strings/reader. outgoing only!



   Deployment      • Leinengen -          superjar. upstart/monit. nginx proxy
Benefits of pure clojure
Benefits of pure clojure
  • No context switching
Benefits of pure clojure
  • No context switching
  • Share server and client code
Benefits of pure clojure
  • No context switching
  • Share server and client code
  • Enabled higher level abstractions
Benefits of pure clojure
  • No context switching
  • Share server and client code
  • Enabled higher level abstractions
  • Avoid web language pitfalls
Benefits of pure clojure
  • No context switching
  • Share server and client code
  • Enabled higher level abstractions
  • Avoid web language pitfalls
  • Everything maps easily to lisp
Clojure MVC
Clojure MVC
 • Namespaces make relationships explicit - good
    for architectural discipline. Control very directly who
    can see who.
Clojure MVC
 • Namespaces make relationships explicit - good
    for architectural discipline. Control very directly who
    can see who.

 • Quarantine state - lots of state inevitable in web
    programming. Can still be minimized compared to
    imperative programming. I’ve used atoms for everything
    so far. Simple updates. Other approaches?
Clojure MVC
 • Namespaces make relationships explicit - good
    for architectural discipline. Control very directly who
    can see who.

 • Quarantine state - lots of state inevitable in web
    programming. Can still be minimized compared to
    imperative programming. I’ve used atoms for everything
    so far. Simple updates. Other approaches?

 • Async events through lamina channels -
    decoupled interactions
Clojure MVC
 • Namespaces make relationships explicit - good
    for architectural discipline. Control very directly who
    can see who.

 • Quarantine state - lots of state inevitable in web
    programming. Can still be minimized compared to
    imperative programming. I’ve used atoms for everything
    so far. Simple updates. Other approaches?

 • Async events through lamina channels -
    decoupled interactions

 • I ended up with a thick ‘manager’ tier - async
    creates responsibilities that don’t fall neatly into mvc
Noir
Noir
 • Lightweight - gives you what you need. Server start
    (server.clj), routes (defpage), and basic http stuff
    (sessions, cookies, etc.). Mostly stays out of your way
Noir
 • Lightweight - gives you what you need. Server start
    (server.clj), routes (defpage), and basic http stuff
    (sessions, cookies, etc.). Mostly stays out of your way

 • Unopinionated - you must determine and enforce
    your own architecture. Doesn’t try to save you from
    yourself.
Hiccup
Hiccup
 • Expressive syntax
Hiccup
 • Expressive syntax
 • Composable in interesting ways
Hiccup
 • Expressive syntax
 • Composable in interesting ways
 • Crate - hiccup in clojurescript - github.com/ibdknox/
    crate
Hiccup
 • Expressive syntax
 • Composable in interesting ways
 • Crate - hiccup in clojurescript - github.com/ibdknox/
    crate

 • Death to xml! - xml is ugly and poorly implemented
    lisp. The designers will be fine.
cssgen
cssgen
 • Specify nested rules in clojure
cssgen
 • Specify nested rules in clojure
 • Mixins for functional css
cssgen
 • Specify nested rules in clojure
 • Mixins for functional css
 • Has a long way to go - less/sass/compass/etc. and
    some asset build tool like sprockets much better option at
    this point
cssgen
 • Specify nested rules in clojure
 • Mixins for functional css
 • Has a long way to go - less/sass/compass/etc. and
    some asset build tool like sprockets much better option at
    this point

 • Clojure needs a serious tool like clojurescript for
    css
cssgen
 • Specify nested rules in clojure
 • Mixins for functional css
 • Has a long way to go - less/sass/compass/etc. and
    some asset build tool like sprockets much better option at
    this point

 • Clojure needs a serious tool like clojurescript for
    css

 • Don’t underestimate front end organization! -
    clojure can and should take css to new heights
Clojurescript
Clojurescript
 • Namespaces are a huge improvement over js/
    coffeescript - makes client side development feel a lot
    less like wandering through a dark Malaysian jungle
Clojurescript
 • Namespaces are a huge improvement over js/
    coffeescript - makes client side development feel a lot
    less like wandering through a dark Malaysian jungle

 • You don’t need much state! - clojurescript can often
    function as a straight pipeline from server to ui. Don’t
    hold onto data unless you need it!
Clojurescript
 • Namespaces are a huge improvement over js/
    coffeescript - makes client side development feel a lot
    less like wandering through a dark Malaysian jungle

 • You don’t need much state! - clojurescript can often
    function as a straight pipeline from server to ui. Don’t
    hold onto data unless you need it!

 • Feels like clojure! But native js interop can be
    tricky - javascript is a mutable paradigm. Leads to
    verbosity.
Clojurescript
 • Namespaces are a huge improvement over js/
    coffeescript - makes client side development feel a lot
    less like wandering through a dark Malaysian jungle

 • You don’t need much state! - clojurescript can often
    function as a straight pipeline from server to ui. Don’t
    hold onto data unless you need it!

 • Feels like clojure! But native js interop can be
    tricky - javascript is a mutable paradigm. Leads to
    verbosity.

 • Check out Chris Granger libs - (ibdnox - noir/light
    table dude). jayq, crate, fetch. best cljs tutorial: chris-
    granger.com/2012/02/20/overtone-and-clojurescript/
Clojurescript
 • Namespaces are a huge improvement over js/
    coffeescript - makes client side development feel a lot
    less like wandering through a dark Malaysian jungle

 • You don’t need much state! - clojurescript can often
    function as a straight pipeline from server to ui. Don’t
    hold onto data unless you need it!

 • Feels like clojure! But native js interop can be
    tricky - javascript is a mutable paradigm. Leads to
    verbosity.

 • Check out Chris Granger libs - (ibdnox - noir/light
    table dude). jayq, crate, fetch. best cljs tutorial: chris-
    granger.com/2012/02/20/overtone-and-clojurescript/
Noir-async
Noir-async
 • Netty wrapper
Noir-async
 • Netty wrapper
 • Noir-async/aleph/lamina make sockets simple
Noir-async
 • Netty wrapper
 • Noir-async/aleph/lamina make sockets simple
 • Lamina event channel
Noir-async
 •   Netty wrapper

 •   Noir-async/aleph/lamina make sockets simple

 •   Lamina event channel

 •   overtone/at-at for efficient short term
     scheduling
Noir-async
 •   Netty wrapper

 •   Noir-async/aleph/lamina make sockets simple

 •   Lamina event channel

 •   overtone/at-at for efficient short term
     scheduling

 • clj-time for date/time handling
Data transfer
Data transfer
 • Server to client. Clojure over the wire! - send
    clojure forms as strings and read them straight into
    context with clojurescript reader.
Data transfer
 • Server to client. Clojure over the wire! - send
    clojure forms as strings and read them straight into
    context with clojurescript reader.

 • Client to server. Use intermediary. - eval-ing
    client supplied strings = fail. Could use some sort of
    whitelist or safe eval? I used json -- encode and parse it on
    at both ends. Good json parser: github.com/dakrone/
    cheshire
Deployment
Deployment
 • lein uberjar gotchas - specify :main and :keep-non-
    project-classes true in project.clj. specify (:gen-class) and
    require all views in server.clj
Deployment
 • lein uberjar gotchas - specify :main and :keep-non-
    project-classes true in project.clj. specify (:gen-class) and
    require all views in server.clj

 • nginx, upstart, monit -       I haven’t deployed yet, but
    based on preliminary research, this lightweight stack
    should get the job done.
Deployment
 • lein uberjar gotchas - specify :main and :keep-non-
    project-classes true in project.clj. specify (:gen-class) and
    require all views in server.clj

 • nginx, upstart, monit -       I haven’t deployed yet, but
    based on preliminary research, this lightweight stack
    should get the job done.

 • Continuous deploys? - git hooks? uberjar + scp +
    upstart?
Deployment
 • lein uberjar gotchas - specify :main and :keep-non-
    project-classes true in project.clj. specify (:gen-class) and
    require all views in server.clj

 • nginx, upstart, monit -       I haven’t deployed yet, but
    based on preliminary research, this lightweight stack
    should get the job done.

 • Continuous deploys? - git hooks? uberjar + scp +
    upstart?

 • Environment config? - dev/staging/prod
Drawbacks of pure clojure
Drawbacks of pure clojure
 • Rough setup process
 • Cryptic stack traces - especially cljs
 • Lack of polished utilities - sass/compass, asset
    pipeline

 • Minor issues - overall, clojure is awesome for web dev!
Next steps
Next steps
 • DB integration
Next steps
 • DB integration
 • Test suite - unit/integration tests
Next steps
 • DB integration
 • Test suite - unit/integration tests
 • Advanced clojure - amazing what can be elegantly
    accomplished with 1/100th of the standard lib. I still
    don’t fully understand macros, state mechanisms,
    clojure concurrency, and a lot of functional constructs,
    but I’ve caught a glimpse of their power.
Next steps
 • DB integration
 • Test suite - unit/integration tests
 • Advanced clojure - amazing what can be elegantly
    accomplished with 1/100th of the standard lib. I still
    don’t fully understand macros, state mechanisms,
    clojure concurrency, and a lot of functional constructs,
    but I’ve caught a glimpse of their power.

 • Thanks for listening!

More Related Content

What's hot

Getting Started with Apache Camel at DevNation 2014
Getting Started with Apache Camel at DevNation 2014Getting Started with Apache Camel at DevNation 2014
Getting Started with Apache Camel at DevNation 2014
Claus Ibsen
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Librarieselliando dias
 
Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slides
elliando dias
 
Масштабируя TLS / Артём Гавриченков (Qrator Labs)
Масштабируя TLS / Артём Гавриченков (Qrator Labs)Масштабируя TLS / Артём Гавриченков (Qrator Labs)
Масштабируя TLS / Артём Гавриченков (Qrator Labs)
Ontico
 
Ruby in office time reboot
Ruby in office time rebootRuby in office time reboot
Ruby in office time reboot
Kentaro Goto
 
Building Asynchronous Applications
Building Asynchronous ApplicationsBuilding Asynchronous Applications
Building Asynchronous Applications
Johan Edstrom
 
Getting Buzzed on Buzzwords: Using Cloud & Big Data to Pentest at Scale
Getting Buzzed on Buzzwords: Using Cloud & Big Data to Pentest at ScaleGetting Buzzed on Buzzwords: Using Cloud & Big Data to Pentest at Scale
Getting Buzzed on Buzzwords: Using Cloud & Big Data to Pentest at Scale
Bishop Fox
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agilityelliando dias
 
Deploying Plack Web Applications: OSCON 2011
Deploying Plack Web Applications: OSCON 2011Deploying Plack Web Applications: OSCON 2011
Deploying Plack Web Applications: OSCON 2011Tatsuhiko Miyagawa
 
Apache Camel Introduction & What's in the box
Apache Camel Introduction & What's in the boxApache Camel Introduction & What's in the box
Apache Camel Introduction & What's in the box
Claus Ibsen
 
Clojure Conj 2014 - Paradigms of core.async - Julian Gamble
Clojure Conj 2014 - Paradigms of core.async - Julian GambleClojure Conj 2014 - Paradigms of core.async - Julian Gamble
Clojure Conj 2014 - Paradigms of core.async - Julian Gamble
Julian Gamble
 
modern module development - Ken Barber 2012 Edinburgh Puppet Camp
modern module development - Ken Barber 2012 Edinburgh Puppet Campmodern module development - Ken Barber 2012 Edinburgh Puppet Camp
modern module development - Ken Barber 2012 Edinburgh Puppet CampPuppet
 
No callbacks, No Threads - Cooperative web servers in Ruby 1.9
No callbacks, No Threads - Cooperative web servers in Ruby 1.9No callbacks, No Threads - Cooperative web servers in Ruby 1.9
No callbacks, No Threads - Cooperative web servers in Ruby 1.9
Ilya Grigorik
 
Freelancing and side-projects on Rails
Freelancing and side-projects on RailsFreelancing and side-projects on Rails
Freelancing and side-projects on Rails
John McCaffrey
 
Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014
Ngoc Dao
 
BTV PHP - Building Fast Websites
BTV PHP - Building Fast WebsitesBTV PHP - Building Fast Websites
BTV PHP - Building Fast Websites
Jonathan Klein
 
Day 7 - Make it Fast
Day 7 - Make it FastDay 7 - Make it Fast
Day 7 - Make it Fast
Barry Jones
 
Enterprise Integration Patterns with Apache Camel
Enterprise Integration Patterns with Apache CamelEnterprise Integration Patterns with Apache Camel
Enterprise Integration Patterns with Apache Camel
Ioan Eugen Stan
 
Message:Passing - lpw 2012
Message:Passing - lpw 2012Message:Passing - lpw 2012
Message:Passing - lpw 2012Tomas Doran
 

What's hot (20)

Getting Started with Apache Camel at DevNation 2014
Getting Started with Apache Camel at DevNation 2014Getting Started with Apache Camel at DevNation 2014
Getting Started with Apache Camel at DevNation 2014
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Libraries
 
Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slides
 
Масштабируя TLS / Артём Гавриченков (Qrator Labs)
Масштабируя TLS / Артём Гавриченков (Qrator Labs)Масштабируя TLS / Артём Гавриченков (Qrator Labs)
Масштабируя TLS / Артём Гавриченков (Qrator Labs)
 
Ruby in office time reboot
Ruby in office time rebootRuby in office time reboot
Ruby in office time reboot
 
Building Asynchronous Applications
Building Asynchronous ApplicationsBuilding Asynchronous Applications
Building Asynchronous Applications
 
Getting Buzzed on Buzzwords: Using Cloud & Big Data to Pentest at Scale
Getting Buzzed on Buzzwords: Using Cloud & Big Data to Pentest at ScaleGetting Buzzed on Buzzwords: Using Cloud & Big Data to Pentest at Scale
Getting Buzzed on Buzzwords: Using Cloud & Big Data to Pentest at Scale
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agility
 
Deploying Plack Web Applications: OSCON 2011
Deploying Plack Web Applications: OSCON 2011Deploying Plack Web Applications: OSCON 2011
Deploying Plack Web Applications: OSCON 2011
 
Apache Camel Introduction & What's in the box
Apache Camel Introduction & What's in the boxApache Camel Introduction & What's in the box
Apache Camel Introduction & What's in the box
 
Clojure Conj 2014 - Paradigms of core.async - Julian Gamble
Clojure Conj 2014 - Paradigms of core.async - Julian GambleClojure Conj 2014 - Paradigms of core.async - Julian Gamble
Clojure Conj 2014 - Paradigms of core.async - Julian Gamble
 
modern module development - Ken Barber 2012 Edinburgh Puppet Camp
modern module development - Ken Barber 2012 Edinburgh Puppet Campmodern module development - Ken Barber 2012 Edinburgh Puppet Camp
modern module development - Ken Barber 2012 Edinburgh Puppet Camp
 
No callbacks, No Threads - Cooperative web servers in Ruby 1.9
No callbacks, No Threads - Cooperative web servers in Ruby 1.9No callbacks, No Threads - Cooperative web servers in Ruby 1.9
No callbacks, No Threads - Cooperative web servers in Ruby 1.9
 
Freelancing and side-projects on Rails
Freelancing and side-projects on RailsFreelancing and side-projects on Rails
Freelancing and side-projects on Rails
 
遇見 Ruby on Rails
遇見 Ruby on Rails遇見 Ruby on Rails
遇見 Ruby on Rails
 
Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014
 
BTV PHP - Building Fast Websites
BTV PHP - Building Fast WebsitesBTV PHP - Building Fast Websites
BTV PHP - Building Fast Websites
 
Day 7 - Make it Fast
Day 7 - Make it FastDay 7 - Make it Fast
Day 7 - Make it Fast
 
Enterprise Integration Patterns with Apache Camel
Enterprise Integration Patterns with Apache CamelEnterprise Integration Patterns with Apache Camel
Enterprise Integration Patterns with Apache Camel
 
Message:Passing - lpw 2012
Message:Passing - lpw 2012Message:Passing - lpw 2012
Message:Passing - lpw 2012
 

Viewers also liked

Introduction to Erlang
Introduction to ErlangIntroduction to Erlang
Introduction to Erlang
Corrado Santoro
 
1 hour dive into Erlang/OTP
1 hour dive into Erlang/OTP1 hour dive into Erlang/OTP
1 hour dive into Erlang/OTP
Jordi Llonch
 
Using Clojure, NoSQL Databases and Functional-Style JavaScript to Write Gext-...
Using Clojure, NoSQL Databases and Functional-Style JavaScript to Write Gext-...Using Clojure, NoSQL Databases and Functional-Style JavaScript to Write Gext-...
Using Clojure, NoSQL Databases and Functional-Style JavaScript to Write Gext-...
Stefan Richter
 
Building a Network IP Camera using Erlang
Building a Network IP Camera using ErlangBuilding a Network IP Camera using Erlang
Building a Network IP Camera using Erlang
Frank Hunleth
 
Erlang latest version & opensource projects
Erlang latest version & opensource projectsErlang latest version & opensource projects
Erlang latest version & opensource projects
Digikrit
 
Erlang - Because s**t Happens by Mahesh Paolini-Subramanya
Erlang - Because s**t Happens by Mahesh Paolini-SubramanyaErlang - Because s**t Happens by Mahesh Paolini-Subramanya
Erlang - Because s**t Happens by Mahesh Paolini-Subramanya
Hakka Labs
 
Winning the Erlang Edit•Build•Test Cycle
Winning the Erlang Edit•Build•Test CycleWinning the Erlang Edit•Build•Test Cycle
Winning the Erlang Edit•Build•Test Cycle
Rusty Klophaus
 
Clojure made-simple - John Stevenson
Clojure made-simple - John StevensonClojure made-simple - John Stevenson
Clojure made-simple - John Stevenson
JAX London
 
20 reasons why we don't need architects (@pavlobaron)
20 reasons why we don't need architects (@pavlobaron)20 reasons why we don't need architects (@pavlobaron)
20 reasons why we don't need architects (@pavlobaron)
Pavlo Baron
 
Elixir talk
Elixir talkElixir talk
Elixir talk
Cory Gwin
 
What can be done with Java, but should better be done with Erlang (@pavlobaron)
What can be done with Java, but should better be done with Erlang (@pavlobaron)What can be done with Java, but should better be done with Erlang (@pavlobaron)
What can be done with Java, but should better be done with Erlang (@pavlobaron)
Pavlo Baron
 
Messaging With Erlang And Jabber
Messaging With  Erlang And  JabberMessaging With  Erlang And  Jabber
Messaging With Erlang And Jabberl xf
 
From Perl To Elixir
From Perl To ElixirFrom Perl To Elixir
From Perl To Elixir
Ruben Amortegui
 
Clojure: Functional Concurrency for the JVM (presented at Open Source Bridge)
Clojure: Functional Concurrency for the JVM (presented at Open Source Bridge)Clojure: Functional Concurrency for the JVM (presented at Open Source Bridge)
Clojure: Functional Concurrency for the JVM (presented at Open Source Bridge)
Howard Lewis Ship
 
NDC London 2014: Erlang Patterns Matching Business Needs
NDC London 2014: Erlang Patterns Matching Business NeedsNDC London 2014: Erlang Patterns Matching Business Needs
NDC London 2014: Erlang Patterns Matching Business Needs
Torben Hoffmann
 
VoltDB and Erlang - Tech planet 2012
VoltDB and Erlang - Tech planet 2012VoltDB and Erlang - Tech planet 2012
VoltDB and Erlang - Tech planet 2012
Eonblast
 

Viewers also liked (20)

Introduction to Erlang
Introduction to ErlangIntroduction to Erlang
Introduction to Erlang
 
1 hour dive into Erlang/OTP
1 hour dive into Erlang/OTP1 hour dive into Erlang/OTP
1 hour dive into Erlang/OTP
 
Using Clojure, NoSQL Databases and Functional-Style JavaScript to Write Gext-...
Using Clojure, NoSQL Databases and Functional-Style JavaScript to Write Gext-...Using Clojure, NoSQL Databases and Functional-Style JavaScript to Write Gext-...
Using Clojure, NoSQL Databases and Functional-Style JavaScript to Write Gext-...
 
Erlang OTP
Erlang OTPErlang OTP
Erlang OTP
 
Building a Network IP Camera using Erlang
Building a Network IP Camera using ErlangBuilding a Network IP Camera using Erlang
Building a Network IP Camera using Erlang
 
Erlang latest version & opensource projects
Erlang latest version & opensource projectsErlang latest version & opensource projects
Erlang latest version & opensource projects
 
Erlang - Because s**t Happens by Mahesh Paolini-Subramanya
Erlang - Because s**t Happens by Mahesh Paolini-SubramanyaErlang - Because s**t Happens by Mahesh Paolini-Subramanya
Erlang - Because s**t Happens by Mahesh Paolini-Subramanya
 
Winning the Erlang Edit•Build•Test Cycle
Winning the Erlang Edit•Build•Test CycleWinning the Erlang Edit•Build•Test Cycle
Winning the Erlang Edit•Build•Test Cycle
 
Clojure values
Clojure valuesClojure values
Clojure values
 
Clojure made-simple - John Stevenson
Clojure made-simple - John StevensonClojure made-simple - John Stevenson
Clojure made-simple - John Stevenson
 
20 reasons why we don't need architects (@pavlobaron)
20 reasons why we don't need architects (@pavlobaron)20 reasons why we don't need architects (@pavlobaron)
20 reasons why we don't need architects (@pavlobaron)
 
Clojure class
Clojure classClojure class
Clojure class
 
High Performance Erlang
High  Performance  ErlangHigh  Performance  Erlang
High Performance Erlang
 
Elixir talk
Elixir talkElixir talk
Elixir talk
 
What can be done with Java, but should better be done with Erlang (@pavlobaron)
What can be done with Java, but should better be done with Erlang (@pavlobaron)What can be done with Java, but should better be done with Erlang (@pavlobaron)
What can be done with Java, but should better be done with Erlang (@pavlobaron)
 
Messaging With Erlang And Jabber
Messaging With  Erlang And  JabberMessaging With  Erlang And  Jabber
Messaging With Erlang And Jabber
 
From Perl To Elixir
From Perl To ElixirFrom Perl To Elixir
From Perl To Elixir
 
Clojure: Functional Concurrency for the JVM (presented at Open Source Bridge)
Clojure: Functional Concurrency for the JVM (presented at Open Source Bridge)Clojure: Functional Concurrency for the JVM (presented at Open Source Bridge)
Clojure: Functional Concurrency for the JVM (presented at Open Source Bridge)
 
NDC London 2014: Erlang Patterns Matching Business Needs
NDC London 2014: Erlang Patterns Matching Business NeedsNDC London 2014: Erlang Patterns Matching Business Needs
NDC London 2014: Erlang Patterns Matching Business Needs
 
VoltDB and Erlang - Tech planet 2012
VoltDB and Erlang - Tech planet 2012VoltDB and Erlang - Tech planet 2012
VoltDB and Erlang - Tech planet 2012
 

Similar to A web app in pure Clojure

Build your own analytics power tools
Build your own analytics power toolsBuild your own analytics power tools
Build your own analytics power tools
Alban Gérôme
 
About Clack
About ClackAbout Clack
About Clack
fukamachi
 
Kuby, ActiveDeployment for Rails Apps
Kuby, ActiveDeployment for Rails AppsKuby, ActiveDeployment for Rails Apps
Kuby, ActiveDeployment for Rails Apps
Cameron Dutro
 
ClojureScript: I can't believe this is JavaScript
ClojureScript: I can't believe this is JavaScriptClojureScript: I can't believe this is JavaScript
ClojureScript: I can't believe this is JavaScript
Eric Normand
 
Windycityrails page performance
Windycityrails page performanceWindycityrails page performance
Windycityrails page performance
John McCaffrey
 
BuildStuff 2019: Let me handle that for you... Why you need a reverse proxy
BuildStuff 2019: Let me handle that for you... Why you need a reverse proxyBuildStuff 2019: Let me handle that for you... Why you need a reverse proxy
BuildStuff 2019: Let me handle that for you... Why you need a reverse proxy
Elton Stoneman
 
vidhi talk.pdf
vidhi talk.pdfvidhi talk.pdf
vidhi talk.pdf
VidhiKataria3
 
performance.ppt
performance.pptperformance.ppt
performance.ppt
fakeaccount225095
 
Swaggered web apis in Clojure
Swaggered web apis in ClojureSwaggered web apis in Clojure
Swaggered web apis in Clojure
Metosin Oy
 
Rails 3.1
Rails 3.1Rails 3.1
Rails 3.1
Lori Olson
 
Badneedles
BadneedlesBadneedles
Badneedles
dimisec
 
StripeCon 2019 talk - Serverless and Silverstripe
StripeCon 2019 talk - Serverless and SilverstripeStripeCon 2019 talk - Serverless and Silverstripe
StripeCon 2019 talk - Serverless and Silverstripe
Tim Burt
 
FP Days: Down the Clojure Rabbit Hole
FP Days: Down the Clojure Rabbit HoleFP Days: Down the Clojure Rabbit Hole
FP Days: Down the Clojure Rabbit HoleChristophe Grand
 
Supporting large scale React applications
Supporting large scale React applicationsSupporting large scale React applications
Supporting large scale React applications
Maurice De Beijer [MVP]
 
OSDC 2013 | Introduction into Chef by Andy Hawkins
OSDC 2013 | Introduction into Chef by Andy HawkinsOSDC 2013 | Introduction into Chef by Andy Hawkins
OSDC 2013 | Introduction into Chef by Andy Hawkins
NETWAYS
 
Elegant concurrency
Elegant concurrencyElegant concurrency
Elegant concurrency
Mosky Liu
 
Torquebox rubyhoedown-2012
Torquebox rubyhoedown-2012Torquebox rubyhoedown-2012
Torquebox rubyhoedown-2012
Lance Ball
 
CloudStack EU user group - Trillian
CloudStack EU user group - TrillianCloudStack EU user group - Trillian
CloudStack EU user group - Trillian
ShapeBlue
 

Similar to A web app in pure Clojure (20)

NullMQ @ PDX
NullMQ @ PDXNullMQ @ PDX
NullMQ @ PDX
 
Build your own analytics power tools
Build your own analytics power toolsBuild your own analytics power tools
Build your own analytics power tools
 
About Clack
About ClackAbout Clack
About Clack
 
Kuby, ActiveDeployment for Rails Apps
Kuby, ActiveDeployment for Rails AppsKuby, ActiveDeployment for Rails Apps
Kuby, ActiveDeployment for Rails Apps
 
ClojureScript: I can't believe this is JavaScript
ClojureScript: I can't believe this is JavaScriptClojureScript: I can't believe this is JavaScript
ClojureScript: I can't believe this is JavaScript
 
Windycityrails page performance
Windycityrails page performanceWindycityrails page performance
Windycityrails page performance
 
BuildStuff 2019: Let me handle that for you... Why you need a reverse proxy
BuildStuff 2019: Let me handle that for you... Why you need a reverse proxyBuildStuff 2019: Let me handle that for you... Why you need a reverse proxy
BuildStuff 2019: Let me handle that for you... Why you need a reverse proxy
 
vidhi talk.pdf
vidhi talk.pdfvidhi talk.pdf
vidhi talk.pdf
 
performance.ppt
performance.pptperformance.ppt
performance.ppt
 
Swaggered web apis in Clojure
Swaggered web apis in ClojureSwaggered web apis in Clojure
Swaggered web apis in Clojure
 
Rails 3.1
Rails 3.1Rails 3.1
Rails 3.1
 
Badneedles
BadneedlesBadneedles
Badneedles
 
StripeCon 2019 talk - Serverless and Silverstripe
StripeCon 2019 talk - Serverless and SilverstripeStripeCon 2019 talk - Serverless and Silverstripe
StripeCon 2019 talk - Serverless and Silverstripe
 
FP Days: Down the Clojure Rabbit Hole
FP Days: Down the Clojure Rabbit HoleFP Days: Down the Clojure Rabbit Hole
FP Days: Down the Clojure Rabbit Hole
 
Javascript for Wep Apps
Javascript for Wep AppsJavascript for Wep Apps
Javascript for Wep Apps
 
Supporting large scale React applications
Supporting large scale React applicationsSupporting large scale React applications
Supporting large scale React applications
 
OSDC 2013 | Introduction into Chef by Andy Hawkins
OSDC 2013 | Introduction into Chef by Andy HawkinsOSDC 2013 | Introduction into Chef by Andy Hawkins
OSDC 2013 | Introduction into Chef by Andy Hawkins
 
Elegant concurrency
Elegant concurrencyElegant concurrency
Elegant concurrency
 
Torquebox rubyhoedown-2012
Torquebox rubyhoedown-2012Torquebox rubyhoedown-2012
Torquebox rubyhoedown-2012
 
CloudStack EU user group - Trillian
CloudStack EU user group - TrillianCloudStack EU user group - Trillian
CloudStack EU user group - Trillian
 

Recently uploaded

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
 
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
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
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
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
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
 
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
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
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
 

Recently uploaded (20)

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
 
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...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
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
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
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
 
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
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
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
 

A web app in pure Clojure

  • 1. (parens (all(the(way(down))))) A web app in pure clojure
  • 3. Clojure For Web Server HTML Css Javascript Web Sockets Data Transfer Deployment
  • 5. Clojure Scramble • A multiplayer game for practicing clojure
  • 6. Clojure Scramble • A multiplayer game for practicing clojure • Transform given clojure collection into a new one in as many different ways as you can using list of permitted values
  • 7. Clojure Scramble • A multiplayer game for practicing clojure • Transform given clojure collection into a new one in as many different ways as you can using list of permitted values • Compete against other clojurians for high score
  • 8. Clojure Scramble • A multiplayer game for practicing clojure • Transform given clojure collection into a new one in as many different ways as you can using list of permitted values • Compete against other clojurians for high score • A work in progress - will launch at www.clojurescramble.com soon
  • 10. Clojure For Web Server HTML Css Javascript Web Sockets Data Transfer Deployment
  • 11. Clojure For Web Server • Noir - github.com/noir-clojure/noir HTML Css Javascript Web Sockets Data Transfer Deployment
  • 12. Clojure For Web Server • Noir - github.com/noir-clojure/noir HTML • Hiccup - github.com/weavejester/hiccup Css Javascript Web Sockets Data Transfer Deployment
  • 13. Clojure For Web Server • Noir - github.com/noir-clojure/noir HTML • Hiccup - github.com/weavejester/hiccup Css • Cssgen- github.com/paraseba/cssgen Javascript Web Sockets Data Transfer Deployment
  • 14. Clojure For Web Server • Noir - github.com/noir-clojure/noir HTML • Hiccup - github.com/weavejester/hiccup Css • Cssgen- github.com/paraseba/cssgen Javascript • Clojurescript - github.com/clojure/clojurescript Web Sockets Data Transfer Deployment
  • 15. Clojure For Web Server • Noir - github.com/noir-clojure/noir HTML • Hiccup - github.com/weavejester/hiccup Css • Cssgen- github.com/paraseba/cssgen Javascript • Clojurescript - github.com/clojure/clojurescript Web Sockets • Web Sockets - aleph, lamina, noir-async Data Transfer Deployment
  • 16. Clojure For Web Server • Noir - github.com/noir-clojure/noir HTML • Hiccup - github.com/weavejester/hiccup Css • Cssgen- github.com/paraseba/cssgen Javascript • Clojurescript - github.com/clojure/clojurescript Web Sockets • Web Sockets - aleph, lamina, noir-async Data Transfer • Data Transfer - strings/reader. outgoing only! Deployment
  • 17. Clojure For Web Server • Noir - github.com/noir-clojure/noir HTML • Hiccup - github.com/weavejester/hiccup Css • Cssgen- github.com/paraseba/cssgen Javascript • Clojurescript - github.com/clojure/clojurescript Web Sockets • Web Sockets - aleph, lamina, noir-async Data Transfer • Data Transfer - strings/reader. outgoing only! Deployment • Leinengen - superjar. upstart/monit. nginx proxy
  • 18. Benefits of pure clojure
  • 19. Benefits of pure clojure • No context switching
  • 20. Benefits of pure clojure • No context switching • Share server and client code
  • 21. Benefits of pure clojure • No context switching • Share server and client code • Enabled higher level abstractions
  • 22. Benefits of pure clojure • No context switching • Share server and client code • Enabled higher level abstractions • Avoid web language pitfalls
  • 23. Benefits of pure clojure • No context switching • Share server and client code • Enabled higher level abstractions • Avoid web language pitfalls • Everything maps easily to lisp
  • 25. Clojure MVC • Namespaces make relationships explicit - good for architectural discipline. Control very directly who can see who.
  • 26. Clojure MVC • Namespaces make relationships explicit - good for architectural discipline. Control very directly who can see who. • Quarantine state - lots of state inevitable in web programming. Can still be minimized compared to imperative programming. I’ve used atoms for everything so far. Simple updates. Other approaches?
  • 27. Clojure MVC • Namespaces make relationships explicit - good for architectural discipline. Control very directly who can see who. • Quarantine state - lots of state inevitable in web programming. Can still be minimized compared to imperative programming. I’ve used atoms for everything so far. Simple updates. Other approaches? • Async events through lamina channels - decoupled interactions
  • 28. Clojure MVC • Namespaces make relationships explicit - good for architectural discipline. Control very directly who can see who. • Quarantine state - lots of state inevitable in web programming. Can still be minimized compared to imperative programming. I’ve used atoms for everything so far. Simple updates. Other approaches? • Async events through lamina channels - decoupled interactions • I ended up with a thick ‘manager’ tier - async creates responsibilities that don’t fall neatly into mvc
  • 29. Noir
  • 30. Noir • Lightweight - gives you what you need. Server start (server.clj), routes (defpage), and basic http stuff (sessions, cookies, etc.). Mostly stays out of your way
  • 31. Noir • Lightweight - gives you what you need. Server start (server.clj), routes (defpage), and basic http stuff (sessions, cookies, etc.). Mostly stays out of your way • Unopinionated - you must determine and enforce your own architecture. Doesn’t try to save you from yourself.
  • 34. Hiccup • Expressive syntax • Composable in interesting ways
  • 35. Hiccup • Expressive syntax • Composable in interesting ways • Crate - hiccup in clojurescript - github.com/ibdknox/ crate
  • 36. Hiccup • Expressive syntax • Composable in interesting ways • Crate - hiccup in clojurescript - github.com/ibdknox/ crate • Death to xml! - xml is ugly and poorly implemented lisp. The designers will be fine.
  • 38. cssgen • Specify nested rules in clojure
  • 39. cssgen • Specify nested rules in clojure • Mixins for functional css
  • 40. cssgen • Specify nested rules in clojure • Mixins for functional css • Has a long way to go - less/sass/compass/etc. and some asset build tool like sprockets much better option at this point
  • 41. cssgen • Specify nested rules in clojure • Mixins for functional css • Has a long way to go - less/sass/compass/etc. and some asset build tool like sprockets much better option at this point • Clojure needs a serious tool like clojurescript for css
  • 42. cssgen • Specify nested rules in clojure • Mixins for functional css • Has a long way to go - less/sass/compass/etc. and some asset build tool like sprockets much better option at this point • Clojure needs a serious tool like clojurescript for css • Don’t underestimate front end organization! - clojure can and should take css to new heights
  • 44. Clojurescript • Namespaces are a huge improvement over js/ coffeescript - makes client side development feel a lot less like wandering through a dark Malaysian jungle
  • 45. Clojurescript • Namespaces are a huge improvement over js/ coffeescript - makes client side development feel a lot less like wandering through a dark Malaysian jungle • You don’t need much state! - clojurescript can often function as a straight pipeline from server to ui. Don’t hold onto data unless you need it!
  • 46. Clojurescript • Namespaces are a huge improvement over js/ coffeescript - makes client side development feel a lot less like wandering through a dark Malaysian jungle • You don’t need much state! - clojurescript can often function as a straight pipeline from server to ui. Don’t hold onto data unless you need it! • Feels like clojure! But native js interop can be tricky - javascript is a mutable paradigm. Leads to verbosity.
  • 47. Clojurescript • Namespaces are a huge improvement over js/ coffeescript - makes client side development feel a lot less like wandering through a dark Malaysian jungle • You don’t need much state! - clojurescript can often function as a straight pipeline from server to ui. Don’t hold onto data unless you need it! • Feels like clojure! But native js interop can be tricky - javascript is a mutable paradigm. Leads to verbosity. • Check out Chris Granger libs - (ibdnox - noir/light table dude). jayq, crate, fetch. best cljs tutorial: chris- granger.com/2012/02/20/overtone-and-clojurescript/
  • 48. Clojurescript • Namespaces are a huge improvement over js/ coffeescript - makes client side development feel a lot less like wandering through a dark Malaysian jungle • You don’t need much state! - clojurescript can often function as a straight pipeline from server to ui. Don’t hold onto data unless you need it! • Feels like clojure! But native js interop can be tricky - javascript is a mutable paradigm. Leads to verbosity. • Check out Chris Granger libs - (ibdnox - noir/light table dude). jayq, crate, fetch. best cljs tutorial: chris- granger.com/2012/02/20/overtone-and-clojurescript/
  • 51. Noir-async • Netty wrapper • Noir-async/aleph/lamina make sockets simple
  • 52. Noir-async • Netty wrapper • Noir-async/aleph/lamina make sockets simple • Lamina event channel
  • 53. Noir-async • Netty wrapper • Noir-async/aleph/lamina make sockets simple • Lamina event channel • overtone/at-at for efficient short term scheduling
  • 54. Noir-async • Netty wrapper • Noir-async/aleph/lamina make sockets simple • Lamina event channel • overtone/at-at for efficient short term scheduling • clj-time for date/time handling
  • 56. Data transfer • Server to client. Clojure over the wire! - send clojure forms as strings and read them straight into context with clojurescript reader.
  • 57. Data transfer • Server to client. Clojure over the wire! - send clojure forms as strings and read them straight into context with clojurescript reader. • Client to server. Use intermediary. - eval-ing client supplied strings = fail. Could use some sort of whitelist or safe eval? I used json -- encode and parse it on at both ends. Good json parser: github.com/dakrone/ cheshire
  • 59. Deployment • lein uberjar gotchas - specify :main and :keep-non- project-classes true in project.clj. specify (:gen-class) and require all views in server.clj
  • 60. Deployment • lein uberjar gotchas - specify :main and :keep-non- project-classes true in project.clj. specify (:gen-class) and require all views in server.clj • nginx, upstart, monit - I haven’t deployed yet, but based on preliminary research, this lightweight stack should get the job done.
  • 61. Deployment • lein uberjar gotchas - specify :main and :keep-non- project-classes true in project.clj. specify (:gen-class) and require all views in server.clj • nginx, upstart, monit - I haven’t deployed yet, but based on preliminary research, this lightweight stack should get the job done. • Continuous deploys? - git hooks? uberjar + scp + upstart?
  • 62. Deployment • lein uberjar gotchas - specify :main and :keep-non- project-classes true in project.clj. specify (:gen-class) and require all views in server.clj • nginx, upstart, monit - I haven’t deployed yet, but based on preliminary research, this lightweight stack should get the job done. • Continuous deploys? - git hooks? uberjar + scp + upstart? • Environment config? - dev/staging/prod
  • 63. Drawbacks of pure clojure
  • 64. Drawbacks of pure clojure • Rough setup process • Cryptic stack traces - especially cljs • Lack of polished utilities - sass/compass, asset pipeline • Minor issues - overall, clojure is awesome for web dev!
  • 66. Next steps • DB integration
  • 67. Next steps • DB integration • Test suite - unit/integration tests
  • 68. Next steps • DB integration • Test suite - unit/integration tests • Advanced clojure - amazing what can be elegantly accomplished with 1/100th of the standard lib. I still don’t fully understand macros, state mechanisms, clojure concurrency, and a lot of functional constructs, but I’ve caught a glimpse of their power.
  • 69. Next steps • DB integration • Test suite - unit/integration tests • Advanced clojure - amazing what can be elegantly accomplished with 1/100th of the standard lib. I still don’t fully understand macros, state mechanisms, clojure concurrency, and a lot of functional constructs, but I’ve caught a glimpse of their power. • Thanks for listening!

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n