Oops... I have overlooked part of docs about *mutable* locals. If that
is already implemented with optimizing compiler support and little
constant run-time overhead, then there is no need for my proposal.
Mutable locals will be just enough. Thank you for patience, I'll
promise to read docs more carefuly next time.

Maxim Savchenko

On Mon, Apr 7, 2008 at 10:04 PM, Daniel Ehrenberg <[EMAIL PROTECTED]> wrote:
> Well, for *zero* runtime overhead it's not possible without hacking
> the compiler, but in less than 20 lines I think it's possible to make
> a large-enough fixed-size stack with memory protection for overflow
> which doesn't depend on dynamically scoped variable lookup. (Well,
> what I'm thinking of wouldn't work well with continuations, but they
> can be redefined.) However, this is not all that useful in general.
> For one, if it's used for locals, then they're effectively dynamically
> scoped, causing the funarg problem all over again. Additionally, if
> they're going to have the same optimizations as >r and r>, then all
> use of them must be balanced, so it would do nothing more than >r and
> r> already do. In writing code in Factor, I've never encountered a
> problem where >r and r> were too awkward to express what I wanted to
> express, and I'm not sure what kinds of idioms would effectively take
> advantage of this ability.
>
> It's definitely an upside of locals that they have no runtime cost at
> all, but the more important (and broader, easier) goal was that they
> can be used with the optimizing compiler. Mutable locals do have a
> runtime cost, though they can still be used with the optimizing
> compiler.
>
> Dan

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to