KEMBAR78
ClojureScript@node | PDF
- Work at Cybozu Startups, inc
- Write web apps with
Clojure/ClojureScript
- Since May 2016
- http://qiita.com/iku000888
- http://github.com/iku000888
- https://twitter.com/iku000888
- Number of exits @ home town station = 2
- Number of exits @ station near work = 2
- (Perceived) Number of exits @ Shibuya
- 443
- Do ClojureScript
- Checkout recent ClojureScript tools/templates
- Lumo
- calvin
- macchiato
- shadow-cljs
- (Optional)Do Clojure(JVM)
- Programming language
- Lisp () () ()
- Hosted on the JVM
- Emits jvm bytecode
- Compiler
- Immutability
- Extends to collections (vectors, maps, sets)
- Safely share values
- Proper equality semantics
- Only need ‘=’ most of the time
- No fiddling with ‘==’ or ‘===’ or .equals
- Simpler code
- Concurrency semantics
- No manual locking
- Watch-able reference types
- Many flavors (on the JVM)
- User extensible syntax
- ~=Babel on your fingertips
- Many core syntax are macros
(macroexpand '(when test (prn “foo”)))
=>
(if true (do (prn "foo")))
(def d (js/Date.))
(.setDate d 1)
- Tap into running system and
incrementally modify it
- Main mode of development
- Editor integration
- Backwards compatibility = high priority
- Almost 10 year old since
first release
- Clojure -> JavaScript Compiler
- Clojure code works on the browser!
- + wherever js runs
- Esp. node.js
- Inherits Clojure’s value props
- Pay only for the stuff you use
- unused stuff=removed by Closure Compiler
- Serves as standard lib
- Good stuff
- Dom
- XhrIo
- Crypto
- UI Components
- And more...
- Aggressive minification
- Dead code elimination
- Inlining
- ClojureScript emits code
that can be advance compiled
React => good
React+Immutability => double plus good
- Om, Reagent, Quiescent, Rum...
- First release = 2011
- 2015/8/1
- The ClojureScript compiler can run
on JavaScript
- On Node!!
- Bootstrapped ClojureScript on node.js
runtime
- https://github.com/anmonteiro/lumo
- Install with $ npm install -g lumo-cljs
- ClojureScript build tool on node.js
- Fetch maven artifacts + npm artifacts
- Leiningen style project.clj files
- https://github.com/eginez/calvin
- Install with: $ npm install -g calvin-cljs
- Node modules = ClojureScript namespaces
- Part of the build process
- Compiled with :advanced
- https://github.com/thheller/shadow-cljs
- Setup cljs tooling via npm/yarn
- JVM/node-jre under the hood
- Provides
- Nicer build config (milage may vary)
- cljs-repl
- Hot reloading
- Integration with tools in node ecosystem
(webpack etc)
- ClojureScript web stack targetting node.js
- https://github.com/macchiato-framework/
- Requires jdk tooling
- Provided as template on top of libraries
- Smooth first run experience
- Good docs
- Clojure(JVM)
- blamed for slow startup time
- Self hosted ClojureScript
- Good startup time
- Familiar tooling
- Use node/npm/yarn
- Leiningen/Boot/ClassPath…??
- Some libs cannot be compiled with
self hosted cljs(yet)
- E.g. clara-rules
- Caused by JVM specific
assumptions @ compile time
- Most tooling requires JVM
- lumo+calvin
- macciato
- shadow-cljs
- Start ClojureScript today?
- Install lumo and calvin
- Use it for daily scripting!
- Want minimal hassle jvm tooling4cljs?
- Install shadow-cljs
- Start building an app with cljs?
- Check macchiato
- Shibuya Lisp
- https://lisp.connpass.com/
- Clojure.tokyo
- https://www.meetup.com/clojure-tokyo/
ClojureScript@node

ClojureScript@node

  • 2.
    - Work atCybozu Startups, inc - Write web apps with Clojure/ClojureScript - Since May 2016
  • 3.
  • 4.
    - Number ofexits @ home town station = 2 - Number of exits @ station near work = 2 - (Perceived) Number of exits @ Shibuya - 443
  • 6.
    - Do ClojureScript -Checkout recent ClojureScript tools/templates - Lumo - calvin - macchiato - shadow-cljs - (Optional)Do Clojure(JVM)
  • 7.
    - Programming language -Lisp () () () - Hosted on the JVM - Emits jvm bytecode - Compiler
  • 8.
    - Immutability - Extendsto collections (vectors, maps, sets) - Safely share values - Proper equality semantics - Only need ‘=’ most of the time - No fiddling with ‘==’ or ‘===’ or .equals - Simpler code - Concurrency semantics - No manual locking - Watch-able reference types - Many flavors (on the JVM)
  • 9.
    - User extensiblesyntax - ~=Babel on your fingertips - Many core syntax are macros
  • 10.
    (macroexpand '(when test(prn “foo”))) => (if true (do (prn "foo")))
  • 11.
  • 12.
    - Tap intorunning system and incrementally modify it - Main mode of development - Editor integration
  • 13.
  • 14.
    - Almost 10year old since first release
  • 15.
    - Clojure ->JavaScript Compiler - Clojure code works on the browser! - + wherever js runs - Esp. node.js - Inherits Clojure’s value props
  • 18.
    - Pay onlyfor the stuff you use - unused stuff=removed by Closure Compiler - Serves as standard lib - Good stuff - Dom - XhrIo - Crypto - UI Components - And more...
  • 19.
    - Aggressive minification -Dead code elimination - Inlining - ClojureScript emits code that can be advance compiled
  • 20.
    React => good React+Immutability=> double plus good - Om, Reagent, Quiescent, Rum...
  • 21.
  • 22.
    - 2015/8/1 - TheClojureScript compiler can run on JavaScript - On Node!!
  • 23.
    - Bootstrapped ClojureScripton node.js runtime - https://github.com/anmonteiro/lumo - Install with $ npm install -g lumo-cljs
  • 24.
    - ClojureScript buildtool on node.js - Fetch maven artifacts + npm artifacts - Leiningen style project.clj files - https://github.com/eginez/calvin - Install with: $ npm install -g calvin-cljs
  • 25.
    - Node modules= ClojureScript namespaces - Part of the build process - Compiled with :advanced
  • 26.
    - https://github.com/thheller/shadow-cljs - Setupcljs tooling via npm/yarn - JVM/node-jre under the hood - Provides - Nicer build config (milage may vary) - cljs-repl - Hot reloading - Integration with tools in node ecosystem (webpack etc)
  • 27.
    - ClojureScript webstack targetting node.js - https://github.com/macchiato-framework/ - Requires jdk tooling - Provided as template on top of libraries - Smooth first run experience - Good docs
  • 28.
    - Clojure(JVM) - blamedfor slow startup time - Self hosted ClojureScript - Good startup time - Familiar tooling - Use node/npm/yarn - Leiningen/Boot/ClassPath…??
  • 29.
    - Some libscannot be compiled with self hosted cljs(yet) - E.g. clara-rules - Caused by JVM specific assumptions @ compile time - Most tooling requires JVM
  • 30.
  • 31.
    - Start ClojureScripttoday? - Install lumo and calvin - Use it for daily scripting! - Want minimal hassle jvm tooling4cljs? - Install shadow-cljs - Start building an app with cljs? - Check macchiato
  • 32.
    - Shibuya Lisp -https://lisp.connpass.com/ - Clojure.tokyo - https://www.meetup.com/clojure-tokyo/