I've noticed that a lot of the new CLJS optimizations, such as direct arity 
dispatch, don't work correctly across namespaces. Upon deeper 
investigation, it seems like files are analyzed in an arbitrary order 
(alphabetically?) during builds. This means that the necessary metadata for 
such optimizations is potentially absent for dependencies. Similarly, 
*cljs-warn-on-undeclared* does not work across namespaces.

I was surprised to discover that the 'ns form does not force dependencies 
to be analyzed. Upon reflection, I realized that this would involve a few 
complications:

1) Namespaces need to be mapped to ClojureScript files. This would require 
a io/resource to discover them, which I guess involves setting CLASS_PATH?
2) Files shouldn't be re-analyzed multiple times during compilation (but 
support explicit re-analysis)
3) A namespace may point to a Google Closure Javascript namespace, not even 
written in ClojureScript. How do we detect those?
4) Assuming we have a Javascript namespace, how do we get the Google 
Closure exports? (for call optimizations & warn-on-undeclared)

Two questions:

1) Has someone thought this through before?
2) Do we really want-to/have-to add a CLASS_PATH (or even a CLJS_PATH and 
GCJS_PATH pair?) concept to get these optimizations working robustly?

Cheers,
Brandon

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to