home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / alt / hackers / 1946 < prev    next >
Encoding:
Text File  |  1993-01-21  |  6.3 KB  |  110 lines

  1. Newsgroups: alt.hackers
  2. Path: sparky!uunet!deshaw.com!christos
  3. From: christos@deshaw.com (Christos Zoulas)
  4. Subject: Re: obHack [polyglots]
  5. Message-ID: <C182ow.BAv@deshaw.com>
  6. Sender: usenet@deshaw.com
  7. Nntp-Posting-Host: prefect
  8. Organization: D. E. Shaw & Co.
  9. References: <1jhilrINNkjm@newsstand.cit.cornell.edu> <RODNEY.93Jan19163207@cabot.balltown.cma.com> <1jks8bINNsj4@matt.ksu.ksu.edu>
  10. Date: Thu, 21 Jan 1993 21:07:43 GMT
  11. Approved: god@deshaw.com
  12. Lines: 96
  13.  
  14. In article <1jks8bINNsj4@matt.ksu.ksu.edu> holland@matt.ksu.ksu.edu (Rich Holland) writes:
  15. >rodney@cabot.balltown.cma.com (Rodney Peck) writes:
  16. >
  17. >>well...  how'd you do it?  sed, ted, ed, fred, ex, emacs, vi, awk, perl, sh?
  18. >>Now, a cool hack would be to go ahead and write it in all of those just to 
  19. >>be spiteful.
  20. >
  21. >Does anyone have that little program lying around that was posted sometime
  22. >last year that compiles in many languages?  It worked in like C, fortran,
  23. >pascal, basic, and supposedly as a DOS .COM file....*looking through 
  24. >my NEWS directory*
  25.  
  26. Here it is:
  27.  
  28.                                                                          (*O/*_/
  29. Cu  #%* )pop mark/CuG 4 def/# 2 def%%%%@@P[TX---P\P_SXPY!Ex(mx2ex("SX!Ex4P)Ex=
  30. CuG #%*                                                                  *+Ex=
  31. CuG #%*------------------------------------------------------------------*+Ex=
  32. CuG #%*   POLYGLOT - a program in seven languages      15 February 1991  *+Ex=
  33. CuG #%*                                                                  *+Ex=
  34. CuG #%*   Written by Kevin Bungard, Peter Lisle, and Chris Tham          *+Ex=
  35. CuG #%*                                                                  *+Ex=
  36. CuG #%*   We have successfully run this program using the following:     *+Ex=
  37. CuG #%*     ANSI COBOL:            MicroFocus COBOL85 (not COBOL74)      *+Ex=
  38. CuG #%*     ISO  Pascal:           Turbo Pascal (DOS & Mac), Unix PC,    *+Ex=
  39. CuG #%*                            AIX VS Pascal                         *+Ex=
  40. CuG #%*     ANSI Fortran:          Unix f77, AIX VS Fortran              *+Ex=
  41. CuG #%*     ANSI C (lint free):    Microsoft C, Unix CC, GCC, Turbo C++, *+Ex=
  42. CuG #%*                            Think C (Mac)                         *+Ex=
  43. CuG #%*     PostScript:            GoScript, HP/Adobe cartridge,         *+Ex=
  44. CuG #%*                            Apple LaserWriter                     *+Ex=
  45. CuG #%*     Shell script:          gnu bash, sh (SysV, BSD, MKS), ksh    *+Ex=
  46. CuG #%*     8086 machine language: MS-DOS 2.00, 3.03, 4.01, 5.00 beta    *+Ex=
  47. CuG #%*                            VPix & DOS Merge (under unix)         *+Ex=
  48. CuG #%*                            SoftPC (on a Mac), MKS shell          *+Ex=
  49. CuG #%*                                                                  *+Ex=
  50. CuG #%*   Usage:                                                         *+Ex=
  51. CuG #%*     1. Rename this file to polyglot.[cob|pas|f77|c|ps|sh|com]    *+Ex=
  52. CuG #%*     2. Compile and/or run with appropriate compiler and          *+Ex=
  53. CuG #%*        operating system                                          *+Ex=
  54. CuG #%*                                                                  *+Ex=
  55. CuG #%*   Notes:                                                         *+Ex=
  56. CuG #%*     1. We have attempted to use only standard language features. *+Ex=
  57. CuG #%*        Without the -traditional flag gcc will issue a warning.   *+Ex=
  58. CuG #%*                                                                  *+Ex=
  59. CuG #%*     2. This text is a comment block in all seven languages.      *+Ex=
  60. CuG #%*                                                                  *+Ex=
  61. CuG #%*     3. When run as a .COM file with MS-DOS it makes certain      *+Ex=
  62. CuG #%*        (not unreasonable) assumptions about the contents of      *+Ex=
  63. CuG #%*        the registers.                                            *+Ex=
  64. CuG #%*                                                                  *+Ex=
  65. CuG #%*     4. When transfering from Unix to DOS make sure that a LF     *+Ex=
  66. CuG #%*        is correctly translated into a CR/LF.                     *+Ex=
  67. CuG #%*                                                                  *+Ex=
  68. CuG #%*   Please mail any comments, corrections or additions to          *+Ex=
  69. CuG #%*   peril@extro.ucc.su.oz.au                                       *+Ex=
  70. CuG #%*                                                                  *+Ex=
  71. CuG #%*------------------------------------------------------------------*QuZ=
  72. CuG #%*                                                                  *+Ex=
  73. CuG #%*!Mx)ExQX4ZPZ4SP5n#5X!)Ex+ExPQXH,B+ExP[-9Z-9Z)GA(W@'UTTER_XYZZY'CPK*+
  74. CuG #(*                                                                  *(
  75. C   # */);                                                              /*(
  76. C   # *)  program        polyglot (output);                             (*+
  77. C   #     identification division.
  78. C   #     program-id.    polyglot.
  79. C   #
  80. C   #     data           division.
  81. C   #     procedure      division.
  82. C   #
  83. C   # * ))cleartomark   /Bookman-Demi findfont 36 scalefont setfont     (
  84. C   # *                                                                 (
  85. C   #
  86. C   # *                  hello polyglots$
  87. C   #     main.
  88. C   #         perform
  89. C     * ) 2>_$$; echo   "hello polyglots"; rm _$$; exit
  90.               print
  91. C             stop run.
  92.      -*,                'hello polyglots'
  93. C
  94. C         print.
  95. C             display   "hello polyglots".                              (
  96. C     */  int i;                                                        /*
  97. C     */  main () {                                                     /*
  98. C     */      i=printf ("hello polyglots\n"); O= &i; return *O;         /*
  99. C     *)                                                                (*
  100. C     *)  begin                                                         (*
  101. C     *)      writeln  ('hello polyglots');                             (*
  102. C     *)                                                                (* )
  103. C     * ) pop 60 360                                                    (
  104. C     * ) pop moveto    (hello polyglots) show                          (
  105. C     * ) pop showpage                                                  ((
  106. C     *)
  107.            end                                                          .(* )
  108. C)pop%     program       polyglot.                                      *){*/}
  109.  
  110.