[racket] Optimizations at the library level.

From: Eli Barzilay (eli at barzilay.org)
Date: Thu Sep 2 08:02:15 EDT 2010

On Sep  2, Noel Welsh wrote:
> On Thu, Sep 2, 2010 at 12:20 PM, Eli Barzilay <eli at barzilay.org> wrote:
> > How is the haskell thing different from something like making `map' a
> > macro?  One obvious difference is that IIUC you can specify these
> > rules in some random library, which doesn't sound too good.
> It does to me :)

Well, it looks like I can write my random library with rules that
completely break your library -- and if the rules are installed as a
side-effect (and it seems that they are), then you won't be happy when
you get the bug reports.

(But if the rules are restricted to only modules that require them
directly, then it's back to something very similar to macros (modulo
the below).)

> I think the rules can be applied at the whim of the optimiser so 1)
> they don't have to reach a fixed point and 2) execution can be
> interleaved with other optimisation passes (like inlining). No
> macrology for map is going to inline
> (let ([a (map foo a-list)])
>   (map bar a))

Ah, that wasn't clear from that page.

          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!

Posted on the users mailing list.