Re: Translating from language which allows Goto's

nmm1@cus.cam.ac.uk (Nick Maclaren)
21 Jul 2003 00:29:34 -0400

          From comp.compilers

Related articles
Translating from lagugae which allows Goto's dana.subscriptions@virgin.net (Dana Freer) (2003-07-04)
Re: Translating from language which allows Goto's Thomas.Schneider@donauland.at (2003-07-13)
Re: Translating from language which allows Goto's mcintosh@mc-pc.research.telcordia.com (2003-07-13)
Re: Translating from language which allows Goto's dmr@bell-labs.com (Dennis Ritchie) (2003-07-15)
Re: Translating from language which allows Goto's nmm1@cus.cam.ac.uk (2003-07-21)
Re: Translating from language which allows Goto's bettini@dsi.unifi.it (Lorenzo Bettini) (2003-07-21)
Re: Translating from language which allows Goto's channahr@comcast.net (norm@plumpirate.com) (2003-07-25)
| List of all articles for this month |

From: nmm1@cus.cam.ac.uk (Nick Maclaren)
Newsgroups: comp.compilers
Date: 21 Jul 2003 00:29:34 -0400
Organization: University of Cambridge, England
References: 03-07-042 03-07-070 03-07-106
Keywords: analysis
Posted-Date: 21 Jul 2003 00:29:33 EDT

In article 03-07-106,
"Dennis Ritchie" <dmr@bell-labs.com> writes:
|> "Allen McIntosh" <mcintosh@mc-pc.research.telcordia.com> wrote
|> > Dana Freer <dana.subscriptions@virgin.net> wrote:
|> > >I am not a compiler writer but have the task of writing a tranlslator to
|> > >convert from a language which allows GOTO, GOSUB, RETURN into a language
|> > >(like VbScript) which does not alllow GOTO etc. Is this impossible? Will
|> > >human intervention always be required?
|>
|> > You should try to see if Brenda Baker ever wrote up "struct". It was
|> > a program that converted Fortran into Ratfor. (Better yet, send her
|> > e-mail.) My guess is that you can do what you want unless the
|> > flowgraph is irreducible.
|> > [I'm pretty sure I've read a BTL tech report. It was quite impressive]
|>
|> I tried to find a local CSTR or other machine-readable paper, without
|> success. Brenda does list these publications:
|>
|> B.S. Baker, An Algorithm for Structuring Flowgraphs, J. ACM 24,1 , January, 1977, pp. 98--120.
|>
|> B.S. Baker, An Algorithm for Structuring Programs: Extended Abstract, Proc. 3rd ACM Symposium
|> on Principles of Programming Languages, January 1976, pp. 98-120.
|>
|> (I'm suspicious of the identical page numbers...)
|>
|> Her struct tool was distributed with 7th Edition Unix, but wasn't maintained.


While I don't believe that there was any coding inheritance, nor
probably even any algorithmic inheritance, struct's success was
strongly influential on the Toolpack project. Not least in convincing
the suspicious that we were being excessively theoretical in saying
that the problem was insoluble.


[ I thought at the time that automatic conversion was practical only
for clean code written in a disciplined programming style. I was
wrong. It is true that really revolting code cannot be converted
into anything better, but it turns out that such code is very rare
indeed. ]


The source of Toolpack is still available:


        http://www.nag.co.uk/public/tpack.asp


NAG were one of the Toolpack developers, and now market the NAGWare
tools which do the same sort of thing, only more so. They have been
used to convert older Fortrans to more modern ones, both in-house and
by customers. If you have a major commercial conversion project of
that nature, it is well worth contacting them.


So struct's intellectual inheritance is alive and well.




Regards,
Nick Maclaren.


Post a followup to this message

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