Date: Tue, 5 Oct 1999 12:49:52 -0400 (EDT)
   X-Authentication-Warning: renoir.cs.columbia.edu: beshers set sender to 
[EMAIL PROTECTED] using -f
   From: Clifford Beshers <[EMAIL PROTECTED]>
   Cc: [EMAIL PROTECTED]
   Sender: [EMAIL PROTECTED]
   Precedence: bulk
   Content-Type: text
   Content-Length: 2766

      Date: Tue, 05 Oct 1999 11:24:42 -0500
      From: Michael Hobbs <[EMAIL PROTECTED]>
      X-Accept-Language: en
      CC: [EMAIL PROTECTED]
      Content-Type: text/plain; charset=us-ascii
      Content-Length: 1026

      Clifford Beshers wrote:
      > All right, I'll take the bait.
      > 
      > The most important thing is to realize that we are discussing
      > computations that need to be done at compile time.  The results affect
      > the body of the source code.  Right now, the source code is
      > effectively required to be constant.  If we think in good functional
      > programming terms, we want to have the source code be the result of
      > some function.

      How about an `eval' Function?
      > eval :: String -> a
      It takes a chunk of Haskell code and evaluates it. Seen it done in Lisp
      many times.

   Yuck.  This forces you to have a parser in your program.  This is
   precisely what I want to avoid.  This is the sort of thing knee-jerk
   think I would think of.  Sheard has done a much better job.

   Haskell's strength comes from the extensive research into it's
   design.  Why leave off and do the first thing that comes to mind when
   making it more practical?

   The eval capability is part of MetaML.  But the string that represents
   the code is parsed at compile time, and a data structure is used
   instead.

Of course, I forgot one of the most important points.  My brain is
functioning a little better after lunch.

One huge advantage of MetaML is that it can statically type check the
meta code.  You can't do that when passing strings to eval. Witness
the errors that keep occuring when one uses Tcl/Tk programs
distributed with Linux.

A compiler maps a string to an executable function.  But it does it in
phases.  Parsing, lexical, syntax and type checking, transformation
and code generation, roughly.  So, any part that has statically bound
parameters can be partially evaluated at compile time.  Effectively,
MetaML is designed so that as much is done at compile time as
possible, leaving the runtime efficient.


Cliff

-- 
Clifford Beshers                     Computer Graphics and User Interfaces Lab
[EMAIL PROTECTED]                         Department of Computer Science
http://www.cs.columbia.edu/~beshers                        Columbia University



Reply via email to