[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: why is tree-shaking hard?



In article <3k3cke$u6@Yost.com> yost@Yost.com (Dave Yost) writes:

   In article <CONVERSE.95Mar2141828@orca.uchicago.edu> timoshenko,
   converse@cs.uchicago.edu writes:
   >I understand that allowing EVAL would make tree-shaking impossible,
   >(or at least "fruitless" :-) since you would not be able to predict in
   >advance which portions of the language would be needed at run time.
   >I'm curious what complexities have to be addressed even if you
   >rule out EVAL.

   I say why worry about eval, funcall, apply, and
   whatever.  If you're doing a tree shake, it's because
   you want to let go of a lot of stuff, and you are
   claiming that anything you really want to be there at
   runtime is referenced somewhere, say by keeping a
   global list of the things you want available at runtime
   whether they're clearly referenced in your code or not.

   Thus, a tree shaker could be free to be very aggressive and
   even a little dumb, with some burden on the programmer.

   Do any tree shakers work this way?

Well, we don't have a tree-shaker in Ilog Talk, but we do compute the
transitive closure for module dependencies when creating libraries or
executables; this achieves the same goal in a cleaner way. (You build
up rather than tear down.)  The problem with EVAL and SYMBOL-FUNCTION
still comes up.  (There is no problem with FUNCALL and APPLY; they
take objects as arguments and never names.)

We agree with Dave Yost.  We believe that module dependencies,
determined at compile time, should cover the entire application needs.
The cases where this is insufficient are rare and often a symptom of
an underlying design deficiency.  In the (very) few remaining cases,
the system provides escape hooks to go outside the module system.  For
instance, you can manually import a module into another, ignoring the
static dependency detection done by the module analyzer.

You can get more information about the Talk module system from our
LFP'94 conference paper "Talking about Modules and Delivery",
available from Ilog's web server at <URL:http://www.ilog.com/>.

-- Harley Davis




-- 

------------------------------------------------------------------------------
Harley Davis                            net: davis@ilog.fr
ILOG S.A.                               tel: +33 1 46 63 66 66
2 Avenue Galli駭i, BP 85                fax: +33 1 46 63 15 82
94253 Gentilly Cedex, France            url: http://www.ilog.com/

           Ilog Talk information: info@ilog.com