Path: utzoo!yunexus!geac!syntron!jtsv16!uunet!seismo!sundc!pitstop!sun!decwrl!labrea!rutgers!mit-eddie!uw-beaver!uw-june!pardo From: pardo@june.cs.washington.edu (David Keppel) Newsgroups: comp.arch Subject: Re: Software Distribution Message-ID: <5655@june.cs.washington.edu> Date: 6 Sep 88 17:58:29 GMT Article-I.D.: june.5655 References: <891@taux01.UUCP> <28200195@urbsdc> Reply-To: pardo@uw-june.UUCP (David Keppel) Organization: U of Washington, Computer Science, Seattle Lines: 68 >>>[ portable intermediate representation ] >pardo@cs.washington.edu writes: >>How about C, the portable assembler? :-) :-) :-) aglew@urbsdc.Urbana.Gould.COM writes: >[ High-level IR (intermediate representation) needed for distribution ] >[ The customer can modify C too easily ] I'll claim that I can pretty easily write a program that takes ordinary C programs and makes them gosh-almighty hard to understand. Here are some things I can do: * Change names so that none of them are meaningful. * Perform function inlining so that content is replicated (e.g., hard to find). * Use random rewrite rules to change the structure of native constructs so that the code has no apparant style. * Intentionally include dead code that is removed by the optimizer. * Perform non-local data motion. * Study the Obfuscated C Code competition very closely :-) As a simple example: void foo(n) int n; { int i; for (i=0; i=p) return; else { a (m), z=r++; goto loop; } a (z); exit (0); } A fair optimizer should make the same code for both. Now C is probably sub-optimal for some (language) distributions, but you can perform the same "tricks" with nearly any language. BTW, I have a tool that takes unoptimized (.o) output from pcc on a VAX and turns it back into something close to the original code. Having a high-level IR may not gain the vendors anything over an existing "standard" such as C. ;-D on ( Clear as a bell ) Pardo -- pardo@cs.washington.edu {rutgers,cornell,ucsd,ubc-cs,tektronix}!uw-beaver!june!pardo