|Convert imperative to functional? email@example.com (#HUANG YUE#) (2003-10-27)|
|Re: Convert imperative to functional? firstname.lastname@example.org (Joachim Durchholz) (2003-10-31)|
|Re: Convert imperative to functional? email@example.com (2003-10-31)|
|From:||Joachim Durchholz <firstname.lastname@example.org>|
|Date:||31 Oct 2003 23:02:53 -0500|
|Organization:||Oberberg Online Infosysteme|
|Posted-Date:||31 Oct 2003 23:02:53 EST|
#HUANG YUE# wrote:
> He asked me whether it is possible to convert imperative back to
> functional structures? Easy for program analysis?
Just as with all program transformations: You can convert Fortran to
Pascal, but the resulting Pascal program will still be Fortran - in
other words, it will still exhibit all the quirks and problems of the
Fortran code, complicated by whatever hoops the conversion algorithm
had to jump through to get the semantics translated.
So, it's not possible to make analysis easier by transforming to
Stating it in another way: if the program transformer is indeed able
to transform imperative code into functional code, then any
improvements due to a "more functional style" will have required the
exactly same analysis that you spare if you can work with functional
> Is there some compiler able to do such similar thing?
Probably there are several, at wildly varying degrees of quality.
> Is it a fresh idea?
It's quite old. Actually, the same problems and answers apply to the
question how to transform an unstructured program into its GOTO-less
equivalent, so this question predates my birth.
> Or ridiculous?
No, the idea isn't ridiculous. It's just not (sensibly) feasible.
> I lack the knowledge in this area and feel eager to accept any
> related answer.
Hope this helped,
Return to the
Search the comp.compilers archives again.