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

Re: Vectors as functions

At 3:29 PM -0400 8/15/03, Joe Marshall wrote:
>The biggest problem with first-class environments ala MIT Scheme
>is the introduction of new bindings at runtime.  If you introduce a
>new binding, the `lexical address' (frame and offset) of a variable
>cannot be statically determined and you have to do a deep search
>every time.  It absolutely destroys any sort of compiler optimization.

You get used to it. Besides, compared to the optimizer hit that 
active data with unrestricted side-effects gives, this is nothing.

>If you went a tad further and allowed *syntactic* binding in
>first-class environments, you'd be truly hosed.

Oddly enough, no. It just makes certain classes of problems less 
tenable, but in return it makes other classes of problems more 
amenable to easy (well, OK, conceptually simple, with sufficient 
under the hood handwaving) solution. The biggest issue is that once 
you end up doing this, you find that you're really just writing an 
oddly-syntaxed version of perl, python, or ruby, and your tenure is 
in danger. :)

(In other words, welcome to my world...)

>----- Original Message -----
>From: "Michael Vanier" <mvanier@cs.caltech.edu>
>To: <brlewis@alum.mit.edu>
>Cc: <sperber@informatik.uni-tuebingen.de>; <ll1-discuss@ai.mit.edu>
>Sent: Friday, August 15, 2003 14:30
>Subject: Re: Vectors as functions
>>  > From: Bruce Lewis <brlewis@alum.mit.edu>
>>  > Date: 15 Aug 2003 14:10:11 -0400
>>  >
>>  > Michael Vanier <mvanier@cs.caltech.edu> writes:
>>  >
>>  > > I'm thinking of situations where you might have a list of symbols
>>  > > representing names (or first-class names) and you might want to set
>>  > > values to a given value, like mapping set! over the list of names.
>>  > > having names as first-class entities makes that unduly hard.
>>  >
>>  > If you're sure you want to do it this way, and not use a hash table to
>>  > deal with names at run time, then you probably want Common Lisp.
>>  >
>>  How would you use a hash table to deal with names at run time?
>>  [To Mike Sperber] Does "set" in common lisp destroy lexical scoping?  I'm
>>  not sure exactly what you were getting at, although I dimly understand
>>  there could be a problem.
>>  I feel like first-class environments a la MIT scheme are also relevant to
>>  this discussion, but I don't really know much about them.  Any MIT
>>  want to comment?
>>  I guess the bottom line is: how much freedom to mess around with the local
>>  environment is consistent with lexical scoping?
>>  Mike


--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
dan@sidhe.org                         have teddy bears and even
                                       teddy bears get drunk