[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] [PATCH] Another exponential case: analyze-expressi
From: |
Peter Bex |
Subject: |
Re: [Chicken-hackers] [PATCH] Another exponential case: analyze-expression on LET expressions |
Date: |
Sat, 28 Jan 2012 14:01:49 +0100 |
User-agent: |
Mutt/1.4.2.3i |
On Sat, Jan 28, 2012 at 01:21:12PM +0100, Felix wrote:
> > Meanwhile, "make check" still passes and since there doesn't seem to be
> > an observable difference but it does affect out performance profile in a
> > positive way, I decided to post the patch to the list. What could
> > possibly go wrong?
>
> I think this change is not correct - "lambda" and "let" are not
> equivalent at this stage of the compiler: "let" introduces local
> variables and "lambda" creates a procedure. The distinction is
> important when determining whether a variable is "captured", i.e. when
> it is referenced or assigned from a different procedure (lambda)
> body.
Thanks for the feedback. I think I understand this part of the compiler
a little better now.
> If I understand this patch correctly, every "let" would be
> treated like a nested lambda and references to variables from outer
> "let" expressions would be marked as "captured".
That's exactly what it does.
Do you think you can produce a testcase which triggers a bug caused
by this patch? It would be a good regression test for further
optimizer/scrutinizer changes.
> The optimizer makes various assumptions about this (and the
> scrutinizer will, in a patch that is currently prepared).
I'll have another look at that patch. Armed with this info
I might better understand what it does.
Cheers,
Peter
--
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
is especially attractive, not only because it can be economically
and scientifically rewarding, but also because it can be an aesthetic
experience much like composing poetry or music."
-- Donald Knuth