* Comments vs. commit log
[not found] <E1R86pF-00043N-0v@vcs.savannah.gnu.org>
@ 2011-09-27 20:43 ` Ludovic Courtès
2011-09-28 8:21 ` Andy Wingo
0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2011-09-27 20:43 UTC (permalink / raw)
To: Andy Wingo; +Cc: guile-devel
Hi Andy!
Just a meta-comment before I actually look into the code and fully
appreciate your work. :-)
"Andy Wingo" <wingo@pobox.com> skribis:
> commit 02ebea537fa805c615df44c4228db6a44d74c4b3
> Author: Andy Wingo <wingo@pobox.com>
> Date: Fri Sep 23 12:43:04 2011 +0200
>
> peval: simpler and more precise treatment of mutability
>
> * module/language/tree-il/optimize.scm (peval): The old approach of
> optimistically producing constants and then de-constifying them at
> their uses was not only cumbersome but incorrect: it both failed to
> preserve identity in some cases and failed to retain immutable
> constant values. Instead, now we only produce constants if they
> really are constant and immutable. The constant folder has to have a
> few more algebraic cases to be as effective as it was, to destructure
> (car (cons _ _)) appropriately. On the plus side, now constructors
> and deconstructors can handle impure cases more generally.
[...]
> +(define* (build-var-table exp #:optional (table vlist-null))
> + (tree-il-fold
> + (lambda (exp res)
> + (match exp
> + (($ <lexical-ref> src name gensym)
> + (let ((var (vhash-assq gensym res)))
> + (if var
> + (begin
> + (set-var-refcount! (cdr var) (1+ (var-refcount (cdr var))))
> + res)
> + (vhash-consq gensym (make-var name gensym 1 #f) res))))
> + (_ res)))
> + (lambda (exp res)
> + (match exp
> + (($ <lexical-set> src name gensym exp)
> + (let ((var (vhash-assq gensym res)))
> + (if var
> + (begin
> + (set-var-set?! (cdr var) #t)
> + res)
> + (vhash-consq gensym (make-var name gensym 0 #t) res))))
> + (_ res)))
> + (lambda (exp res) res)
> + table exp))
> +
> +(define-record-type <counter>
> + (%make-counter effort size continuation recursive? data prev)
> + counter?
> + (effort effort-counter)
> + (size size-counter)
> + (continuation counter-continuation)
> + (recursive? counter-recursive?)
> + (data counter-data)
> + (prev counter-prev))
Would it be possible to move the explanations from the commit log to
comments in the code?
Looking at the above code, I have no idea what a var-table or a counter
is, what it’s used for, etc.
Thanks,
Ludo’.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Comments vs. commit log
2011-09-27 20:43 ` Comments vs. commit log Ludovic Courtès
@ 2011-09-28 8:21 ` Andy Wingo
2011-09-30 12:48 ` Ludovic Courtès
0 siblings, 1 reply; 3+ messages in thread
From: Andy Wingo @ 2011-09-28 8:21 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: guile-devel
On Tue 27 Sep 2011 22:43, ludo@gnu.org (Ludovic Courtès) writes:
> Would it be possible to move the explanations from the commit log to
> comments in the code?
>
> Looking at the above code, I have no idea what a var-table or a counter
> is, what it’s used for, etc.
Sure. I forget sometimes, because I've read that Waddell & Dybvig paper
so many times that I forget it's not written down in the source ;)
Andy
--
http://wingolog.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Comments vs. commit log
2011-09-28 8:21 ` Andy Wingo
@ 2011-09-30 12:48 ` Ludovic Courtès
0 siblings, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2011-09-30 12:48 UTC (permalink / raw)
To: Andy Wingo; +Cc: guile-devel
Hi!
Andy Wingo <wingo@pobox.com> skribis:
> On Tue 27 Sep 2011 22:43, ludo@gnu.org (Ludovic Courtès) writes:
>
>> Would it be possible to move the explanations from the commit log to
>> comments in the code?
>>
>> Looking at the above code, I have no idea what a var-table or a counter
>> is, what it’s used for, etc.
>
> Sure. I forget sometimes, because I've read that Waddell & Dybvig paper
> so many times that I forget it's not written down in the source ;)
I wonder what the GCC hacker community would be like if its source code
wasn’t commented. :-)
Seriously though, I think that pointing to the paper would be nice, but
the paper is higher-level than the actual implementation, so comments
could fill in the gap.
Thanks,
Ludo’.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-09-30 12:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <E1R86pF-00043N-0v@vcs.savannah.gnu.org>
2011-09-27 20:43 ` Comments vs. commit log Ludovic Courtès
2011-09-28 8:21 ` Andy Wingo
2011-09-30 12:48 ` Ludovic Courtès
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).