|C to pascal, just this once firstname.lastname@example.org (Gary Cowley) (2000-08-05)|
|Re: C to pascal, just this once derekNOSPAM@knosof.co.uk (2000-08-10)|
|Re: C to pascal, just this once email@example.com (Scott Nicol) (2000-08-10)|
|Re: C to pascal, just this once firstname.lastname@example.org (Franck Pissotte) (2000-08-10)|
|Re: C to pascal, just this once email@example.com (Julio C. Rincon) (2000-08-13)|
|Re: C to pascal, just this once firstname.lastname@example.org (2000-08-13)|
|From:||email@example.com (Derek M Jones)|
|Date:||13 Aug 2000 18:51:29 -0400|
I had a brief private discussion with the author, who sent me some samples.
Some of the code did not look nice. There are a variety of reasons
why converted code may not look as good as the original.
Old style function declarations. The translator has to assume worst
case. Using prototypes can make a big difference.
Macro that expand to complicated expressions. In this case source
that looks simple suddenly becomes complicated.
Mixing different types (not a problem in the code I saw). This causes
lots of casts to be generated, again a translator has to play safe.
Finally the target language will just look different. For instance
a return X has to be translated to 'func_name:=X ; exit', two statements
that may then need a begin/end pair.
A lot can be gained in any translation project by working on the original
source to help the translator. For instance, going the other way, unnesting
any Pascal procedures leads to a much cleaner translation to C.
In terms of effort. If you have less than 20,000 lines it is probably
better to rewrite manually. More than that and a translator will make
Return to the
Search the comp.compilers archives again.