On Wed, Apr 25, 2012 at 5:22 AM, Brandon Bloom <snprbo...@gmail.com> wrote:
> 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. > The current optimizations are really only guaranteed to work on core.cljs. I encountered the dependency problem while working on the optimizations. > 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? > I'm not sure why we need this - the user sets the src path. We can use this to resolve files. > 3) A namespace may point to a Google Closure Javascript namespace, not > even written in ClojureScript. How do we detect those? > Resolve the resource, check if it is a .cljs file. > 4) Assuming we have a Javascript namespace, how do we get the Google > Closure exports? (for call optimizations & warn-on-undeclared) > We should figure this out but later. > Two questions: > > 1) Has someone thought this through before? > Not really :) Currently dependency ordering happens *after* compilation which is unfortunate. It would be preferable to do dependency ordering *before* analysis. David -- 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