Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site kcl-cs.UUCP Path: utzoo!watmath!clyde!bonnie!akgua!sdcsvax!sdcrdcf!hplabs!hao!seismo!mcvax!ukc!kcl-cs!malcolm From: malcolm@kcl-cs.UUCP (Malcolm Shute.) Newsgroups: net.jokes Subject: Computer Languages used for Human Communication Message-ID: <445@kcl-cs.UUCP> Date: Sat, 1-Dec-84 13:01:05 EST Article-I.D.: kcl-cs.445 Posted: Sat Dec 1 13:01:05 1984 Date-Received: Tue, 4-Dec-84 08:26:17 EST Reply-To: malcolm@kcl-cs.UUCP (Malcolm Shute.) Organization: King's College Dept. of Computing, Westfield College, London, England Lines: 89 A lot of discussion in net.ai, over the last few months, has been concerned with ambiguity in languages. Several people have stated that if a language is completely unambiguous then it probably isn't very powerful (for instance it can't easily describe many human feelings, especially in the forms of puns, jokes, satire, poetry, literature etc.). Computer languages attempt to be unambiguous. This is one of their central characteristics (despite the fact that they don't always succeed in this respect). I wondered how easy it would be to convey a message like "Merry Christmas" in such languages. Can I express such a message to another human being, using a computer language as my medium? (It should be emphasised that the program does not need to be executed... it is the source code which is to be used to carry the message.) Here is my attempt to write in Pascal, "I wish you a Merry Christmas, and a Happy New Year": you := Christmas [ merry ] ; you := Year.New [ happy ] ; i.e. Assign a Christmas, modified by merry, to you; and then assign a Year, modified by New and happy, to you. It is interesting to note parallels with natural language; for instance, the use of words borrowed from other languages, like "you Christmas merry Year New happy" (which in fact could just as easily have been borrowed from any other natural language) mixed in with native words, like ":= [ ] . ;". Although (* comments *) are part of Pascal, I would consider it to be cheating to use them to carry the message. I haven't really done this 'translation into Pascal' very well, in two respects. First, I rely far too heavily on the use of 'borrowed' words. This is especially true in the example below. Secondly, I have chosen to ignore part of the semantics of ":=", namely that it is destructive assignment. So the second statement above destroys the effect of the first. I could have used: writeln( you, Christmas[merry] ); where "you" is of type text, but it wouldn't look as good. So for the purposes of this article, I will continue to use ":=". So now, I bring you, for your entertainment (and to wish everyone in netland a happy Christmas advent), my contribution to computer science for 1984: "I'm dreaming of a white Christmas", written in Pascal. If anyone has any thoughts on how to improve the translation, or how to tranlate into other computer languages or technical notations (e.g. mathematical ones), I would be interested to hear from them. BEGIN (* I'm dreaming of a white Christmas, *) (* Just like the ones I used to know. *) IF Christmas [ white ] AND ( Christmas [ white ] = Christmas [ known( me ) ] ) THEN me := dream( Christmas [ white ] ); (* I'm dreaming of a white Christmas, *) (* with every Christmas card I write. *) FOR index := firstcard TO lastcard DO BEGIN WITH card [ index ] DO me := dream( Christmas [ white ] ); END; (* When the tree-tops glisten, *) (* And children listen, *) (* To hear sleighbells in the snow. *) REPEAT wait UNTIL stateof ( tree.tops ) = glisten AND stateof( children ) = listen( noiseof1in2( bells.sleigh, snow ) ) ; (* May your days be merry and bright, *) FOR index := firstday TO lastday DO BEGIN day.yours[index] := merry; day.yours[index] := bright; END; (* and may all your Christmases be white. *) FOR index := firstxmas TO lastxmas DO Christmas.yours[index] := white; END.