val _ = () and exception optimization in MLton

Suresh Jagannathan suresh@research.nj.nec.com
Sat, 12 Aug 2000 18:19:23 -0400


   From: "Stephen Weeks" <sweeks@intertrust.com>
   Content-Type: text/plain; charset=us-ascii
   Date: Fri, 11 Aug 2000 16:30:43 -0700 (PDT)
   Reply-to: MLton@sourcelight.com
   X-UIDL: e194477d21a43485465ff1d9bc754079

   So my previous optimization was too aggressive.  I could imagine some kind of
   local flow analysis to try to improve stuff, but that sounds too messy.  Here is 
   my new proposal.  The optimization will remove a handler push/pop if there are
   no nontail calls in the scope of the handler, but will not otherwise move the
   push/pop.

Isn't this going to weaken the utility of the optimization 
seriously?  Other than for fairly trivial expressions or
loops containing fairly trivial expressions, I don't see
how this optimization would get enabled since I would
expect almost any interesting expression to have a non-tail
call somewhere in its dynamic scope.

On the point of separate assembly -- I'll chime in with
Steve and Henry that some kind of set partition based on
some connected component metric is the right way to go.
To a first approximation, I would think that we'd never
want to split a top-level function across separate assembly
files.

    -- sj