guile-devel
[Top][All Lists]
Advanced

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

Re: Adding Identities to Peval


From: David Kastrup
Subject: Re: Adding Identities to Peval
Date: Thu, 16 Feb 2012 07:00:50 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux)

Noah Lavine <address@hidden> 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
> don't know what they are. My working example has been this expression:
>
> (let* ((x (random))
>        (y x))
>   (eq? x y))
>
> The patch attached to this message lets peval optimize that to
>
> (begin (random) #t)

I have a hard time imagining this optimization to be useful for any code
occuring in practice.  Can you suggest an example that would make more
sense than demonstrating that the optimization works?  Is this supposed
to help with automatically generated code like macros?

-- 
David Kastrup




reply via email to

[Prev in Thread] Current Thread [Next in Thread]