Subject: [clisp-list] Compiler output

From: [email-masked]
Date: Mon Dec 16 15:31:10 2002

Thanks, Sam for providing this.  I will try it tonight.
My goal with function length is not to determine speed, but
rather to find places where one or 2 line functions were
written, to see if they add value to understanding the code,
or if the same one or 2 line function was written twice.
As a example, there is a function haulong, which
just calls integer-length,
another example is bigp and bignump which have the same
implementation.

---

From: Sam Steingold <[email-masked]>
Date: Mon Dec 16 20:52:02 2002

> * In message <[email-masked]>
> * On the subject of "Compiler output"
> * Sent on Mon, 16 Dec 2002 16:31:31 -0700 (MST)
> * Honorable [email-masked] writes:
>
you are welcome!

> My goal with function length is not to determine speed, but rather to
> find places where one or 2 line functions were written, to see if they
> add value to understanding the code, or if the same one or 2 line
> function was written twice.  As a example, there is a function
> haulong, which just calls integer-length, another example is bigp and
> bignump which have the same implementation.

see `cllib:code-complexity' in <CLOCC/CLLIB/fileio.lisp>

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat8 GNU/Linux
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
Daddy, why doesn't this magnet pick up this floppy disk?

---

From: Sam Steingold <[email-masked]>
Date: Tue Dec 17 07:20:02 2002

> * In message <[email-masked]>
> * On the subject of "Re: [clisp-list] Re: Compiler output"
> * Sent on Tue, 17 Dec 2002 06:49:08 -0700
> * Honorable Dan Stanger <[email-masked]> writes:
>
> Sam Steingold wrote:
> Could you add a function like this to the compiler also, which would
> output this information on a per function basis, or per top level
> form?

what for?  you already have cross-platform <CLOCC/CLLIB/fileio.lisp>!

what information internal to CLISP would you like me to export?

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat8 GNU/Linux
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
Never succeed from the first try - if you do, nobody will think it was hard.

---

From: Sam Steingold <[email-masked]>
Date: Tue Dec 17 08:16:05 2002

> * In message <[email-masked]>
> * Sent on Tue, 17 Dec 2002 08:30:06 -0700
> When the file is read in, would be the most convenient place to output
> this information.  The function complexity would be nice to have, I
> agree it is not as relevant as globals.

special variables are indeed hard to identify without a full-blown code
walker and compiler.
CVS head CLISP now prints them separately for each disassembly
(and you can easily grep disassembly for them in the released versions).

the bytecode size for each functions is obviously
implementation-specific and it has always been available.

> I would have to write a seperate program to compute this, put it in
> the makefile, then have another file to look thru rather than one, the
> listing file.

code complexity is heavily application-specific, not
implementation-specific, so the CLISP compiler should not have anything
to do with this.

you already have a sample `code-complexity' function in CLLIB.