Synopses & Reviews
Learn how to build complete client-side applications with ClojureScript, the Clojure language variant that compiles to optimized JavaScript. This hands-on introduction shows you how ClojureScript not only has similarities to JavaScript—without the flaws—but also supports the full semantics of its parent language. Youll delve into ClojureScripts immutable data structures, lazy sequences, first-class functions, macros, and support for JavaScript libraries.
No previous experience with Clojure or ClojureScript is necessary. If youre familiar with JavaScript, HTML, CSS, and the DOM, youll quickly discover that ClojureScript has the same reach as JavaScript, but with more power.
- Start writing ClojureScript code with the Leiningen build system
- Learn how the ClojureScript compiler works to produce optimized JavaScript
- Use JavaScript functions and libraries directly from ClojureScript code
- Explore functions in Clojures sequence library such as map, reduce, and filter
- Use macros to define new control structures or embed domain-specific languages
- Compile manually or script your own workflow with ClojureScripts compiler tools
- Integrate ClojureScript with Clojure on the JVM to build powerful client-server applications
Synopsis
This book will be an introduction and guide to using ClojureScript, targeted at developers who know JavaScript and are willing to learn Clojure.
About the Author
Stuart Sierra is a Clojure/ClojureScript developer, a member of Clojure/core, and a co-author of Practical Clojure (Apress, 2010). Stuart lives in New York City.
Luke VanderHart is a Clojure/ClojureScript developer, a member of Clojure/core, and a co-author of Practical Clojure (Apress, 2010). Luke lives in Maryland.
Table of Contents
Preface; Who Should Read This Book; How to Use This Book; Conventions Used in This Book; Using Code Examples; Safari® Books Online; How to Contact Us; Acknowledgments; Chapter 1: Introduction: Why ClojureScript?; 1.1 The Rise of Browser Applications; 1.2 The Rise of JavaScript; 1.3 The Need for a Better Language; 1.4 Introducing ClojureScript; Chapter 2: Hello World; 2.1 Leiningen; 2.2 Using lein-cljsbuild; Chapter 3: The Compilation Process; 3.1 Architecture; 3.2 How to Compile; 3.3 Compilation in Depth; 3.4 Summary; Chapter 4: ClojureScript Basics; 4.1 ClojureScript versus Clojure; 4.2 Expressions and Side Effects; 4.3 Syntax and Data Structures; 4.4 Special Forms and Definitions; 4.5 Functions; 4.6 Local Bindings; 4.7 Closures; 4.8 Flow Control; 4.9 JavaScript Interop; 4.10 Summary; Chapter 5: Data and State; 5.1 Primitives; 5.2 Data Structures; 5.3 Identity and State; Chapter 6: Sequences; 6.1 The Sequence Abstraction; 6.2 Lazy Sequences; 6.3 The Sequence API; Chapter 7: Namespaces, Libraries, and Google Closure; 7.1 Namespaces; 7.2 Advanced Compilation Mode; 7.3 Consuming Libraries; 7.4 Creating Libraries; Chapter 8: Macros; 8.1 Code as Data; 8.2 Writing Macros; 8.3 Using Macros; 8.4 When to Write Macros; 8.5 Summary; Chapter 9: Development Process and Workflow; 9.1 Installing ClojureScript; 9.2 The Built-In Tools; 9.3 The Browser REPL; 9.4 Additional lein-cljsbuild Features; Chapter 10: Integration with Clojure; 10.1 AJAX; 10.2 The Reader and Printer; 10.3 Example Client-Server Application; 10.4 Extending the Reader; 10.5 Sharing Code; 10.6 Summary; Libraries; ClojureScript's Standard Library; Google Closure Library; Domina; Enfocus; Jayq; C2; core.logic;