Newsgroups: comp.lang.lisp,comp.lang.lisp.mcl
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!news.mathworks.com!news.alpha.net!uwm.edu!uwvax!uchinews!tango.uchicago.edu!mcdougal
From: Tom McDougal <mcdougal@cs.uchicago.edu>
Subject: Re: why is tree-shaking hard?
X-Nntp-Posting-Host: tango.uchicago.edu
Content-Type: text/plain; charset=ISO-8859-1
Message-ID: <D5E7Et.7HL@midway.uchicago.edu>
X-Xxmessage-Id: <AB89F12266020B33@tango.uchicago.edu>
X-Xxdate: Mon, 13 Mar 1995 18:54:58 GMT
Sender: news@midway.uchicago.edu (News Administrator)
Content-Transfer-Encoding: 8bit
Organization: Univ. of Chicago Computer Science
X-Newsreader: Nuntius 2.0.1_68K
References: <CONVERSE.95Mar2141828@orca.uchicago.edu>
Mime-Version: 1.0
Date: Mon, 13 Mar 1995 18:59:17 GMT
Lines: 37
Xref: glinda.oz.cs.cmu.edu comp.lang.lisp:17066 comp.lang.lisp.mcl:6623

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.

(Hi Tim.)

Not just EVAL, but also FUNCALL (and maybe APPLY).

For example, an evil programmer could write something like:

 (let* ((input (get-some-user-input))
        (function-name (read-a-fn-name input)))
   (funcall function-name))

Any possible function might be envoked.


A less evil programmer could write

  (let ((function-name (choose-function-from-assoc-list)))
    (funcall function-name . <args>))

The problem for the tree-shaker in the latter case is to realize
that the assoc-list contains names of functions that might
be executed.

I'm just making this stuff up but it seems reasonable. :-)

-- 
Tom McDougal    University of Chicago Artificial Intelligence
     mailto:mcdougal@cs.uchicago.edu 
     http://cs-www.uchicago.edu/~mcdougal
     PP-RH
