Done. I added two tests, for good measure :-).
Noah
On Sun, Feb 19, 2012 at 4:53 AM, Andy Wingo wrote:
> On Sat 18 Feb 2012 17:20, Noah Lavine writes:
>
>> Here is another patch that fixes the first of my examples. (let* ((x
>> (random)) (y x)) (eq? x y)) now folds to (begin (random) #t). It
>>
On Sat 18 Feb 2012 17:20, Noah Lavine writes:
> Here is another patch that fixes the first of my examples. (let* ((x
> (random)) (y x)) (eq? x y)) now folds to (begin (random) #t). It
> turned out to be much smaller than the previous approach. Is it all
> right if I push this?
Looks good to me,
Here is another patch that fixes the first of my examples. (let* ((x
(random)) (y x)) (eq? x y)) now folds to (begin (random) #t). It
turned out to be much smaller than the previous approach. Is it all
right if I push this?
I'm not sure how to make the other one work yet, but I will think about it
Hi Noah,
On Fri 17 Feb 2012 03:22, Noah Lavine writes:
>>> (let* ((x (random))
>>> (y (list x))
>>> (z (car y))
>>> (eq? x z))
>>
> To make sure I understand, in the x-y-z example, psyntax would produce
> different gensyms for x and z, but peval could merge them later on,
> right
Hello,
On Thu, Feb 16, 2012 at 10:06 AM, Andy Wingo wrote:
> On Thu 16 Feb 2012 14:18, Noah Lavine writes:
>
>>> (let ((x (random)))
>>> (eq? x x))
>>
>> (let* ((x (random))
>> (y (list x))
>> (z (car y))
>> (eq? x z))
>
> This one should reduce to the same thing, but current
On Thu 16 Feb 2012 16:06, Andy Wingo writes:
> (list x) is not considered a "constant expression" because `let' is a
> "constructor"
I meant, `list' is a "constructor".
A
--
http://wingolog.org/
On Thu 16 Feb 2012 14:18, Noah Lavine writes:
>> (let ((x (random)))
>> (eq? x x))
>
> (let* ((x (random))
>(y (list x))
>(z (car y))
> (eq? x z))
This one should reduce to the same thing, but currently doesn't because
(list x) is not considered a "constant expression" beca
Hello,
> Note, we don't need to add extra identities to operands: they already
> have their gensyms. So to get the effect of this patch, you could add a
> clause to fold-constants:
>
> ((primcall src 'eq? (lexical _ _ x) (lexical _ _ y))
> (if (eq? x y)
> (make-const src #t)
> ))
>
On Thu 16 Feb 2012 02:29, Noah Lavine writes:
> (let* ((x (random))
>(y x))
> (eq? x y))
>
> The patch attached to this message lets peval optimize that to
>
> (begin (random) #t)
Neat :)
Note, we don't need to add extra identities to operands: they already
have their gensyms. So to
David Kastrup writes:
> David Kastrup writes:
>
>> Noah Lavine writes:
>>
>>> Hello,
>>>
>>> I've been working on a patch to add a new sort of optimization to
>>> peval, and I think it's almost ready. It's based on some of the ideas
>>> in "Environment Analysis of Higher-Order Languages".
>>>
>
David Kastrup writes:
> Noah Lavine writes:
>
>> Hello,
>>
>> I've been working on a patch to add a new sort of optimization to
>> peval, and I think it's almost ready. It's based on some of the ideas
>> in "Environment Analysis of Higher-Order Languages".
>>
>> The goal is to recognize when two
Noah Lavine writes:
> Hello,
>
> I've been working on a patch to add a new sort of optimization to
> peval, and I think it's almost ready. It's based on some of the ideas
> in "Environment Analysis of Higher-Order Languages".
>
> The goal is to recognize when two quantities are equal even when we
Hi Noah,
Noah Lavine writes:
> I've been working on a patch to add a new sort of optimization to
> peval, and I think it's almost ready. It's based on some of the ideas
> in "Environment Analysis of Higher-Order Languages".
Nice! :)
> There's one glaring wart. The identity checking is activiate
Hello,
I've been working on a patch to add a new sort of optimization to
peval, and I think it's almost ready. It's based on some of the ideas
in "Environment Analysis of Higher-Order Languages".
The goal is to recognize when two quantities are equal even when we
don't know what they are. My work
14 matches
Mail list logo