One program w/ many languages 
Author Message
 One program w/ many languages


Quote:
> A couple of years ago I came across a program listing
> (a hundred lines or so) which could be compiled as many
> different languages, e.g. Pascal, perl, c, etc.
> (sorry I cannot remember exactly which ones).
> If I remember correctly, the trick was to use comments
> and trick the individual compilers into thinking it was
> a pascal/perl/c program, when in fact it was all of them.

ATM:
Similar games can be played with words and letters that mean
one thing in English but other things in foreign languages,
and vice versa.  Can anybody translate (compile in their heads)
the following snippets of linguistic ambiguity?

it comes (Latin from Vergil)

BEC OCMOTP Y HAC (language? meaning?)

Quote:
> Does anyone still have this program?
> Has there been similar recent attempts?

> Also, does anyone have any other fun-with-languages things, like

ATM:
If under "fun-with-languages things" you would include
upsetting the natural order of evolution;
introducing the ROBO SAPIENS http://www.*-*-*.com/ (q.v.);
releasing an AI Mind in one language to metastasize to others (cf.
http://www.*-*-*.com/ );
bringing about a {*filter*}netic Economy as prosperity engine for humans;
and racing pell-mell towards the Technological Singularity of Vinge
http://www.*-*-*.com/ ~phoenix/vinge/vinge-sing.html --
then look for such fun among the links below.

Quote:
> the perl poetry contest which appeared in the perl journal?

>/Fred

Arthur
--
http://www.*-*-*.com/ : DIY AI
http://www.*-*-*.com/
http://www.*-*-*.com/ : AI in Pascal
http://www.*-*-*.com/


Tue, 04 Mar 2003 03:00:00 GMT  
 One program w/ many languages


 :> A couple of years ago I came across a program listing
 :> (a hundred lines or so) which could be compiled as many
 :> different languages, e.g. pascal, perl, c, etc.
 :> (sorry I cannot remember exactly which ones).
 :> If I remember correctly, the trick was to use comments
 :> and trick the individual compilers into thinking it was
 :> a pascal/perl/c program, when in fact it was all of them.

such programs come and go... look at
http://atrey.karlin.mff.cuni.cz/~pavel/podfuk/podfuk.c
which is a regular C program and a Makefile.

 : ATM:
 : Similar games can be played with words and letters that mean
 : one thing in English but other things in foreign languages,
 : and vice versa.  Can anybody translate (compile in their heads)
 : the following snippets of linguistic ambiguity?

 : it comes (Latin from Vergil)

 : BEC OCMOTP Y HAC (language? meaning?)

russian, words carefully chosen using cyrillic letter that look
a lot like some letters from latin alphabet, escaping the need
to transliterate or to have a russian font

meaning "we have all (the) examination" or something
there should be a soft sign I guess (BECb = all,
BEC = weight and then the sentence does not make sense)
there is nothing inheritedly peculiar in this sentence, though

--
 -----------------------------------------------------------
| Radovan Garabik  http://melkor.dnp.fmph.uniba.sk/~garabik |

 -----------------------------------------------------------



Thu, 06 Mar 2003 03:00:00 GMT  
 One program w/ many languages
I didn't get the original post, but here you go.  Replace each ^ with a

if from ftp://ftp.quitt./net/outgoing/polyglot

-----------------------------8<------------------------

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^(*O/*_/
Ex=
CuG^#%*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*------------------------------------------------------------------*+Ex=
CuG^#%*^^^POLYGLOT^-^a^program^in^seven^languages^^^^^^15^February^1991^^*+Ex=
CuG^#%*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^Written^by^Kevin^Bungard,^Peter^Lisle,^and^Chris^Tham^^^^^^^^^^*+Ex=
CuG^#%*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^We^have^successfully^run^this^program^using^the^following:^^^^^*+Ex=
CuG^#%*^^^^^ANSI^COBOL:^^^^^^^^^^^^MicroFocus^COBOL85^(not^COBOL74)^^^^^^*+Ex=
CuG^#%*^^^^^ISO^^Pascal:^^^^^^^^^^^Turbo^Pascal^(DOS^&^Mac),^Unix^PC,^^^^*+Ex=
CuG^#%*^^^^^^^^^^^^^^^^^^^^^^^^^^^^AIX^VS^Pascal^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^^^ANSI^fortran:^^^^^^^^^^Unix^f77,^AIX^VS^Fortran^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^^^ANSI^C^(lint^free):^^^^Microsoft^C,^Unix^CC,^GCC,^Turbo^C++,^*+Ex=
CuG^#%*^^^^^^^^^^^^^^^^^^^^^^^^^^^^Think^C^(Mac)^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^^^postscript:^^^^^^^^^^^^GoScript,^HP/Adobe^cartridge,^^^^^^^^^*+Ex=
CuG^#%*^^^^^^^^^^^^^^^^^^^^^^^^^^^^Apple^LaserWriter^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^^^Shell^script:^^^^^^^^^^gnu^bash,^sh^(SysV,^BSD,^MKS),^ksh^^^^*+Ex=
CuG^#%*^^^^^8086^machine^language:^MS-DOS^2.00,^3.03,^4.01,^5.00^beta^^^^*+Ex=
CuG^#%*^^^^^^^^^^^^^^^^^^^^^^^^^^^^VPix^&^DOS^Merge^(under^unix)^^^^^^^^^*+Ex=
CuG^#%*^^^^^^^^^^^^^^^^^^^^^^^^^^^^SoftPC^(on^a^Mac),^MKS^shell^^^^^^^^^^*+Ex=
CuG^#%*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^Usage:^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^^^1.^Rename^this^file^to^polyglot.[cob|pas|f77|c|ps|sh|com]^^^^*+Ex=
CuG^#%*^^^^^2.^Compile^and/or^run^with^appropriate^compiler^and^^^^^^^^^^*+Ex=
CuG^#%*^^^^^^^^operating^system^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^Notes:^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^^^1.^We^have^attempted^to^use^only^standard^language^features.^*+Ex=
CuG^#%*^^^^^^^^Without^the^-traditional^flag^gcc^will^issue^a^warning.^^^*+Ex=
CuG^#%*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^^^2.^This^text^is^a^comment^block^in^all^seven^languages.^^^^^^*+Ex=
CuG^#%*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^^^3.^When^run^as^a^.COM^file^with^MS-DOS^it^makes^certain^^^^^^*+Ex=
CuG^#%*^^^^^^^^(not^unreasonable)^assumptions^about^the^contents^of^^^^^^*+Ex=
CuG^#%*^^^^^^^^the^registers.^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^^^4.^When^transfering^from^Unix^to^DOS^make^sure^that^a^LF^^^^^*+Ex=
CuG^#%*^^^^^^^^is^correctly^translated^into^a^CR/LF.^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*^^^Please^mail^any^comments,^corrections^or^additions^to^^^^^^^^^^*+Ex=

CuG^#%*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=
CuG^#%*------------------------------------------------------------------*QuZ=
CuG^#%*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*+Ex=

CuG^#(*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*(
C^^^#^*/);^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/*(
C^^^#^*)^^program^^^^^^^^polyglot^(output);^^^^^^^^^^^^^^^^^^^^^^^^^^^^^(*+
C^^^#^^^^^identification^division.
C^^^#^^^^^program-id.^^^^polyglot.
C^^^#
C^^^#^^^^^data^^^^^^^^^^^division.
C^^^#^^^^^procedure^^^^^^division.
C^^^#
C^^^#^*^))cleartomark^^^/Bookman-Demi^findfont^36^scalefont^setfont^^^^^(
C^^^#^*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^(
C^^^#
C^^^#^*^^^^^^^^^^^^^^^^^^hello^polyglots$
C^^^#^^^^^main.
C^^^#^^^^^^^^^perform
C^^^^^*^)^2>_$$;^echo^^^"hello^polyglots";^rm^_$$;^exit
^^^^^^^^^^^^^^print
C^^^^^^^^^^^^^stop^run.
^^^^^-*,^^^^^^^^^^^^^^^^'hello^polyglots'
C
C^^^^^^^^^print.
C^^^^^^^^^^^^^display^^^"hello^polyglots".^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^(
C^^^^^*/^^int^i;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/*
C^^^^^*/^^main^()^{^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/*
C^^^^^*/^^^^^^i=printf^("hello^polyglots\n");^^^^^^^^^^^^^^^^^^^^^^^^^^^/*
C^^^^^*)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^(*
C^^^^^*)^^begin^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^(*
C^^^^^*)^^^^^^writeln^^('hello^polyglots');^^^^^^^^^^^^^^^^^^^^^^^^^^^^^(*
C^^^^^*)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^(*^)
C^^^^^*^)^pop^60^360^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^(
C^^^^^*^)^pop^moveto^^^^(hello^polyglots)^show^^^^^^^^^^^^^^^^^^^^^^^^^^(
C^^^^^*^)^pop^showpage^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^((
C^^^^^*)
^^^^^^^^^^^end^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^.(*^)
C)pop%^^^^^program^^^^^^^polyglot.^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*){*/}

--
#include <standard.disclaimer>
 _
Kevin D Quitt  USA 91351-4454           96.37% of all statistics are made up
Per the FCA, this email address may not be added to any commercial mail list



Fri, 07 Mar 2003 03:00:00 GMT  
 One program w/ many languages

[ With the comments removed and the ^s changed to spaces. ]

Quote:
> (*O);
> int i;
> main () {
>   i=printf ("hello polyglots\n");
> }

You call a variadic function without a prototype in scope; that means
you have undefined behaviour and this is not, actually, a correct C
program. Using puts() instead of printf() would make this somewhat more
correct, though a C99 compiler would still complain, and would demand
you explicitely declare main() to return int as well.
Either way, you don't need i, at least not for C.

Richard



Sat, 08 Mar 2003 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. M353 Programming and Programming Languages

2. New programming language written in TP7.0

3. Article - The Pascal Programming Language

4. Article - The Pascal Programming Language

5. About mixed language programming

6. Mixed language programming: VB6 / D4 / CPPB

7. Need a new programming language..please help

8. Article - The Pascal Programming Language

9. Article - The Pascal Programming Language

10. LOOKING FOR AN IDE FOR EVERY PROGRAMMING LANGUAGE...

11. mixed language programming with gnu pascal

 

 
Powered by phpBB® Forum Software