Re: Algorithm for Structurizing

tleylan@aloha.com
Tue, 13 Dec 1994 01:59:34 GMT

          From comp.compilers

Related articles
Algorithm for Structurizing jlapp@nova.umd.edu (1994-12-04)
Re: Algorithm for Structurizing donawa@bnr.ca (chris (c.d.) donawa) (1994-12-09)
Re: Algorithm for Structurizing kik@zia.cray.com (1994-12-05)
Re: Algorithm for Structurizing danhicks@aol.com (1994-12-06)
Re: Algorithm for Structurizing tleylan@aloha.com (1994-12-07)
Re: Algorithm for Structurizing tleylan@aloha.com (1994-12-11)
Re: Algorithm for Structurizing tleylan@aloha.com (1994-12-13)
Re: Algorithm for Structurizing tleylan@aloha.com (1994-12-14)
| List of all articles for this month |
Newsgroups: comp.compilers,comp.lang.c,comp.programming
From: tleylan@aloha.com
Keywords: design
Organization: Flex Information Network HAWAII
References: 94-12-036 <m0rHDVY-00028lC@quake>
Date: Tue, 13 Dec 1994 01:59:34 GMT

On Mon, 12 Dec 1994, Glenn Thobe wrote:


> The programmer can use the automaton first (I would want to do this
> anyway) and then continue polishing in the manual mode. Thus an automaton
> would be a great help to the programmer attempting to work with old
> spaghetti code.


I'm not doubting you but personally I'd worry about the difference between
working "spaghetti" vs who-knows "auto-restructured" code particularly if
it was a 1) mission critical and 2) large. Do you trust the original
programmer (as poor as the code might be) more or less than the person who
designed the restructurer ? Could they be "programmatically" identical
people ?


I grabbed the paper referenced but I haven't read it yet. Clearly there
should be some processes within the entire structurizing process that can
be automated but I can easily imagine that (for instance) loops, unrolled
for speed could be re-rolled by the program. "That's a waste of space"
might be the basis of a decision that was conciously made because "this
will save execution time".


I do a lot of code "fixing" and routinely find large chunks of code that
can be reduced to one or two lines because a doubly-nested loop with 3 or
4 control variables can be replaced by a built-in library function. That
and you find identical chunks of code replicated in half a dozen places.
I'm skeptical about the level of improvement that an automated system can
make in situations such as these. It might be interesting to find two
such programs and have them restructure each other's output however...


tom
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.