home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / fortran / 4758 < prev    next >
Encoding:
Internet Message Format  |  1992-12-16  |  2.1 KB

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