clementine 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -0
- data/Gemfile +4 -2
- data/LICENSE.txt +22 -0
- data/README.md +11 -6
- data/Rakefile +22 -0
- data/clementine.gemspec +2 -1
- data/ext/clojure-clojurescript-bef56a7/.gitignore +13 -0
- data/ext/clojure-clojurescript-bef56a7/Clojurescript.iml +12 -0
- data/ext/clojure-clojurescript-bef56a7/README.md +29 -0
- data/ext/clojure-clojurescript-bef56a7/benchmark/cljs/benchmark_runner.cljs +155 -0
- data/ext/clojure-clojurescript-bef56a7/bin/cljsc +21 -0
- data/ext/clojure-clojurescript-bef56a7/bin/cljsc.bat +18 -0
- data/{vendor/assets → ext/clojure-clojurescript-bef56a7}/bin/cljsc.clj +0 -0
- data/ext/clojure-clojurescript-bef56a7/devnotes/README.org +35 -0
- data/ext/clojure-clojurescript-bef56a7/devnotes/bcrepl.org +13 -0
- data/ext/clojure-clojurescript-bef56a7/devnotes/cljs.org +500 -0
- data/ext/clojure-clojurescript-bef56a7/devnotes/corelib.org +583 -0
- data/ext/clojure-clojurescript-bef56a7/devnotes/day1.org +203 -0
- data/ext/clojure-clojurescript-bef56a7/devnotes/day2.org +44 -0
- data/ext/clojure-clojurescript-bef56a7/devnotes/talk.org +126 -0
- data/ext/clojure-clojurescript-bef56a7/devnotes/testing +13 -0
- data/ext/clojure-clojurescript-bef56a7/devnotes/todo.org +121 -0
- data/ext/clojure-clojurescript-bef56a7/epl-v10.html +261 -0
- data/ext/clojure-clojurescript-bef56a7/pom.template.xml +88 -0
- data/ext/clojure-clojurescript-bef56a7/samples/dom/.gitignore +2 -0
- data/ext/clojure-clojurescript-bef56a7/samples/dom/src/dom/test.cljs +48 -0
- data/ext/clojure-clojurescript-bef56a7/samples/dom/test.html +30 -0
- data/ext/clojure-clojurescript-bef56a7/samples/hello-js/.gitignore +2 -0
- data/ext/clojure-clojurescript-bef56a7/samples/hello-js/README.md +53 -0
- data/ext/clojure-clojurescript-bef56a7/samples/hello-js/externed-lib.js +7 -0
- data/ext/clojure-clojurescript-bef56a7/samples/hello-js/externs.js +3 -0
- data/ext/clojure-clojurescript-bef56a7/samples/hello-js/hello-extern.html +14 -0
- data/ext/clojure-clojurescript-bef56a7/samples/hello-js/hello-js-dev.html +18 -0
- data/ext/clojure-clojurescript-bef56a7/samples/hello-js/hello-js.html +17 -0
- data/ext/clojure-clojurescript-bef56a7/samples/hello-js/my-external-lib.js +3 -0
- data/ext/clojure-clojurescript-bef56a7/samples/hello-js/src/hello-js/core.cljs +9 -0
- data/ext/clojure-clojurescript-bef56a7/samples/hello-js/src/hello-js/extern-example.cljs +5 -0
- data/ext/clojure-clojurescript-bef56a7/samples/hello/.gitignore +2 -0
- data/ext/clojure-clojurescript-bef56a7/samples/hello/README.md +34 -0
- data/ext/clojure-clojurescript-bef56a7/samples/hello/hello-dev.html +18 -0
- data/ext/clojure-clojurescript-bef56a7/samples/hello/hello.html +13 -0
- data/ext/clojure-clojurescript-bef56a7/samples/hello/src/hello/core.cljs +8 -0
- data/ext/clojure-clojurescript-bef56a7/samples/hello/src/hello/foo/bar.cljs +4 -0
- data/ext/clojure-clojurescript-bef56a7/samples/nodehello.cljs +18 -0
- data/ext/clojure-clojurescript-bef56a7/samples/nodels.cljs +17 -0
- data/ext/clojure-clojurescript-bef56a7/samples/repl/.gitignore +2 -0
- data/ext/clojure-clojurescript-bef56a7/samples/repl/README.md +101 -0
- data/ext/clojure-clojurescript-bef56a7/samples/repl/index.html +27 -0
- data/ext/clojure-clojurescript-bef56a7/samples/repl/src/repl/test.cljs +73 -0
- data/ext/clojure-clojurescript-bef56a7/samples/twitterbuzz/.gitignore +2 -0
- data/ext/clojure-clojurescript-bef56a7/samples/twitterbuzz/README.md +42 -0
- data/ext/clojure-clojurescript-bef56a7/samples/twitterbuzz/index-advanced.html +80 -0
- data/ext/clojure-clojurescript-bef56a7/samples/twitterbuzz/index.html +88 -0
- data/ext/clojure-clojurescript-bef56a7/samples/twitterbuzz/reset.css +48 -0
- data/ext/clojure-clojurescript-bef56a7/samples/twitterbuzz/src/twitterbuzz/anneal.cljs +66 -0
- data/ext/clojure-clojurescript-bef56a7/samples/twitterbuzz/src/twitterbuzz/core.cljs +307 -0
- data/ext/clojure-clojurescript-bef56a7/samples/twitterbuzz/src/twitterbuzz/dom-helpers.cljs +95 -0
- data/ext/clojure-clojurescript-bef56a7/samples/twitterbuzz/src/twitterbuzz/layout.cljs +100 -0
- data/ext/clojure-clojurescript-bef56a7/samples/twitterbuzz/src/twitterbuzz/leaderboard.cljs +40 -0
- data/ext/clojure-clojurescript-bef56a7/samples/twitterbuzz/src/twitterbuzz/radial.cljs +91 -0
- data/ext/clojure-clojurescript-bef56a7/samples/twitterbuzz/src/twitterbuzz/showgraph.cljs +121 -0
- data/ext/clojure-clojurescript-bef56a7/samples/twitterbuzz/src/twitterbuzz/timeline.cljs +39 -0
- data/ext/clojure-clojurescript-bef56a7/samples/twitterbuzz/style.css +301 -0
- data/ext/clojure-clojurescript-bef56a7/samples/twitterbuzz/test_data.txt +1 -0
- data/ext/clojure-clojurescript-bef56a7/samples/twitterbuzz/tweet_maps.txt +1 -0
- data/ext/clojure-clojurescript-bef56a7/script/benchmark +30 -0
- data/ext/clojure-clojurescript-bef56a7/script/bootstrap +70 -0
- data/ext/clojure-clojurescript-bef56a7/script/browser-repl +16 -0
- data/ext/clojure-clojurescript-bef56a7/script/build +59 -0
- data/ext/clojure-clojurescript-bef56a7/script/clean +5 -0
- data/ext/clojure-clojurescript-bef56a7/script/closure-library-release/google-closure-library-third-party.pom.template +59 -0
- data/ext/clojure-clojurescript-bef56a7/script/closure-library-release/google-closure-library.pom.template +54 -0
- data/ext/clojure-clojurescript-bef56a7/script/closure-library-release/make-closure-library-jars.sh +87 -0
- data/ext/clojure-clojurescript-bef56a7/script/compile +41 -0
- data/ext/clojure-clojurescript-bef56a7/script/repl +13 -0
- data/ext/clojure-clojurescript-bef56a7/script/repl.bat +13 -0
- data/ext/clojure-clojurescript-bef56a7/script/repljs +15 -0
- data/ext/clojure-clojurescript-bef56a7/script/repljs.bat +14 -0
- data/ext/clojure-clojurescript-bef56a7/script/test +38 -0
- data/ext/clojure-clojurescript-bef56a7/script/test-compile +30 -0
- data/ext/clojure-clojurescript-bef56a7/src/clj/cljs/analyzer.clj +975 -0
- data/{vendor/assets → ext/clojure-clojurescript-bef56a7}/src/clj/cljs/closure.clj +173 -73
- data/ext/clojure-clojurescript-bef56a7/src/clj/cljs/compiler.clj +1081 -0
- data/ext/clojure-clojurescript-bef56a7/src/clj/cljs/core.clj +1158 -0
- data/{vendor/assets → ext/clojure-clojurescript-bef56a7}/src/clj/cljs/repl.clj +51 -25
- data/ext/clojure-clojurescript-bef56a7/src/clj/cljs/repl/browser.clj +258 -0
- data/ext/clojure-clojurescript-bef56a7/src/clj/cljs/repl/reflect.clj +75 -0
- data/{vendor/assets → ext/clojure-clojurescript-bef56a7}/src/clj/cljs/repl/rhino.clj +6 -5
- data/ext/clojure-clojurescript-bef56a7/src/clj/cljs/repl/server.clj +173 -0
- data/ext/clojure-clojurescript-bef56a7/src/clj/cljs/tagged_literals.clj +30 -0
- data/ext/clojure-clojurescript-bef56a7/src/cljs/cljs/core.cljs +7197 -0
- data/{vendor/assets → ext/clojure-clojurescript-bef56a7}/src/cljs/cljs/nodejs.cljs +1 -1
- data/{vendor/assets → ext/clojure-clojurescript-bef56a7}/src/cljs/cljs/nodejs_externs.js +0 -0
- data/{vendor/assets → ext/clojure-clojurescript-bef56a7}/src/cljs/cljs/nodejscli.cljs +1 -1
- data/ext/clojure-clojurescript-bef56a7/src/cljs/cljs/reader.cljs +551 -0
- data/{vendor/assets → ext/clojure-clojurescript-bef56a7}/src/cljs/clojure/browser/dom.cljs +59 -13
- data/{vendor/assets → ext/clojure-clojurescript-bef56a7}/src/cljs/clojure/browser/event.cljs +0 -0
- data/{vendor/assets → ext/clojure-clojurescript-bef56a7}/src/cljs/clojure/browser/net.cljs +8 -7
- data/{vendor/assets → ext/clojure-clojurescript-bef56a7}/src/cljs/clojure/browser/repl.cljs +2 -2
- data/ext/clojure-clojurescript-bef56a7/src/cljs/clojure/core/reducers.cljs +298 -0
- data/ext/clojure-clojurescript-bef56a7/src/cljs/clojure/data.cljs +162 -0
- data/ext/clojure-clojurescript-bef56a7/src/cljs/clojure/reflect.cljs +48 -0
- data/{vendor/assets → ext/clojure-clojurescript-bef56a7}/src/cljs/clojure/set.cljs +0 -0
- data/{vendor/assets → ext/clojure-clojurescript-bef56a7}/src/cljs/clojure/string.cljs +4 -10
- data/{vendor/assets → ext/clojure-clojurescript-bef56a7}/src/cljs/clojure/walk.cljs +0 -0
- data/{vendor/assets → ext/clojure-clojurescript-bef56a7}/src/cljs/clojure/zip.cljs +0 -0
- data/ext/clojure-clojurescript-bef56a7/test/cljs/cljs/binding_test.cljs +7 -0
- data/ext/clojure-clojurescript-bef56a7/test/cljs/cljs/binding_test_other_ns.cljs +3 -0
- data/ext/clojure-clojurescript-bef56a7/test/cljs/cljs/core_test.cljs +1678 -0
- data/ext/clojure-clojurescript-bef56a7/test/cljs/cljs/import_test.cljs +11 -0
- data/ext/clojure-clojurescript-bef56a7/test/cljs/cljs/import_test/foo.cljs +5 -0
- data/ext/clojure-clojurescript-bef56a7/test/cljs/cljs/letfn_test.cljs +19 -0
- data/ext/clojure-clojurescript-bef56a7/test/cljs/cljs/macro_test.cljs +6 -0
- data/ext/clojure-clojurescript-bef56a7/test/cljs/cljs/macro_test/macros.clj +5 -0
- data/ext/clojure-clojurescript-bef56a7/test/cljs/cljs/ns_test.cljs +14 -0
- data/ext/clojure-clojurescript-bef56a7/test/cljs/cljs/ns_test/bar.cljs +3 -0
- data/ext/clojure-clojurescript-bef56a7/test/cljs/cljs/ns_test/foo.cljs +7 -0
- data/ext/clojure-clojurescript-bef56a7/test/cljs/cljs/reader_test.cljs +124 -0
- data/ext/clojure-clojurescript-bef56a7/test/cljs/clojure/data_test.cljs +22 -0
- data/ext/clojure-clojurescript-bef56a7/test/cljs/clojure/string_test.cljs +97 -0
- data/ext/clojure-clojurescript-bef56a7/test/cljs/foo/ns_shadow_test.cljs +9 -0
- data/ext/clojure-clojurescript-bef56a7/test/cljs/test_runner.cljs +26 -0
- data/lib/clementine.rb +3 -24
- data/lib/clementine/clojurescript_engine.rb +9 -48
- data/lib/clementine/clojurescript_engine/base.rb +15 -0
- data/lib/clementine/clojurescript_engine/jruby.rb +46 -0
- data/lib/clementine/{clojurescript_engine_mri.rb → clojurescript_engine/mri.rb} +17 -10
- data/lib/clementine/version.rb +1 -1
- data/test/clojurescript_engine_test.rb +36 -14
- metadata +177 -83
- data/vendor/assets/lib/clojure.jar +0 -0
- data/vendor/assets/lib/compiler.jar +0 -0
- data/vendor/assets/lib/goog.jar +0 -0
- data/vendor/assets/lib/js.jar +0 -0
- data/vendor/assets/src/clj/cljs/compiler.clj +0 -1341
- data/vendor/assets/src/clj/cljs/core.clj +0 -702
- data/vendor/assets/src/clj/cljs/repl/browser.clj +0 -341
- data/vendor/assets/src/cljs/cljs/core.cljs +0 -3330
- data/vendor/assets/src/cljs/cljs/reader.cljs +0 -360
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
* ClojureScript Day #1
|
|
2
|
+
* Important things to note
|
|
3
|
+
** This should be a dialog, not a lecture
|
|
4
|
+
*** stop me, ask questions, understand deeply
|
|
5
|
+
** There are still many things I don't know or haven't decided
|
|
6
|
+
*** some tasks will be research
|
|
7
|
+
*** some pushback welcome
|
|
8
|
+
**** I reserve BDFL rights :)
|
|
9
|
+
** This is an opportunity to get involved early
|
|
10
|
+
*** stay flexible to avoid pain
|
|
11
|
+
** Welcome Chouser!
|
|
12
|
+
*** One of my first and best users and contributors
|
|
13
|
+
*** Someone whose opinions I value, and a Clojure expert
|
|
14
|
+
*** Author of a Clojure book not (yet) working at Relevance!
|
|
15
|
+
*** The first to walk down the ClojureScript road
|
|
16
|
+
** This is a key Clojure/core (with help) deliverable
|
|
17
|
+
*** We do more than maintain, we lead
|
|
18
|
+
**** community should be stunned (shhh!)
|
|
19
|
+
*** I'm very excited about this aspect
|
|
20
|
+
**** let's knock this out of the park!
|
|
21
|
+
* Intro and rationale
|
|
22
|
+
** Problem statement
|
|
23
|
+
*** Javascript is the only programmable technology in key target environments
|
|
24
|
+
**** i.e. the browser
|
|
25
|
+
**** nothing will change that for years to come
|
|
26
|
+
*** Javascript has the greatest reach in other key environments
|
|
27
|
+
**** i.e. mobile
|
|
28
|
+
*** Javascript (the language) is not very robust
|
|
29
|
+
**** Fewer good parts than bad parts
|
|
30
|
+
**** Much convention and discipline required to avoid headaches
|
|
31
|
+
**** Conventions differ between shops, libs
|
|
32
|
+
*** Ever increasing pressure to create richer applications in these environments
|
|
33
|
+
**** requiring more and larger libraries
|
|
34
|
+
***** ordinary minification doesn't scale up
|
|
35
|
+
**** increasing requirements complexity
|
|
36
|
+
***** can't add language or environment complexity on top
|
|
37
|
+
** Rationale
|
|
38
|
+
*** solving this problem will give developers important leverage
|
|
39
|
+
*** empower them to tackle more difficult problems
|
|
40
|
+
**** with greater confidence in the robustness of their solutions
|
|
41
|
+
*** inspire next-generation approaches to web and mobile development
|
|
42
|
+
* Strategy
|
|
43
|
+
** Compile (a subset of) Clojure to Javascript
|
|
44
|
+
*** reach everywhere JS does
|
|
45
|
+
** Clojure is simpler, more robust, more concise, more powerful overall than JS
|
|
46
|
+
*** yet maps well to JS as implementation artifact
|
|
47
|
+
** Leverage best-of-breed JS appraoches
|
|
48
|
+
*** Currently, IMO that is Google's, with Closure compiler and libraries
|
|
49
|
+
**** called gclosure hereafter
|
|
50
|
+
*** Fortunately both open sourced
|
|
51
|
+
*** Gclosure's strategy is whole-program optimization
|
|
52
|
+
**** resulting application includes only code actually used
|
|
53
|
+
**** this is essential to writing large (and small) applications against large and manifold libraries
|
|
54
|
+
***** while allowing those libs to be written in a straightforward, non-clever manner
|
|
55
|
+
** This is not just about the browser
|
|
56
|
+
*** Node.js, plugins anywhere JS is accepted, any future JS-based environments
|
|
57
|
+
** Non-objectives
|
|
58
|
+
*** complete Closure
|
|
59
|
+
**** subset, but try to make identical features identical
|
|
60
|
+
**** document differences
|
|
61
|
+
*** porting large applications in their entirety
|
|
62
|
+
**** portability layers unifying JS and Java
|
|
63
|
+
**** cross platform reach is about moving core competencies and libraries, not everything
|
|
64
|
+
** Profit!
|
|
65
|
+
*** ClojureScript becomes the most powerful language for generating the smallest and fastest JS applications
|
|
66
|
+
**** ClojureScript runs everywhere JS runs
|
|
67
|
+
*** This is Clojure's client story
|
|
68
|
+
*** This is Clojure's mobile story
|
|
69
|
+
*** A powerful tool for anyone willing to learn Clojure
|
|
70
|
+
* Tactics
|
|
71
|
+
** Don't change Clojure itself
|
|
72
|
+
*** even though it might make things easier
|
|
73
|
+
**** track those things we'd like to be different, and work into Clojure dev schedule
|
|
74
|
+
** The ClojureScript compiler is written in Clojure
|
|
75
|
+
*** The reader is Clojure's
|
|
76
|
+
*** Macros are written in Clojure
|
|
77
|
+
*** therefor, no compiler at runtime, *no eval*
|
|
78
|
+
**** browser-hosted REPL a non-target!
|
|
79
|
+
*** also, some things that are runtime-reified in Clojure (namespaces, Vars) may not be in ClojureScript
|
|
80
|
+
** GClosure's strategy requires JS to be written in a particular idiom
|
|
81
|
+
*** especially for the most advanced optimization
|
|
82
|
+
*** ClojureScript will always generate code compliant with advanced optimizations
|
|
83
|
+
*** ClojureScript will use the same packaging and dependency strategy as gclosure
|
|
84
|
+
** The gclosure library is an accepted dependency
|
|
85
|
+
*** but *nothing else* (other than base JS)
|
|
86
|
+
**** ok, and maybe some stealing from GWT output, if we're desperate
|
|
87
|
+
***** but that's really it
|
|
88
|
+
*** in particular, use gclosure for all environmental conditionality
|
|
89
|
+
**** we make no per-browser decisions ourselves
|
|
90
|
+
** The gclosure compiler is optional, but recommended for final delivery
|
|
91
|
+
*** but don't be too stupid without it
|
|
92
|
+
** The compiler has an enriched primitive set (vs Clojure's)
|
|
93
|
+
*** deftype
|
|
94
|
+
*** defprotocol
|
|
95
|
+
*** extend-type
|
|
96
|
+
*** need no runtime lib
|
|
97
|
+
**** allows bootstrap abstraction and data structures to be written in terms of these
|
|
98
|
+
** The runtime library is completely written in ClojureScript
|
|
99
|
+
*** No Javascript!
|
|
100
|
+
*** js* primitive escape hatch to reach gnarly stuff that ClojureScript won't expose
|
|
101
|
+
** Presumptions
|
|
102
|
+
*** JS is single-threaded, forever
|
|
103
|
+
**** nevertheless, we will use Clojure reference primitives (at least atom)
|
|
104
|
+
* Roadmap
|
|
105
|
+
** Compiler
|
|
106
|
+
*** It's alive!
|
|
107
|
+
*** a few more primitives to go
|
|
108
|
+
*** output needs to be sussed out
|
|
109
|
+
**** esp tested with gclosure compiler
|
|
110
|
+
*** some niceties missing (load-file etc)
|
|
111
|
+
** Libraries
|
|
112
|
+
*** Many core macros imported and work
|
|
113
|
+
**** testing required
|
|
114
|
+
**** some missing, like binding, dotimes
|
|
115
|
+
*** This space intentionally left blank (core.cljs)
|
|
116
|
+
**** that's why you're here!
|
|
117
|
+
**** Much work, but following trodden ground
|
|
118
|
+
***** Move the core abstractions to protocols
|
|
119
|
+
***** Implement the core data structures with deftype
|
|
120
|
+
***** copy fn impls, tweaking as needed
|
|
121
|
+
** Tooling
|
|
122
|
+
*** ClojureScript written to the spec of gclosure
|
|
123
|
+
*** Actual integration with tool chain TODO
|
|
124
|
+
**** Deps builder
|
|
125
|
+
**** Compilation with gclosure compiler
|
|
126
|
+
***** drive through API for greatest control vs CLI
|
|
127
|
+
**** finding/loading gclosure lib
|
|
128
|
+
**** testing
|
|
129
|
+
**** delivery
|
|
130
|
+
*** REPL and other expected dev conveniences
|
|
131
|
+
**** load (file), load-js
|
|
132
|
+
* Inside the compiler
|
|
133
|
+
** I will not be the only one who knows this!
|
|
134
|
+
*** only 500 lines
|
|
135
|
+
** [[http://en.wikipedia.org/wiki/Recursive_descent_parser][Recursive descent parser]]
|
|
136
|
+
** 2 phases
|
|
137
|
+
*** analyze
|
|
138
|
+
**** code data in -> AST data out
|
|
139
|
+
***** all ordinary Clojure data
|
|
140
|
+
**** each expr recursively analyzes nested exprs
|
|
141
|
+
**** checks for correct structure
|
|
142
|
+
*** emit
|
|
143
|
+
**** AST data in -> print JS (via side effect to *out*)
|
|
144
|
+
***** this allows with-out-str, or direct to file
|
|
145
|
+
***** alternative - thread output stream, meh
|
|
146
|
+
**** each expr recursively emits nested exprs
|
|
147
|
+
** Both analyze and emit are polymorphic
|
|
148
|
+
*** using multimethods
|
|
149
|
+
*** other than a little hand-routing at top of analyze, no global switch statement
|
|
150
|
+
**** extend the compiler by defining parse and emit methods
|
|
151
|
+
**** add special ops to specials set
|
|
152
|
+
** The threaded environment (env)
|
|
153
|
+
*** most important, :context and :locals
|
|
154
|
+
*** all name-introducing exprs (e.g. fn, let) augment the environment before passing to children
|
|
155
|
+
** Tricky bit - :context
|
|
156
|
+
*** In ClojureScript everything is an expression
|
|
157
|
+
**** but not in JS
|
|
158
|
+
**** optimal output requires knowledge of the context
|
|
159
|
+
***** :statement, :return, :expr
|
|
160
|
+
**** non-exprs in expr contexts require transformation (usually a function wrapper)
|
|
161
|
+
** Primitives walkthrough
|
|
162
|
+
*** if
|
|
163
|
+
*** def
|
|
164
|
+
*** fn*
|
|
165
|
+
*** do
|
|
166
|
+
*** let*
|
|
167
|
+
*** loop*
|
|
168
|
+
*** recur
|
|
169
|
+
*** new
|
|
170
|
+
*** set!
|
|
171
|
+
*** ns
|
|
172
|
+
*** deftype*
|
|
173
|
+
*** .
|
|
174
|
+
*** js*
|
|
175
|
+
** Macros walkthrough
|
|
176
|
+
*** macroexpansion
|
|
177
|
+
*** defprototype
|
|
178
|
+
*** extend-type
|
|
179
|
+
*** import-macros
|
|
180
|
+
*** the core/core trick
|
|
181
|
+
** Evaluation model
|
|
182
|
+
*** top down, form at a time
|
|
183
|
+
**** just like Clojure
|
|
184
|
+
**** just like JS
|
|
185
|
+
** What's missing?
|
|
186
|
+
*** validation that compilation ns resolved names exist in ns
|
|
187
|
+
*** more correctness checking
|
|
188
|
+
*** better error messages
|
|
189
|
+
**** ...
|
|
190
|
+
*** strategy for apply
|
|
191
|
+
* What's where
|
|
192
|
+
** src/clj/cljs/compiler.clj
|
|
193
|
+
*** the compiler
|
|
194
|
+
** src/clj/cljs/core.clj
|
|
195
|
+
*** core macros
|
|
196
|
+
** src/cljs/core.cljs
|
|
197
|
+
*** core library
|
|
198
|
+
* Todo
|
|
199
|
+
** separate org file
|
|
200
|
+
* Breakout and tackle tasks
|
|
201
|
+
** we'll substantially be in the same file
|
|
202
|
+
*** ideas for making that work?
|
|
203
|
+
* Regroup and feedback
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
* ClojureScript Day #2
|
|
2
|
+
* Welcome Thortech!
|
|
3
|
+
** Eric, Frank and Tom
|
|
4
|
+
*** Long time cohorts
|
|
5
|
+
* Tips
|
|
6
|
+
** Don't define things in terms of undefined things
|
|
7
|
+
*** someone else will just trip over later
|
|
8
|
+
** Test
|
|
9
|
+
*** nil
|
|
10
|
+
** Encapsulate use of -methods in a single place
|
|
11
|
+
** Where's the global namespace?
|
|
12
|
+
* Where are we at
|
|
13
|
+
* Where are we going
|
|
14
|
+
** [[file:corelib.org][Core lib punchlist]]
|
|
15
|
+
** [[file:~/dev/clojurescript/todo.org][To do]]
|
|
16
|
+
** [[https://github.com/relevance/clojurescript/issues][Tickets]]
|
|
17
|
+
* Release 1
|
|
18
|
+
** Make goog-compatible libs work
|
|
19
|
+
** Data structures
|
|
20
|
+
*** work but are not optimal for large instances
|
|
21
|
+
*** persistent guarantees
|
|
22
|
+
** seq library
|
|
23
|
+
** associative library
|
|
24
|
+
** indexed library
|
|
25
|
+
** atoms
|
|
26
|
+
** binding
|
|
27
|
+
** great tooling
|
|
28
|
+
*** push button
|
|
29
|
+
** reader?
|
|
30
|
+
*** print-read
|
|
31
|
+
** regex
|
|
32
|
+
* Release 2
|
|
33
|
+
** DOM manipulation
|
|
34
|
+
** Can I use jQuery?
|
|
35
|
+
** bitops
|
|
36
|
+
** multimethods
|
|
37
|
+
** hierarchy
|
|
38
|
+
** reader + record support
|
|
39
|
+
** unchecked
|
|
40
|
+
** bitops
|
|
41
|
+
** print
|
|
42
|
+
** eventing value add
|
|
43
|
+
** DOM value add
|
|
44
|
+
** UI value add
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
* Title
|
|
2
|
+
** Clojure
|
|
3
|
+
*** Rocks
|
|
4
|
+
** Javascript
|
|
5
|
+
*** Reaches
|
|
6
|
+
** Announcing Clojure on Javascript
|
|
7
|
+
*** ClojureScript
|
|
8
|
+
* Problem statement
|
|
9
|
+
** Javascript is the only programmable technology in key target environments
|
|
10
|
+
*** i.e. the browser
|
|
11
|
+
*** nothing will change that for years to come
|
|
12
|
+
** and has the greatest reach in other key environments
|
|
13
|
+
*** i.e. mobile
|
|
14
|
+
** Javascript (the language) is not very robust
|
|
15
|
+
*** Fewer good parts than bad parts
|
|
16
|
+
*** Much convention and discipline required to avoid headaches
|
|
17
|
+
*** Conventions differ between shops, libs
|
|
18
|
+
** Ever increasing pressure to create richer applications in these environments
|
|
19
|
+
*** requiring more, and larger, libraries
|
|
20
|
+
**** ordinary minification doesn't scale up
|
|
21
|
+
*** increasing requirements complexity
|
|
22
|
+
**** can't add language or environment complexity on top
|
|
23
|
+
* Rationale
|
|
24
|
+
** Clojure is arguably simpler, more powerful and more robust than JS
|
|
25
|
+
** JS VMs getting faster and more sophisticated
|
|
26
|
+
** Putting Clojure on JS empowers developers
|
|
27
|
+
* Strategy
|
|
28
|
+
** Compile (a substantial subset of) Clojure to Javascript source
|
|
29
|
+
** Leverage best-of-breed JS approaches
|
|
30
|
+
** Look beyond the browser
|
|
31
|
+
** Non-objectives
|
|
32
|
+
*** Complete Clojure
|
|
33
|
+
*** Portable large applications
|
|
34
|
+
*** Browser REPL demos etc
|
|
35
|
+
** Target is production applications
|
|
36
|
+
* Tactics
|
|
37
|
+
** Clojure[Script] in Clojure
|
|
38
|
+
*** Written in Clojure and itself
|
|
39
|
+
** Clojure on Closure
|
|
40
|
+
*** Google's JS toolkit
|
|
41
|
+
** Clojure[Script] in Clojure
|
|
42
|
+
** Google Closure
|
|
43
|
+
** some subset of my gclosure lightning talk
|
|
44
|
+
* Where we are at
|
|
45
|
+
** What's there?
|
|
46
|
+
*** Compiler
|
|
47
|
+
*** REPL
|
|
48
|
+
*** All the primitives (that make sense)
|
|
49
|
+
*** Arity overloading
|
|
50
|
+
*** Macros
|
|
51
|
+
*** Seqs, maps, vectors, sets
|
|
52
|
+
**** and supporting library
|
|
53
|
+
**** callable maps, vectors, sets
|
|
54
|
+
*** Symbols and keywords
|
|
55
|
+
*** deftypes and protocols
|
|
56
|
+
*** all the core abstractions as protocols
|
|
57
|
+
*** destructuring
|
|
58
|
+
*** 2500 lines of core libs!
|
|
59
|
+
*** clojure.string and .set .walk .zip
|
|
60
|
+
*** regex
|
|
61
|
+
*** reader?
|
|
62
|
+
*** Full participation with Google Closure library
|
|
63
|
+
**** ns mechanism maps to provide/require
|
|
64
|
+
*** compile-file and compile-project
|
|
65
|
+
** What's not (yet)?
|
|
66
|
+
*** Full collection persistence
|
|
67
|
+
*** defrecord
|
|
68
|
+
*** Multimethods
|
|
69
|
+
*** Hierarchy
|
|
70
|
+
*** Rich numerics
|
|
71
|
+
*** Testing framework
|
|
72
|
+
*** Misc core lib
|
|
73
|
+
** What won't be?
|
|
74
|
+
*** things related to threads
|
|
75
|
+
*** eval and runtime compilation
|
|
76
|
+
*** structs, proxy, Java type stuff
|
|
77
|
+
*** Runtime reification of:
|
|
78
|
+
**** Vars
|
|
79
|
+
**** Namespaces
|
|
80
|
+
**** Protocols
|
|
81
|
+
**** etc
|
|
82
|
+
** TBD
|
|
83
|
+
*** optimizations
|
|
84
|
+
**** chunks, transients
|
|
85
|
+
*** agents (on webworkers?)
|
|
86
|
+
*** unchecked
|
|
87
|
+
** What's different
|
|
88
|
+
*** no runtime Vars
|
|
89
|
+
*** some in-function subsetting
|
|
90
|
+
**** e.g. satisfies? is a macro, can't be mapped/applied
|
|
91
|
+
** It's alpha
|
|
92
|
+
* Where we are going
|
|
93
|
+
** This is Clojure's client story
|
|
94
|
+
** This is Clojure's mobile story
|
|
95
|
+
** This is Clojure's CLI scripting story
|
|
96
|
+
* The Team thus far - Clojure/core and friends
|
|
97
|
+
** Aaron Bedra
|
|
98
|
+
** Alan Dipert
|
|
99
|
+
** Alex Redington
|
|
100
|
+
** Bobby Calderwood
|
|
101
|
+
** Brenton Ashworth
|
|
102
|
+
** Chris Houser
|
|
103
|
+
** Devin Walters
|
|
104
|
+
** Eric Thorsen
|
|
105
|
+
** Frank Failla
|
|
106
|
+
** Michael Fogus
|
|
107
|
+
** Jonathan Clagett
|
|
108
|
+
** Jess Martin
|
|
109
|
+
** Luke VanderHart
|
|
110
|
+
** Chris Redinger
|
|
111
|
+
** Stuart Halloway
|
|
112
|
+
** Stuart Sierra
|
|
113
|
+
** Tom Hickey
|
|
114
|
+
* Participating
|
|
115
|
+
** This is a Clojure dev project
|
|
116
|
+
*** all with Clojure CAs welcome to participate
|
|
117
|
+
** The Friday invite
|
|
118
|
+
** The Conj
|
|
119
|
+
* Demo
|
|
120
|
+
** REPL
|
|
121
|
+
** Compilation
|
|
122
|
+
** Web app
|
|
123
|
+
** CLI app?
|
|
124
|
+
* Q & A
|
|
125
|
+
|
|
126
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Definitely a work-in-progress.
|
|
2
|
+
|
|
3
|
+
To run tests before you commit:
|
|
4
|
+
|
|
5
|
+
script/test
|
|
6
|
+
|
|
7
|
+
To add tests:
|
|
8
|
+
|
|
9
|
+
* Create test fiels in the test/cljs directory.
|
|
10
|
+
* Write fns that throw an exception on failure.
|
|
11
|
+
* Call those fns from test/cljs/cljs/test_runner.cljs
|
|
12
|
+
|
|
13
|
+
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
#+TODO: TODO IN-PROGRESS REVIEW DONE
|
|
2
|
+
* The near term tasks
|
|
3
|
+
* Compiler
|
|
4
|
+
** IN-PROGRESS throw/try/catch/finally :@stuarthalloway:
|
|
5
|
+
* Data structures
|
|
6
|
+
** IN-PROGRESS keyword :@levand:
|
|
7
|
+
*** requires interning strategy
|
|
8
|
+
**** possibly compiler support for same
|
|
9
|
+
*** string starting with noncharacter code
|
|
10
|
+
**** \uFFFE and \uFFFF are guaranteed noncharacters
|
|
11
|
+
**** use as prefix for keywords and symbols
|
|
12
|
+
**** must test in predicates string? symbol? keyword?
|
|
13
|
+
** IN-PROGRESS symbol :@levand:
|
|
14
|
+
*** string starting with noncharacter code
|
|
15
|
+
** DONE cons cell/list
|
|
16
|
+
** DONE map
|
|
17
|
+
*** first cut COW, string uniqueness required
|
|
18
|
+
** DONE vector
|
|
19
|
+
*** first cut, COW, internal array
|
|
20
|
+
** TODO numbers
|
|
21
|
+
*** js native number is our double
|
|
22
|
+
*** goog.math.Long?
|
|
23
|
+
**** building Long objects defeats fixnum support in JS VMs
|
|
24
|
+
**** but they are 32-bit - some type bits
|
|
25
|
+
* Abstractions
|
|
26
|
+
** TODO Clojure's interfaces
|
|
27
|
+
*** we don't need all of them
|
|
28
|
+
Associative
|
|
29
|
+
Counted
|
|
30
|
+
Fn
|
|
31
|
+
IBlockingDeref
|
|
32
|
+
IChunk
|
|
33
|
+
IChunkedSeq
|
|
34
|
+
IDeref
|
|
35
|
+
IEditableCollection
|
|
36
|
+
IFn
|
|
37
|
+
IKeywordLookup
|
|
38
|
+
ILookup
|
|
39
|
+
ILookupSite
|
|
40
|
+
ILookupThunk
|
|
41
|
+
IMapEntry
|
|
42
|
+
IMeta
|
|
43
|
+
Indexed
|
|
44
|
+
IndexedSeq
|
|
45
|
+
IObj
|
|
46
|
+
IPending
|
|
47
|
+
IPersistentCollection
|
|
48
|
+
IPersistentList
|
|
49
|
+
IPersistentMap
|
|
50
|
+
IPersistentSet
|
|
51
|
+
IPersistentStack
|
|
52
|
+
IPersistentVector
|
|
53
|
+
IProxy
|
|
54
|
+
IRecord
|
|
55
|
+
IReduce
|
|
56
|
+
IRef
|
|
57
|
+
IReference
|
|
58
|
+
ISeq
|
|
59
|
+
ITransientAssociative
|
|
60
|
+
ITransientCollection
|
|
61
|
+
ITransientMap
|
|
62
|
+
ITransientSet
|
|
63
|
+
ITransientVector
|
|
64
|
+
IType
|
|
65
|
+
MapEquivalence
|
|
66
|
+
Named
|
|
67
|
+
Reversible
|
|
68
|
+
Seqable
|
|
69
|
+
Sequential
|
|
70
|
+
Settable
|
|
71
|
+
Sorted
|
|
72
|
+
** Naming convention for protocols?
|
|
73
|
+
*** IBlah
|
|
74
|
+
** TODO equality and hashing
|
|
75
|
+
*** investigate gclosure and GWT
|
|
76
|
+
** TODO seqable
|
|
77
|
+
** TODO collection
|
|
78
|
+
** TODO counted
|
|
79
|
+
** DONE seq
|
|
80
|
+
** TODO lookup
|
|
81
|
+
** TODO associative
|
|
82
|
+
** TODO indexed
|
|
83
|
+
** TODO map
|
|
84
|
+
** TODO set
|
|
85
|
+
** TODO vector
|
|
86
|
+
** TODO deref
|
|
87
|
+
** TODO metadata
|
|
88
|
+
* Runtime Lib
|
|
89
|
+
** key missing macros
|
|
90
|
+
*** binding
|
|
91
|
+
**** single threaded
|
|
92
|
+
**** save, set!, finally restore
|
|
93
|
+
**** deps: try/finally primitives in compiler
|
|
94
|
+
*** dotimes
|
|
95
|
+
** math ops
|
|
96
|
+
*** intrinsify built-ins
|
|
97
|
+
*** handle variadic
|
|
98
|
+
** core.cljs!
|
|
99
|
+
*** crank through core.clj
|
|
100
|
+
*** see [[file:docs/corelib.org][docs/corelib.org]]
|
|
101
|
+
* Tools
|
|
102
|
+
** getting set up story
|
|
103
|
+
*** gclosure library
|
|
104
|
+
*** gclosure compiler
|
|
105
|
+
*** V8
|
|
106
|
+
**** optional for now?
|
|
107
|
+
** DONE REPL
|
|
108
|
+
*** there's a ticket for this
|
|
109
|
+
** Integration of gclosure library
|
|
110
|
+
*** how do we reference/load?
|
|
111
|
+
**** REPL runtime behavior of provide/require
|
|
112
|
+
*** versioning issues
|
|
113
|
+
**** just SVN revs
|
|
114
|
+
**** how to bind to version
|
|
115
|
+
** Testing
|
|
116
|
+
*** anything good in gclosure?
|
|
117
|
+
** Build
|
|
118
|
+
*** deps
|
|
119
|
+
*** glcosure compiler
|
|
120
|
+
**** invocation via API gives most control
|
|
121
|
+
**** but deps a Python thingy
|