Why clojure(script) matters Claudiu Apetrei - dev at figshare
My motivation www.infocaini.ro Personal project since 2006 Currently: python, vanilla coffescript, google app engine Next version: Clojure (back-end), Clojurescript (front-end), Fulcro
Requirements - Server side rendering (SEO & user experience) - Same language on front-end & backend - Single page app - Fast development (smarter tooling, ex: google app engine) - Robust & resilient codebase - Be productive working 2-3 hours a night - Understand quickly legacy code after 1-2 months of not working on it KEEP THINGS AS SIMPLE AS POSSIBLE
Work smarter not harder
Reselect Previous stack
Javascript is fine as it is :) Clojurescript Reason-ml (facebook) ELM Purescript ● Functional programming ● Immutable data structures ● Side effects ● Statically typed
Damien Katz - couchdb and me
OOP The promise and the reality
Working with maps, list (data oriented)
let a = { author: {"name": "claudiu"} }; fun-a1(a); fun-a2(a); fun-a3(a); console.log(a);
Programming languages C family C, C++, Objective-C, C#, Java, PHP, JavaScript, Go, Perl... LISP family Common Lisp, Clojure, Scheme, Emacs Lisp ML family ML, Caml, OCaml, F# (haskell inherits from here too)
1
2
3
Js history Eich (Brendan Eich) originally joined intending to put Scheme "in the browser",[6] but his Netscape superiors insisted that the language resemble Java in terms of its syntax.
One of the best designed languages out there Clojure is such a well designed language and a pleasure to program in.
Clojure language Lisp dialect Dynamically typed Immutable data structures Data oriented programming
Stable, light & complete language Lisp - “code is data and data is code” Macros = functions that write code, make it possible to move a lot of “language features” into libraries Clojure(script) code from 2015 the same in 2017 (^_^)
Macros 1
Macros 2
Clojure programming language that targets the JVM (2007) Clojurescript compiler that targets javascript (2011) Awesome host platform interop from day 1.
Make use of any existing library Java or JavaScript (client and nodejs) Universal(isomorphic)web application *.clj *.cljs *.cljc
Functional programming Different experience from javascript Brian Lonsdorf Oh Composable World!
Powerful core data types All core data types are immutable Maps are the work-horse in most applications (1% code objects) :keywords = self referencing functions that can have namespace & value. (def a {:manuscript/title “x”, :article/title “y”})
Data oriented development Powerful & well designed data structure Language core + standard library centered around data manipulation
Comprehensive standard library 9/36 chapters completed already at 400 pages *only use about 10 - 30 day to day :)
Tooling & libs REPL (read, evaluate, print, loop) Figwheel (hot-reload) Google closure compiler Clojure.spec Transit Core.async Core.match Test.check Core.logic contract system data format and tools for converting go style channels for async pattern matching property based testing - inspired by haskell prolog like rational programming
Google closure compiler With clojurescript you get Java GCC + Advanced working out of the box.
Clojure.spec Automatically check every single function call to make sure the arguments are correct - More expressive than type system - Generative testing - Generate example data - Unified approach data validation
Transit not json Uses json when possible Can encode over the wire - Dates - Sets - Lists - UUIDs - symbols, keywords, characters - extensible
Clojure ecosystem gems “Complete story that removes 60%+ of the complexity out of my code.” Beginner friendly Youtube video series on Fulcro: https://goo.gl/JekurH
Fulcro Sweet spot between framework and library. - Reactjs wrapper - State management flow - Normalised app state - Support for optimistic updates - Networking layer - Backend story with graphql like capabilities - Co-located css - ...
Interesting community Experienced like wow “crazy good developers” X was about to give up on programming as irretrievably* complex when he found Clojure, which renewed his love for code. * in a way that cannot be retrieved or put right.
Who’s using clojure
Codecamp Iasi 24 March 2018, speaker & masterclass Tony Kay is a software craftsman with nearly 30 years of experience. He has published research on concurrent programming, spent a number of years teaching software development, and is passionate about software craftsmanship. He has worked professionally in C, C++, Java, Scala, Perl, Javascript, Objective-C, Clojure, and Clojurescript. He is the lead architect and developer of the web development library Fulcro, is a contributor to Om Next.
Clojure Iasi - meetup.com - Hang out & help each other on SLACK - Workshops - Guest speakers (remote skype/slack) - Build an open source SPA in Fulcro https://www.meetup.com/iasi-clojure/ Thank you !
Getting started resources https://www.infoq.com/presentations/Simple-Made-Easy Essence of clojure https://defn.audio/episodes/2017/11/07/david-nolen.html Clojurescript overview https://www.packtpub.com/web-development/learning-clojurescript book https://cursive-ide.com/ editor https://shaunlebron.github.io/parinfer/ editor plugin for structural editing

Why clojure(script) matters

  • 1.
    Why clojure(script) matters ClaudiuApetrei - dev at figshare
  • 2.
    My motivation www.infocaini.ro Personal projectsince 2006 Currently: python, vanilla coffescript, google app engine Next version: Clojure (back-end), Clojurescript (front-end), Fulcro
  • 3.
    Requirements - Server siderendering (SEO & user experience) - Same language on front-end & backend - Single page app - Fast development (smarter tooling, ex: google app engine) - Robust & resilient codebase - Be productive working 2-3 hours a night - Understand quickly legacy code after 1-2 months of not working on it KEEP THINGS AS SIMPLE AS POSSIBLE
  • 4.
  • 5.
  • 6.
    Javascript is fineas it is :) Clojurescript Reason-ml (facebook) ELM Purescript ● Functional programming ● Immutable data structures ● Side effects ● Statically typed
  • 7.
    Damien Katz -couchdb and me
  • 8.
    OOP The promiseand the reality
  • 9.
    Working with maps,list (data oriented)
  • 10.
    let a ={ author: {"name": "claudiu"} }; fun-a1(a); fun-a2(a); fun-a3(a); console.log(a);
  • 12.
    Programming languages C familyC, C++, Objective-C, C#, Java, PHP, JavaScript, Go, Perl... LISP family Common Lisp, Clojure, Scheme, Emacs Lisp ML family ML, Caml, OCaml, F# (haskell inherits from here too)
  • 13.
  • 14.
  • 15.
  • 16.
    Js history Eich (BrendanEich) originally joined intending to put Scheme "in the browser",[6] but his Netscape superiors insisted that the language resemble Java in terms of its syntax.
  • 17.
    One of thebest designed languages out there Clojure is such a well designed language and a pleasure to program in.
  • 18.
    Clojure language Lisp dialect Dynamicallytyped Immutable data structures Data oriented programming
  • 19.
    Stable, light &complete language Lisp - “code is data and data is code” Macros = functions that write code, make it possible to move a lot of “language features” into libraries Clojure(script) code from 2015 the same in 2017 (^_^)
  • 20.
  • 21.
  • 22.
    Clojure programming language thattargets the JVM (2007) Clojurescript compiler that targets javascript (2011) Awesome host platform interop from day 1.
  • 23.
    Make use ofany existing library Java or JavaScript (client and nodejs) Universal(isomorphic)web application *.clj *.cljs *.cljc
  • 24.
    Functional programming Different experiencefrom javascript Brian Lonsdorf Oh Composable World!
  • 25.
    Powerful core datatypes All core data types are immutable Maps are the work-horse in most applications (1% code objects) :keywords = self referencing functions that can have namespace & value. (def a {:manuscript/title “x”, :article/title “y”})
  • 26.
    Data oriented development Powerful& well designed data structure Language core + standard library centered around data manipulation
  • 27.
    Comprehensive standard library 9/36chapters completed already at 400 pages *only use about 10 - 30 day to day :)
  • 28.
    Tooling & libs REPL(read, evaluate, print, loop) Figwheel (hot-reload) Google closure compiler Clojure.spec Transit Core.async Core.match Test.check Core.logic contract system data format and tools for converting go style channels for async pattern matching property based testing - inspired by haskell prolog like rational programming
  • 29.
    Google closure compiler Withclojurescript you get Java GCC + Advanced working out of the box.
  • 30.
    Clojure.spec Automatically check everysingle function call to make sure the arguments are correct - More expressive than type system - Generative testing - Generate example data - Unified approach data validation
  • 31.
    Transit not json Usesjson when possible Can encode over the wire - Dates - Sets - Lists - UUIDs - symbols, keywords, characters - extensible
  • 32.
    Clojure ecosystem gems “Completestory that removes 60%+ of the complexity out of my code.” Beginner friendly Youtube video series on Fulcro: https://goo.gl/JekurH
  • 33.
    Fulcro Sweet spot betweenframework and library. - Reactjs wrapper - State management flow - Normalised app state - Support for optimistic updates - Networking layer - Backend story with graphql like capabilities - Co-located css - ...
  • 34.
    Interesting community Experienced likewow “crazy good developers” X was about to give up on programming as irretrievably* complex when he found Clojure, which renewed his love for code. * in a way that cannot be retrieved or put right.
  • 35.
  • 36.
    Codecamp Iasi 24March 2018, speaker & masterclass Tony Kay is a software craftsman with nearly 30 years of experience. He has published research on concurrent programming, spent a number of years teaching software development, and is passionate about software craftsmanship. He has worked professionally in C, C++, Java, Scala, Perl, Javascript, Objective-C, Clojure, and Clojurescript. He is the lead architect and developer of the web development library Fulcro, is a contributor to Om Next.
  • 37.
    Clojure Iasi -meetup.com - Hang out & help each other on SLACK - Workshops - Guest speakers (remote skype/slack) - Build an open source SPA in Fulcro https://www.meetup.com/iasi-clojure/ Thank you !
  • 38.
    Getting started resources https://www.infoq.com/presentations/Simple-Made-EasyEssence of clojure https://defn.audio/episodes/2017/11/07/david-nolen.html Clojurescript overview https://www.packtpub.com/web-development/learning-clojurescript book https://cursive-ide.com/ editor https://shaunlebron.github.io/parinfer/ editor plugin for structural editing