SlideShare ist ein Scribd-Unternehmen logo
1 von 69
Downloaden Sie, um offline zu lesen
(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!

Weitere ähnliche Inhalte

Was ist angesagt?

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 2014Claus Ibsen
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Librarieselliando dias
 
Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slideselliando 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 rebootKentaro Goto
 
Building Asynchronous Applications
Building Asynchronous ApplicationsBuilding Asynchronous Applications
Building Asynchronous ApplicationsJohan 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 ScaleBishop 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 boxClaus 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 GambleJulian 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.9Ilya Grigorik
 
Freelancing and side-projects on Rails
Freelancing and side-projects on RailsFreelancing and side-projects on Rails
Freelancing and side-projects on RailsJohn McCaffrey
 
Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014Ngoc Dao
 
BTV PHP - Building Fast Websites
BTV PHP - Building Fast WebsitesBTV PHP - Building Fast Websites
BTV PHP - Building Fast WebsitesJonathan Klein
 
Day 7 - Make it Fast
Day 7 - Make it FastDay 7 - Make it Fast
Day 7 - Make it FastBarry Jones
 
Enterprise Integration Patterns with Apache Camel
Enterprise Integration Patterns with Apache CamelEnterprise Integration Patterns with Apache Camel
Enterprise Integration Patterns with Apache CamelIoan Eugen Stan
 
Message:Passing - lpw 2012
Message:Passing - lpw 2012Message:Passing - lpw 2012
Message:Passing - lpw 2012Tomas Doran
 

Was ist angesagt? (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
 

Andere mochten auch

1 hour dive into Erlang/OTP
1 hour dive into Erlang/OTP1 hour dive into Erlang/OTP
1 hour dive into Erlang/OTPJordi 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 ErlangFrank Hunleth
 
Erlang latest version & opensource projects
Erlang latest version & opensource projectsErlang latest version & opensource projects
Erlang latest version & opensource projectsDigikrit
 
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-SubramanyaHakka 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 CycleRusty Klophaus
 
Clojure made-simple - John Stevenson
Clojure made-simple - John StevensonClojure made-simple - John Stevenson
Clojure made-simple - John StevensonJAX 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
 
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
 
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 NeedsTorben Hoffmann
 
VoltDB and Erlang - Tech planet 2012
VoltDB and Erlang - Tech planet 2012VoltDB and Erlang - Tech planet 2012
VoltDB and Erlang - Tech planet 2012Eonblast
 

Andere mochten auch (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
 

Ähnlich wie 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 toolsAlban Gérôme
 
Kuby, ActiveDeployment for Rails Apps
Kuby, ActiveDeployment for Rails AppsKuby, ActiveDeployment for Rails Apps
Kuby, ActiveDeployment for Rails AppsCameron 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 JavaScriptEric Normand
 
Windycityrails page performance
Windycityrails page performanceWindycityrails page performance
Windycityrails page performanceJohn 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 proxyElton Stoneman
 
Swaggered web apis in Clojure
Swaggered web apis in ClojureSwaggered web apis in Clojure
Swaggered web apis in ClojureMetosin Oy
 
Badneedles
BadneedlesBadneedles
Badneedlesdimisec
 
StripeCon 2019 talk - Serverless and Silverstripe
StripeCon 2019 talk - Serverless and SilverstripeStripeCon 2019 talk - Serverless and Silverstripe
StripeCon 2019 talk - Serverless and SilverstripeTim 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 applicationsMaurice 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 HawkinsNETWAYS
 
Elegant concurrency
Elegant concurrencyElegant concurrency
Elegant concurrencyMosky Liu
 
Torquebox rubyhoedown-2012
Torquebox rubyhoedown-2012Torquebox rubyhoedown-2012
Torquebox rubyhoedown-2012Lance Ball
 
CloudStack EU user group - Trillian
CloudStack EU user group - TrillianCloudStack EU user group - Trillian
CloudStack EU user group - TrillianShapeBlue
 

Ähnlich wie 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
 

Kürzlich hochgeladen

Governance in SharePoint Premium:What's in the box?
Governance in SharePoint Premium:What's in the box?Governance in SharePoint Premium:What's in the box?
Governance in SharePoint Premium:What's in the box?Juan Carlos Gonzalez
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1DianaGray10
 
UiPath Studio Web workshop series - Day 5
UiPath Studio Web workshop series - Day 5UiPath Studio Web workshop series - Day 5
UiPath Studio Web workshop series - Day 5DianaGray10
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Will Schroeder
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding TeamAdam Moalla
 
Valere | Digital Solutions & AI Transformation Portfolio | 2024
Valere | Digital Solutions & AI Transformation Portfolio | 2024Valere | Digital Solutions & AI Transformation Portfolio | 2024
Valere | Digital Solutions & AI Transformation Portfolio | 2024Alexander Turgeon
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxGDSC PJATK
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Adtran
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioChristian Posta
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfinfogdgmi
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAshyamraj55
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxMatsuo Lab
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdfPedro Manuel
 
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"DianaGray10
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPathCommunity
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfAijun Zhang
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 

Kürzlich hochgeladen (20)

Governance in SharePoint Premium:What's in the box?
Governance in SharePoint Premium:What's in the box?Governance in SharePoint Premium:What's in the box?
Governance in SharePoint Premium:What's in the box?
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1
 
UiPath Studio Web workshop series - Day 5
UiPath Studio Web workshop series - Day 5UiPath Studio Web workshop series - Day 5
UiPath Studio Web workshop series - Day 5
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team
 
Valere | Digital Solutions & AI Transformation Portfolio | 2024
Valere | Digital Solutions & AI Transformation Portfolio | 2024Valere | Digital Solutions & AI Transformation Portfolio | 2024
Valere | Digital Solutions & AI Transformation Portfolio | 2024
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptx
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and Istio
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdf
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptx
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdf
 
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation Developers
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdf
 
201610817 - edge part1
201610817 - edge part1201610817 - edge part1
201610817 - edge part1
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.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!

Hinweis der Redaktion

  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