Skip to end of metadata
Go to start of metadata


The ClojureScript analyzer delivers a lot of critical information that is often handled via vars and namespaces and the metadata attached to them. The ClojureScript compiler during the analysis phase puts this information into an atom - cljs.compiler/namespaces. In order to build robust analysis tools, i.e. a ClojureScript debugger, it would beneficial to associate the missing information with the symbols stored in cljs.compiler/namespaces. Then tools can easily call functions like cljs.compiler/analyze-file and have cljs.compiler/namespace populated with the data.

Currently useful information like :line, :file, :arglists are missing. We could put this information on the symbols stored in :defs for a namespace but that would be a bit too opaque. For human readability, it would be helpful to put what is traditionally var metadata into the clj.compiler/namespaces atom directly.

  1. Sep 03, 2012

    We should also consider the requirements for additional transform passes. For example, I'd like to explore what a transform would look like for generalized data-flow analysis. I see a bunch of code for working with :tag metadata, but I'd like to be able to reuse and expand that for stuff like CLJS-247, which suggests capturing type information from a 'satisfies? check. I can think of a few more use cases too..