SlideShare a Scribd company logo
Clojurescript slides
Clojure ...
Clojure ...
          rocks
Clojure ...
          rocks
JavaScript ...
Clojure ...
          rocks
JavaScript ...
          reaches
ClojureScript
Why ClojureScript?
• JavaScript is the only programming
  technology in key environments
 • e.g. the browser
 • has the greatest reach in mobile
 • but is not very robust
• While demand for sophisticated
  applications increases
Rationale

• Clojure is arguably simpler, more powerful
  and more robust than JS
• JS VMs getting faster
• Clojure on JS empowers developers
Strategy

• Compile (a substantial subset of) Clojure to
  JS source
• Leverage best-of-breed JS approaches
• Look beyond the browser
Non-Objectives

• Complete Clojure
• Portable large applications
• Browser REPL demos etc

• The target is production applications
Tactics

• ClojureScript in Clojure(Script)
• ClojureScript on (Google) Closure
ClojureScript in
      Clojure(Script)
• Compiler written in Clojure
• Macros written in Clojure
• Library written in ClojureScript
 • No JavaScript source files
CinC

• Core abstractions are protocols
• Data structures are deftypes
• Excellent mapping to JS under the hood
REPL

• Written in Clojure
• Hosts embedded Rhino
• Compiles to JS on the fly
 • Rhino evals
Google Closure
• Production Code
• Closure Compiler
 • virtually all of Google’s JS goes through this
• Closure Library
 • Used by Google Gmail, Maps, Docs, Sites,
    Books, Reader, Calendar, Photos, Google+
Why Give Google
     Closure Away?
• Be cool
• Make friends
• See if it sticks
• Not using it anymore
• Sucker community into maintaining
• They want the web to win as an application
  platform
Closure Compiler
• Optimizing Compiler
 • Whitespace only
 • Within-function
 • Whole program (advanced mode)
• Try it:
 • http://closure-compiler.appspot.com/home
Another Minifier, yawn
• No!
• Closure compiler does symbol replacement
 • but also expression rewriting,
    transformation
• Dead code elimination
 • read as: uncalled code elimination
Why Whole Program
Optimization Matters
• Libraries
 • Large libraries
 • Many libraries
• Sum of many minified libs is large again
• What % of each lib do you use in one app?
 • Diminishing returns from delayed loading
    and modularity efforts
Making it work
• Convention, and lots of it
 • Welcome to Javascript!
 • Trickiness abounds - string access to
    properties, exporting, side-effects
• Google’s conventions not widely followed
• What if we had a Javascript-emitting
  language that always emitted advanced-
  mode compatible code?
Closure Library
• Huge!
 • UI, events, DOM, communications, testing,
    algorithms and data structures...
  • Packaging and dependency resolution
• Yet, not
 • Symbiotic with Closure compiler
 • Your app will include only the code it uses
   • require lib != use all of it
Whole-program
Optimization for the Win
 • Google has decided this is the key to
   delivering
   • rich applications
   • over thin wires
   • to memory constrained devices
 • Given away sophisticated tools for making
   that work
ClojureScript on
    (Google) Closure
• Emits advanced-mode compatible code
 • encapsulates conventions
• Participates in dependency system
 • maps Clojure namespaces to Google’s
    optimizable format
• Profit! - whole-program optimization and
  large library support
Find Out More




“The O’Reilly [kloh-zher] book -
 you know, with the bird on the
             front”
What’s There

• Compiler
• REPL
• Primitives
• Arity overloading
• Macros
What’s There

• Seqs, maps, vectors, sets
 • and much of supporting library
• Symbols, keywords
• Destructuring
• Regex
What’s There
• deftypes
 • core datatypes
• protocols
 • all abstractions
 • extend-type, extend-protocol
 • can extend primitives e.g. string, nil, default
• Both defined in terms of primitives
What’s There

• 2500+ lines of core lib
• clojure.string
• clojure.set
• clojure.walk
• clojure.zip
What’s There

• Reader
 • Why, given JSON?
   • Sets, keywords, symbols
   • Metadata
 • Great fit when Clojure on the server
What’s There
• Namespaces
 • integrated with Google Closure provide/
    require
• compile-file, build project, including
 • deps calculation
 • invocation of Google Closure compiler
What’s Not (yet)
• Full collection persistence
• defrecord
• multimethods/hierarchy
• Full numerics
• Testing
• Misc core library
What Won’t Be

• Thread-related things
• eval and runtime compilation
• structs, proxy, Java type-stuff
• Runtime reification of
 • Vars, namespaces, protocols etc
It’s Alpha!

• Bugs
• Missing bits
• Rough edges
• Work to do
Who Did This?
• Clojure/core and friends:
  Aaron Bedra, Alan Dipert, Alex Redington
  Bobby Calderwood, Brenton Ashworth
  Chris Houser, Devin Walters, Eric Thorsen
  Frank Failla, Michael Fogus, Jess Martin
  Luke VanderHart, Chris Redinger, Jonathan Claggett
  Stuart Halloway, Stuart Sierra, Tom Hickey
Participating
• This is a Clojure/dev project
 • all with Clojure CAs welcome to participate
• Plenty to do
 • Libraries
 • Environment
 • Tooling
Face Time
• The Conj!
 • Nov. 10-12 Raleigh, NC
 • With training: Nov. 7 -12
 • http://clojure-conj.org/
 • Early registration ends soon
• Core Fridays
Demo

• REPL
• Compilation
• Web app
• CLI app
Summary
• ClojureScript is
 • Clojure's client story
 • Clojure's mobile story
 • Clojure's CLI scripting story
• The power of Clojure
 • The reach of JavaScript

More Related Content

PDF
Javascript Libraries
PDF
Polyglot and Poly-paradigm Programming for Better Agility
PDF
Functional Programming with Immutable Data Structures
PDF
Why you should be excited about ClojureScript
PPTX
Scalable Open Source
PDF
Web Development using Ruby on Rails
PPTX
My first powershell script
KEY
Why ruby and rails
Javascript Libraries
Polyglot and Poly-paradigm Programming for Better Agility
Functional Programming with Immutable Data Structures
Why you should be excited about ClojureScript
Scalable Open Source
Web Development using Ruby on Rails
My first powershell script
Why ruby and rails

What's hot (20)

KEY
A web app in pure Clojure
PPTX
Put Your Thinking CAP On
PPTX
How NOT to get lost in the current JavaScript landscape
PPTX
Day 4 - Models
PDF
Modern javascript
KEY
Becoming a more productive Rails Developer
KEY
Freelancing and side-projects on Rails
PPTX
Be faster then rabbits
PDF
Bringing Interactivity to Your Drupal Site with Node.js Integration
KEY
Irb Tips and Tricks
PDF
CQ5 and Sling overview
PDF
GitBucket: The perfect Github clone by Scala
PDF
[Rakuten TechConf2014] [C-2] Big Data for eBooks and eReaders
PPTX
In-browser storage and me
PDF
Flexible UI Components for a Multi-Framework World
PDF
Eureka Moment UKLUG
PDF
Masterin Large Scale Java Script Applications
PDF
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
PPTX
Tampering with JavaScript
PPTX
A tale of 3 databases
A web app in pure Clojure
Put Your Thinking CAP On
How NOT to get lost in the current JavaScript landscape
Day 4 - Models
Modern javascript
Becoming a more productive Rails Developer
Freelancing and side-projects on Rails
Be faster then rabbits
Bringing Interactivity to Your Drupal Site with Node.js Integration
Irb Tips and Tricks
CQ5 and Sling overview
GitBucket: The perfect Github clone by Scala
[Rakuten TechConf2014] [C-2] Big Data for eBooks and eReaders
In-browser storage and me
Flexible UI Components for a Multi-Framework World
Eureka Moment UKLUG
Masterin Large Scale Java Script Applications
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
Tampering with JavaScript
A tale of 3 databases
Ad

Viewers also liked (20)

PPT
Nomenclatura e peças de container
PPTX
CLI utility in ClojureScript running on Node.js
PDF
Getting started with ClojureScript
PDF
Some basic FP concepts
PDF
ClojureScript Introduction
PDF
Clojure+ClojureScript Webapps
PDF
Clojure - Why does it matter?
PDF
PostgreSQL: O melhor banco de dados Universo
PDF
Making design decisions in React-based ClojureScript web applications
PDF
Learn basics of Clojure/script and Reagent
PDF
ClojureScript - A functional Lisp for the browser
PDF
An Adventure in Serverless ClojureScript
PPTX
Chalet management system (e cha m)
PDF
Hadoop - Simple. Scalable.
PDF
Writing Your Own JSR-Compliant, Domain-Specific Scripting Language
PPT
JCR Content Management
PDF
Implementing S-Expressions Based Extented Languages in LISP
PDF
Solos que não devem ser usados em olarias a frio
PPTX
SharePoint Governance and Lifecycle Management with Project Server 2010
PPT
Olaria de Barcelos
Nomenclatura e peças de container
CLI utility in ClojureScript running on Node.js
Getting started with ClojureScript
Some basic FP concepts
ClojureScript Introduction
Clojure+ClojureScript Webapps
Clojure - Why does it matter?
PostgreSQL: O melhor banco de dados Universo
Making design decisions in React-based ClojureScript web applications
Learn basics of Clojure/script and Reagent
ClojureScript - A functional Lisp for the browser
An Adventure in Serverless ClojureScript
Chalet management system (e cha m)
Hadoop - Simple. Scalable.
Writing Your Own JSR-Compliant, Domain-Specific Scripting Language
JCR Content Management
Implementing S-Expressions Based Extented Languages in LISP
Solos que não devem ser usados em olarias a frio
SharePoint Governance and Lifecycle Management with Project Server 2010
Olaria de Barcelos
Ad

Similar to Clojurescript slides (20)

PDF
Modern ClojureScript
PDF
Clojure Lightning Talk
PDF
HelsinkiJS - Clojurescript for Javascript Developers
PDF
CLJS Presentation
PPTX
Why clojure(script) matters
PDF
The Case for React.js and ClojureScript
PDF
Clojure in real life 17.10.2014
PDF
JSLab.Руслан Шевченко."JavaScript как платформа компиляции"
PDF
Jslab rssh: JS as language platform
PDF
The Ideas of Clojure - Things I learn from Clojure
PDF
Webbisauna - ClojureScript for Javascript Developers
PDF
REPL Driven Mobile Development with Clojure(script)
PDF
A New Baseline for Front-End Devs
PDF
Exploring Clojurescript
PDF
ClojureScript for the web
PDF
Functional Programming in Clojure
PDF
Welcome to ClojureScript
PDF
Clojure made-simple - John Stevenson
PDF
Progscon 2017: Taming the wild fronteer - Adventures in Clojurescript
ODP
Clojure made simple - Lightning talk
Modern ClojureScript
Clojure Lightning Talk
HelsinkiJS - Clojurescript for Javascript Developers
CLJS Presentation
Why clojure(script) matters
The Case for React.js and ClojureScript
Clojure in real life 17.10.2014
JSLab.Руслан Шевченко."JavaScript как платформа компиляции"
Jslab rssh: JS as language platform
The Ideas of Clojure - Things I learn from Clojure
Webbisauna - ClojureScript for Javascript Developers
REPL Driven Mobile Development with Clojure(script)
A New Baseline for Front-End Devs
Exploring Clojurescript
ClojureScript for the web
Functional Programming in Clojure
Welcome to ClojureScript
Clojure made-simple - John Stevenson
Progscon 2017: Taming the wild fronteer - Adventures in Clojurescript
Clojure made simple - Lightning talk

More from elliando dias (20)

PDF
Geometria Projetiva
PDF
How to Make an Eight Bit Computer and Save the World!
PDF
Ragel talk
PDF
A Practical Guide to Connecting Hardware to the Web
PDF
Introdução ao Arduino
PDF
Minicurso arduino
PDF
Incanter Data Sorcery
PDF
PDF
Fab.in.a.box - Fab Academy: Machine Design
PDF
The Digital Revolution: Machines that makes
PDF
Hadoop + Clojure
PDF
Hadoop and Hive Development at Facebook
PDF
Multi-core Parallelization in Clojure - a Case Study
PDF
From Lisp to Clojure/Incanter and RAn Introduction
PDF
FleetDB A Schema-Free Database in Clojure
PDF
Clojure and The Robot Apocalypse
PDF
Clojure - A new Lisp
PDF
Clojure - An Introduction for Lisp Programmers
PDF
Clojure - An Introduction for Java Programmers
PDF
Clojure and Modularity
Geometria Projetiva
How to Make an Eight Bit Computer and Save the World!
Ragel talk
A Practical Guide to Connecting Hardware to the Web
Introdução ao Arduino
Minicurso arduino
Incanter Data Sorcery
Fab.in.a.box - Fab Academy: Machine Design
The Digital Revolution: Machines that makes
Hadoop + Clojure
Hadoop and Hive Development at Facebook
Multi-core Parallelization in Clojure - a Case Study
From Lisp to Clojure/Incanter and RAn Introduction
FleetDB A Schema-Free Database in Clojure
Clojure and The Robot Apocalypse
Clojure - A new Lisp
Clojure - An Introduction for Lisp Programmers
Clojure - An Introduction for Java Programmers
Clojure and Modularity

Recently uploaded (20)

PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
cuic standard and advanced reporting.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Approach and Philosophy of On baking technology
PDF
Electronic commerce courselecture one. Pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Review of recent advances in non-invasive hemoglobin estimation
“AI and Expert System Decision Support & Business Intelligence Systems”
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Empathic Computing: Creating Shared Understanding
cuic standard and advanced reporting.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Approach and Philosophy of On baking technology
Electronic commerce courselecture one. Pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Digital-Transformation-Roadmap-for-Companies.pptx
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Diabetes mellitus diagnosis method based random forest with bat algorithm
NewMind AI Weekly Chronicles - August'25 Week I
Reach Out and Touch Someone: Haptics and Empathic Computing
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
Review of recent advances in non-invasive hemoglobin estimation

Clojurescript slides

  • 3. Clojure ... rocks
  • 4. Clojure ... rocks JavaScript ...
  • 5. Clojure ... rocks JavaScript ... reaches
  • 7. Why ClojureScript? • JavaScript is the only programming technology in key environments • e.g. the browser • has the greatest reach in mobile • but is not very robust • While demand for sophisticated applications increases
  • 8. Rationale • Clojure is arguably simpler, more powerful and more robust than JS • JS VMs getting faster • Clojure on JS empowers developers
  • 9. Strategy • Compile (a substantial subset of) Clojure to JS source • Leverage best-of-breed JS approaches • Look beyond the browser
  • 10. Non-Objectives • Complete Clojure • Portable large applications • Browser REPL demos etc • The target is production applications
  • 11. Tactics • ClojureScript in Clojure(Script) • ClojureScript on (Google) Closure
  • 12. ClojureScript in Clojure(Script) • Compiler written in Clojure • Macros written in Clojure • Library written in ClojureScript • No JavaScript source files
  • 13. CinC • Core abstractions are protocols • Data structures are deftypes • Excellent mapping to JS under the hood
  • 14. REPL • Written in Clojure • Hosts embedded Rhino • Compiles to JS on the fly • Rhino evals
  • 15. Google Closure • Production Code • Closure Compiler • virtually all of Google’s JS goes through this • Closure Library • Used by Google Gmail, Maps, Docs, Sites, Books, Reader, Calendar, Photos, Google+
  • 16. Why Give Google Closure Away? • Be cool • Make friends • See if it sticks • Not using it anymore • Sucker community into maintaining • They want the web to win as an application platform
  • 17. Closure Compiler • Optimizing Compiler • Whitespace only • Within-function • Whole program (advanced mode) • Try it: • http://closure-compiler.appspot.com/home
  • 18. Another Minifier, yawn • No! • Closure compiler does symbol replacement • but also expression rewriting, transformation • Dead code elimination • read as: uncalled code elimination
  • 19. Why Whole Program Optimization Matters • Libraries • Large libraries • Many libraries • Sum of many minified libs is large again • What % of each lib do you use in one app? • Diminishing returns from delayed loading and modularity efforts
  • 20. Making it work • Convention, and lots of it • Welcome to Javascript! • Trickiness abounds - string access to properties, exporting, side-effects • Google’s conventions not widely followed • What if we had a Javascript-emitting language that always emitted advanced- mode compatible code?
  • 21. Closure Library • Huge! • UI, events, DOM, communications, testing, algorithms and data structures... • Packaging and dependency resolution • Yet, not • Symbiotic with Closure compiler • Your app will include only the code it uses • require lib != use all of it
  • 22. Whole-program Optimization for the Win • Google has decided this is the key to delivering • rich applications • over thin wires • to memory constrained devices • Given away sophisticated tools for making that work
  • 23. ClojureScript on (Google) Closure • Emits advanced-mode compatible code • encapsulates conventions • Participates in dependency system • maps Clojure namespaces to Google’s optimizable format • Profit! - whole-program optimization and large library support
  • 24. Find Out More “The O’Reilly [kloh-zher] book - you know, with the bird on the front”
  • 25. What’s There • Compiler • REPL • Primitives • Arity overloading • Macros
  • 26. What’s There • Seqs, maps, vectors, sets • and much of supporting library • Symbols, keywords • Destructuring • Regex
  • 27. What’s There • deftypes • core datatypes • protocols • all abstractions • extend-type, extend-protocol • can extend primitives e.g. string, nil, default • Both defined in terms of primitives
  • 28. What’s There • 2500+ lines of core lib • clojure.string • clojure.set • clojure.walk • clojure.zip
  • 29. What’s There • Reader • Why, given JSON? • Sets, keywords, symbols • Metadata • Great fit when Clojure on the server
  • 30. What’s There • Namespaces • integrated with Google Closure provide/ require • compile-file, build project, including • deps calculation • invocation of Google Closure compiler
  • 31. What’s Not (yet) • Full collection persistence • defrecord • multimethods/hierarchy • Full numerics • Testing • Misc core library
  • 32. What Won’t Be • Thread-related things • eval and runtime compilation • structs, proxy, Java type-stuff • Runtime reification of • Vars, namespaces, protocols etc
  • 33. It’s Alpha! • Bugs • Missing bits • Rough edges • Work to do
  • 34. Who Did This? • Clojure/core and friends: Aaron Bedra, Alan Dipert, Alex Redington Bobby Calderwood, Brenton Ashworth Chris Houser, Devin Walters, Eric Thorsen Frank Failla, Michael Fogus, Jess Martin Luke VanderHart, Chris Redinger, Jonathan Claggett Stuart Halloway, Stuart Sierra, Tom Hickey
  • 35. Participating • This is a Clojure/dev project • all with Clojure CAs welcome to participate • Plenty to do • Libraries • Environment • Tooling
  • 36. Face Time • The Conj! • Nov. 10-12 Raleigh, NC • With training: Nov. 7 -12 • http://clojure-conj.org/ • Early registration ends soon • Core Fridays
  • 37. Demo • REPL • Compilation • Web app • CLI app
  • 38. Summary • ClojureScript is • Clojure's client story • Clojure's mobile story • Clojure's CLI scripting story • The power of Clojure • The reach of JavaScript