Dump analyzer state during a compilation.

Description

CLJS doesn't have the luxury of a fully-reified runtime environment, therefore effective tooling needs a view of the internal compiler state. This issue addresses this need by enabling a dump of the compiler state based on additional cljs compiler options.

The compiler state is a map contained within an atom, either passed in as the 'compiler-env' arg to cljs.closure/build or contained globally within cljs.env/compiler.

The prototype is implemented as such:

:dump-analysis-to
either a string or rint, when rint, output will be written to out, when a string, the argument will be passed to clojure.java.io/writer.

:dump-analysis-full
checked for truthiness, default is false
When this is switched on, the full structure of the compiler state will be printed, which is impractically large for most use cases. In normal operation, :env keys and extended :method-params will be removed from the output, making the analysis represent simply the globally reachable environment. Additionally, only the contents under :cljs.analyzer/namespaces and :cljs.analyzer/constants will be printed.

Environment

None

Activity

Show:
Gary Trakhman
January 14, 2014, 12:46 AM

Added implementing patch

David Nolen
January 16, 2014, 11:21 PM

I question the utility of :dump-analysis-full for now. Lets remove it.

Gary Trakhman
January 16, 2014, 11:32 PM

I was thinking it might be good along with rint followed by a pipe, but... I don't have an explicit use-case. I'll create a new patch.

David Nolen
January 4, 2015, 12:13 AM

This ticket is subsumed by :cache-analysis support

Assignee

Unassigned

Reporter

Gary Trakhman

Labels

Approval

None

Patch

Code

Priority

Minor
Configure