| ... Keith's comments:
| ...
| remind me of a Mark Jones idea from a few years ago (PEPM'94; Lisp &
| Symbolic Computation 8, 3, 1995) to use partial evaluation to achieve
| overloading without dictionary arguments.
| 
| Is this idea sitting on a back burner somewhere or was it abandoned due
| to problems with separate compilation and code explosion?

I never saw a single program where code explosion was a problem.
Indeed, in every case, partial evaluation/specialization actually
resulted in *smaller* compiled programs.  To be honest, it wasn't
specialization itself that made programs smaller.  Instead, by
eliminating dictionaries, it made it easier to detect components
that weren't actually needed.  The elimination of this dead code
more than compensated for the increase caused by specialization.

Separate compilation is still an issue, I guess.

Another difficulty arises from the presence of polymorphic recursion
in Haskell.  Gofer didn't have that, so you could be sure that, even
if there was a code explosion, you could at least rely on getting a
finite program.  Consider, however, the following Haskell program:

   f  :: Eq a => a -> Bool
   f x = (x==x)  &&  (f [x])

To evaluate an expression like (f True) using specialization, you
would have to implement an infinite family of versions of f with
type variable a ranging over Bool, [Bool], [[Bool]], ... etc.
There are a couple of ways that you might try and deal with this,
for example, using a hybrid of dictionary passing and specialization,
but it is one further complication to deal with ...

All the best,
Mark

----------------------------------------------------------------------------
[EMAIL PROTECTED]  Pacific Software Research Center, Oregon Graduate Institute
Looking for a PhD or PostDoc?  Interested in joining PacSoft?  Let us know!
 


Reply via email to