|code transformations? firstname.lastname@example.org (1996-09-22)|
|Re: code transformations? email@example.com (1996-09-23)|
|Re: code transformations? firstname.lastname@example.org (Charles Fiterman) (1996-09-23)|
|Re: code transformations? email@example.com (1996-09-25)|
|Re: code transformations? firstname.lastname@example.org (Darius Blasband) (1996-09-26)|
|Re: code transformations? email@example.com (1996-09-26)|
|Re: code transformations? firstname.lastname@example.org (1996-09-26)|
|Re: code transformations? email@example.com (1996-09-29)|
|Re: code transformations? firstname.lastname@example.org (Norman Culver) (1996-09-29)|
|[4 later articles]|
|From:||Charles Fiterman <email@example.com>|
|Date:||23 Sep 1996 21:21:41 -0400|
Tom Lord <firstname.lastname@example.org> wrote:
>Some time ago, somebody suggested to me the idea of writing a certain
>kind of C preprocessor. The gist of it was that the preprocessor
>would actually parse the program, make some changes to the AST and
>then write source back to disk. This got me to thinking -- suitably
>sophisticated transformations could preserve the semantics of the
>program, while completely disguising the text of the source. This has
>obvious implications for anyone into intellectual property theft.
>So the question is, has anybody written such a program? Will anyone?
>Would releasing such a program on the net be like the SATAN of IP?
>[There are certainly C obfuscators, but the ones I know of perform primarily
>lexical smooshing. -John]
There are plenty of programs like that. The strongest are partial
evaluators and can be looked up under partial evaluation. I'm suprised
that C compilers don't make the transformation. But sqrt(4.0) should
generate 2.0 not a function call. This works better if you can tell
the system which functions may be regarded as pure functions. For
example sqrt(-1.0) will produce an error message. Now an error message
is a side effect and thus sqrt is not pure on examination. But that
error message is more useful at compile time than run time so the user
should say sqrt is pure.
The opposite example is delay(int milliseconds) compiler examination
of the function may show it is pure and can thus be run at compile
time, lifted out of loops, or even discarded since it returns
nothing. Any of these acts is clearly an error. The user must have a
way of saying delay is not pure no matter what it looks like.
Return to the
Search the comp.compilers archives again.