home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!sol.ctr.columbia.edu!ira.uka.de!uni-heidelberg!rz.uni-karlsruhe.de!fg70.rz.uni-karlsruhe.de!ig25
- From: ig25@fg70.rz.uni-karlsruhe.de (Thomas Koenig)
- Newsgroups: comp.lang.fortran
- Subject: Re: Uglifier (was Re: Real Programmers)
- Date: 16 Dec 1992 14:19:25 GMT
- Organization: University of Karlsruhe, Germany
- Lines: 31
- Message-ID: <1gndtdINNo5q@nz12.rz.uni-karlsruhe.de>
- References: <gay.724466320@sfu.ca> <1992Dec16.025109.24541@coe.montana.edu> <BzC6n8.J2G@news.cso.uiuc.edu>
- Reply-To: ig25@rz.uni-karlsruhe.de
- NNTP-Posting-Host: fg70.rz.uni-karlsruhe.de
- Keywords: n
-
- In article <BzC6n8.J2G@news.cso.uiuc.edu> ercolessi@uimrl3.mrl.uiuc.edu (furio ercolessi) writes:
-
- >Hmmm ...
- >did any one ever made a source code uglifier, a filter removing
- >all comments, renaming all variables as A1,A2,... (*), removing all
- >extra spaces, replacing character constants with Holleriths, etc?
- >It could be a useful tool after all! Sometimes you do not want to
- >give away your sources, you would like to give only the binaries
- >but that's impractical ... this would be a brilliant intermediate
- >solution, give uglified code! :-)
- >
- >Also, sounds like a good exercise for some CS course.
-
- There is an uglifyer for C code; I believe it was posted to one of the
- comp.sources.* - groups some time ago. So, run your f77 program through
- f2c, then through this program. As far as I remember, it not only
- called the variables a1, a2, but some random combination of xyyxyx...
-
- For a FORTRAN - specific uglifier, I'd suggest such a scheme (especially
- for COMMON blocks, things could get really interesting). Also, replace all
- IF THEN - constructs by computed GOTO's, throw out all declarations by
- relying on implicit typing alone, build in a few traps for the unwary
- (DO 10 I=1.3 comes to mind, as does IF (A.GT.0.) THEN A = 0.), add a few
- random characters after column 72 which would still make sense, replace
- all PARAMETER statements by their values...
-
- The possiblities are almost boundless.
- --
- Thomas Koenig, ig25@rz.uni-karlsruhe.de, ig25@dkauni2.bitnet
- The joy of engineering is to find a straight line on a double logarithmic
- diagram.
-