Where are we and where do we go from here?

So we have seen that programming languages are notations to express computations, we have seen that programs are things that are written according to this notation, we have seen that programs can be executed to perform a computation, and we have seen that computations are operations over some data. We have seen two examples of programs, interpreters and compilers, that respectively execute and translate other programs. And we have seen how interpreters can execute interpreters and compilers, and how compilers can translate interpreters and compilers. (So now would probably be a good time to take a break and rewatch The Matrix, World on a Wire, The Thirteenth Floor, Inception, Paprika, Caprica, eXistenZ, W, or even, hey, Last Action Hero. And of course, there is always Snow Crash.)

All of that, however, does not quite tell us what a computation is, nor what a notation for computation could be. But they come hand in hand, just like language and thought (one uses language to express one’s thoughts, but one needs to have thoughts to express them in a language). A next lecture note reviews typical notions of computation and the corresponding style of notation: imperative, declarative, etc.

Exercise 18

Can you think of

  • a book involving a book,
  • a theater play involving a theater play,
  • a movie involving a movie,

or more generally of one of these mediums (book, theater play, movie, TV series, etc.) involving one of these mediums?

If so, briefly describe a couple of them and their involvement.

Partial solution for Exercise 18

Halcyon: Er, would A Midsummer Night’s Dream qualify?

Mimer: Well spotted, Halcyon. Yes it would. Now why is that?

Halcyon: Well, in Scene 1 of Act V, Pyramus and Thisbe is a play within a play.

Aaron Sorkin: Yup.

Mimer: Mr. Sorkin, thanks for coming by!

A plea for precision

A program is something written in a programming language, and a compiler translates a program from one programming language to another. So please pretty please resist the all-too-frequent sloppiness of saying that compilers compile programming languages or that languages run, because they don’t. This nonsense not only hints at muddled thinking, and muddled thinking (“a programming language is when...”, “programming is when...”) does not scale at all in the long run, though it makes for very short job interviews.

Interlude

Halcyon: Hum. But isn’t Computer Science just coding?

Mimer: Ah. And what is coding?

Loki (helpfully): Coding is when you use a for loop.

Mimer: Here is hoping that you are starting to discover that Computer Science is no more about coding than Mathematics is merely about counting.

The clarity of our discourse

As Boileau wrote in his Art of Poetry, “what is well understood is delivered clearly”, a French alexandrine. When communicating something, the measure of our understanding is the clarity of our discourse.

Interlude

Halcyon: Actually, Boileau’s French alexandrine – or again iambic hexameter – comes with another one.

Pablito: It does?

Halcyon: It does. And the second one conveys that it is actually easy to state something that we understand clearly.

Anton: Come again?

Halcyon: It’s another instance of “what” and “how”.

Pablito: I am sorry. What is an instance?

Halcyon: I am sorry too. An instance is an example, an application of something general.

Mimer: For example, the binomial expansion for (x + 1)^2 is an instance of the binomial expansion for (x + y)^2 where y is 1, and the binomial expansion for (2 + z)^2 is an instance of the binomial expansion for (x + y)^2 where x is 2 and y is z.

Pablito: Thanks.

Mimer: Also, the binomial expansion for (x - y)^2 is an instance of the binomial expansion for (x + y)^2 where y is -y since x - y = x + (-y).

Pablito: Thank you, I get it.

Bong-sun: Halcyon, you were saying that Boileau’s two French alexandrines are an instance of “what” and “how” illustrating the measure of our understanding?

Halcyon: Right. The first measure of our understanding is in the first line – what we say. And the second measure of our understanding is in the second line – how we say it.

Alfrothul: And the two lines are?

Halcyon: Sorry sorry. And pardon my French too, while you are at it:

Ce que l'on conçoit bien s'énonce clairement,
Et les mots pour le dire arrivent aisément.

Anton: Er, English?

Halcyon: The second line directly translates as “And the words to say it arise easily.”

Dana: Which is not just good news in content but also a French alexandrine in form.

Halcyon: Well, yes. Both the original and in the translation have 12 syllables.

Dana: Translating “arrivent” as “arise” was daring, but it does preserve the alliteration.

Halcyon: At the modest price of considering that “arise” has 3 syllables, yes, but I think it works.

Dana: And you kept the adverb at the end of the first line too.

Halcyon: Yes: “What is well understood is delivered clearly.”

Dana: Another alexandrine.

Halcyon: Well, yes. And I translated “conçoit” (from the verb “concevoir”, to conceive) as “understand”, because that’s really what Boileau means here.

Dana: Isn’t “deliver” a bit heavy handed?

Halcyon: Well, “énoncer” means “to state”. “L’énoncé du problème” is “the problem statement”. I played a bit with translating “s’énonce clairement” as “is told with clarity”, which was the contender:

What is well understood is told with clarity
And the words to say it arise easily.

Dana: Right – “with clarity” feels more compelling than “clearly” here.

Halcyon: Perhaps, but “is told with clarity” also feels a bit choppy, and so in the end I kept the two adverbs, which is also what Boileau did:

What is well understood is delivered clearly
And the words to say it arise easily.

Umberto Eco (amused): Love your journey towards saying almost the same.

Mimer: Prof. Eco, thanks for stopping by! I simply love your book of collected articles “To say almost the same, experiments in translation” (i.e., “Dire quasi la stessa cosa, esperienze di traduzione”, originally) about translating from one natural language to another. A lot of it directly applies to implementing compilers for programming languages, it’s so striking.

Bong-sun: The book cover of its French edition is pretty striking too.

Mimer: And in the French edition, the introduction is mind-opening.

Pablito: We are drifting.

Mimer: Sorry. Youthful enthusiasm and all that. This figment of imagination felt too good to let it pass by. And yes, I do know that Umberto Eco has already passed away.

Alfrothul (kindly): You can still read his books.

The clarity of our discourse (continued)

So let’s not talk about IT Technology either, nor about online web services, flying UFOs (or unidentified UFO objects, for that matter), and other redundant pleonasms.

CONSTANT VIGILANCE!

Alastor “Mad Eye” Moody

Exercise 19 – pleonasms

Find a known pleonasm (e.g., an ATM machine, but an automated ATM machine would work too) and invent a plausible one (e.g., a travel journey-quest trip).

Suggestions:

  • Be original. (So the examples in the Wikipedia page about pleonasms are out.)
  • Be mindful. (In the past, several students here at Yale-NUS College pointed out that “Ramen noodles” and “Chai tea” are pleonasms; that was clever.)
  • Be creative. (For example, something like “manga cartoons from Japan” would be good.)

Subsidiary question:

  • Are your pleonasms syntactic (acronym-based) or semantic (e.g., self-referential)?
RIP In Peace

—Anon.

Exercise 20 – what’s that now?

Is each of the following terms a pleonasm, a contradiction, or neither?

  1. A good bon mot.
  2. A bad bon mot.
  3. An unsolved mystery.
  4. A solved mystery.
  5. The Solipsists Club.
  6. Count Dracula shaves himself very carefully in front of the mirror.

Exercise 21 – self-referential sentences

Do the following sentences involve any self reference? (Don’t over-think your answer: these are not trick questions.)

  1. This sentence no verb.
  2. This sentence contains 10 words.
  3. The Greek chorus helps the audience follow a theater play.
  4. Nostalgia isn’t what it used to be.
  5. Fashion is what goes out of fashion. (Coco Chanel)
  6. At Yale-NUS College, Intro to CS is as easy as one two one two.
  7. “The woods are lovely, dark and deep.” (Robert Frost)
  8. #hashtag
  9. Two women walk into a bar and talk about the Bechdel-Wallace test.
  10. A community of learning, founded by two great universities, in Asia, for the world.

Justify each of your answers.

In English, every word can be verbed.

Alan Perlis‘s programming epigram #59

Partial solution for Exercise 21

“Justify each of your answers.” does not involve any self reference: it describes how each answer should be phrased.

“In English, every word can be verbed.” involves a self reference: it uses “verb” (a noun) as a verb and therefore it illustrates itself.

Exercise 22 – more self-referential sentences

Do the following sentences involve any self reference? (Don’t over-think your answer: these are not trick questions.)

  1. This sentence has has too many verbs.
  2. PLEASE WRITE IN LOWER CASE.
  3. What does the French sentence “Je ne sais pas.” mean in English?
  4. We hold these truths to be self-evident. (The United States Declaration of Independence)
  5. The mandatory exercises may feel beneath you, but you should do them anyhow, so that the exam is not above you.
  6. We should not be blind to our own blindness.
  7. It won’t make any difference. (Newt)
  8. Syntactic mispelings.
  9. Semantic nonsense.
  10. But I know it. I know I know. (Luisa Rey)
  11. I know I know I know I know I know I know I know I know I know I know I know I know I know I know I know I know I know I know I know I know I know I know I know I know I know I know. (Bill Withers)
  12. This is not a pipe. (René Magritte)
  13. This is a pipe.
  14. The speaker is on speaker.
  15. “Français” means “French” in French.
  16. Does your parrot bite? (Treasure Island)
  17. Think about this.
  18. The present sentence is not clear.
  19. We learn from experience that [people] never learn anything from experience. (George Bernard Shaw)
  20. I never would want to join a club who would have me as a member. (Groucho Marx)
  21. Know thyself.
  22. In times of quarantine, try inside jokes.
  23. A joke about herd immunity is only funny if everyone gets it.
  24. You’re really real. (John Connor)
  25. This sentence contains 37 characters.
  26. So your answer is “No”?

Exercise 23 – all the vowels, including y, in alphabetic order

Facetiously, Mimer asks Halcyon whether there exists a word in English that contains all of the letters “a”, “e”, “i”, “o”, “u”, and “y”, in that order. Does there exist such a word in English?

Possible answers:

  • Yes, unquestionably. Constant vigilance!
  • No.
  • I cannot possibly know this, and furthermore this facetious question about reference is nefariously out of scope in an introductory course about Computer Science.
“Mad Eye” Moody: SOMETHING WRONG WITH YOUR CAPSLOCK KEY?

Exercise 24

Cyrano de Bergerac meets Pinocchio, and they chit-chat amicably. (Cyrano knows full well that Pinocchio’s nose grows whenever he tells a lie, and that it doesn’t whenever he tells the truth.)

Pinocchio takes his handkerchief and sneezes into it. Without removing his handkerchief, he says: “My nose is growing.”

Should Cyrano believe Pinocchio? That is to say: is Pinocchio telling the truth?

Possible answers:

  • Yes he should. If anyone knows his nose, it is Pinocchio.
  • No he should not. If Pinocchio’s nose is growing, he is telling a lie.
  • There is not enough information to say one way and not the other.
  • There is enough information to say both ways: it is a paradox.
  • This is such an insensitive question.

Hint: Either Pinocchio is telling the truth, or he isn’t. Analyze the consequences of each alternative.

Exercise 25

Pinocchio meets Cyrano de Bergerac, and they chit-chat amicably.

Facetiously, Pinocchio takes his handkerchief and covers his nose with it. Without removing his handkerchief, he says: “My nose is not growing.”

Should Cyrano believe Pinocchio? That is to say: is Pinocchio telling the truth?

Possible answers:

  • Yes he should, because Pinocchio is telling the truth and his nose is not growing.
  • No he should not, because Pinocchio is not telling the truth and his nose is actually growing.
  • There is not enough information to say one way and not the other.
  • There is enough information to say both ways: it is a paradox.
  • Pinocchio should not pick his nose, period.
Anton: Is the sentence “This is a paradox.” a paradox?
Alfrothul: And what about “This is not a paradox.”?
Loki: I love you guys.

Exercise 26 – the bigger the nose, the louder the sneeze

Playfully, Pinocchio announces that he going to sneeze really, really loudly. Is he going to sneeze loudly?

Exercise 27 – multiple-choice questions

  1. Which of the following answers is the correct one for the present question?
    1. Answer 2.
    2. Answer 1.
  2. Which of the following answers is the correct one for the present question?
    1. Answer 2.
    2. Answer 3.
    3. Answer 1.
  3. Which of the following answers is the correct one for the present question?
    1. Answer 2.
    2. Answer 3.
    3. Answer 4.
    4. Answer 1.

Exercise 28 – composing our own definitions

Compose a definition:

  1. by genus and species (i.e., by type and differences), and
  2. using (some or all of) the four causes.

Solution for Exercise 28

Anton: Genus and species now?

Alfrothul: Yes. That’s pretty much the norm in biology.

Dana: Right – the type of the thing being defined is stated first, and then something that is specific to this thing.

Anton: Oh, you mean, like “homo sapiens”?

Halcyon: Yes. And so, for example, a werewolf would be “homo sapiens lycanthropus”, a further refinement of “homo sapiens”.

Alfrothul: For another example, chocolate is defined as “theobroma cacao”.

Anton: So, interpreters and compilers?

Dana: How about defining an interpreter as a processor for executing programs?

Alfrothul: And a compiler as a processor for translating programs?

Mimer: That does the job.

Halcyon: All right! Now let’s say almost the same in Latin.

Anton: Huh, how does one say “program” in Latin?

Dana: How about “programma, atis n.”?

Halcyon: Then as a processor executing programs, the definition of an interpreter is “actor programmas agens”.

Dana: And as a processor translating – or again converting – programs, the definition of a compiler is “actor programmas convertens”.

Annette Bieniusa: Effector (from efficere) might be a bit more specific than actor in this case?

Eugenio Moggi: Could be.

Mimer: Prof. Bieniusa, Prof. Moggi, thanks for jumping into the fray!

Halcyon: So, “effector programmas agens” for interpreter and “effector programmas convertens” for compiler.

Anton: If you guys say so.

Halcyon: But still.

Dana: Still?

Halcyon: Well, if “a program” is seen as “a piece of code”, could we say “codex” as the Latin for “code”? That makes sense, semiotically.

Umberto Eco: It does, but don’t let me interrupt your negotiation.

Dana: Thanks. So, “codex, codicis m.”, that is compatible with the Latin edition of Wikipedia about computer programs.

Halcyon: Yes. So as a processor executing programs, the definition of an interpreter is “actor codices agens” or again “effector codices agens”.

Dana: And as a processor translating programs, the definition of a compiler is “actor codices convertens” or again “effector codices convertens”. Or perhaps just “vertens”.

Mimer: There you go.

Anton: How about we define the four causes of a printer in English? You know, something concrete. Nothing fancy.

Pablito: You mean, not a 3D printer?

Anton: Right. A line printer, to print the contents of a file on paper.

Alfrothul: That’s the final cause right there.

Anton: Good. So, the material cause?

Pablito: Well, the paper for sure, as well as its tray.

Alfrothul: And the ink too.

Pablito: Right. And the devices to affix the ink on the paper.

Dana: And the input file as well.

Anton: OK, that pretty much covers the material cause.

Alfrothul: The efficient cause is all the processing, from receiving the file to reading it and from fetching a sheet of paper in the tray to affixing ink on it based on the content of the file.

Anton: Yup.

Pablito: So, the formal cause?

Anton: It would be all the algorithms executed: the protocol used to receive the file, the method used for reading it, and the strategy of affixing the ink on the paper.

Pablito: And if the printer is a duplex one?

Anton: Also part of the formal cause.

Pablito: And the electricity?

Anton: Well, it’s an enabler, so let’s say it is part of the efficient cause.

Pablito: And we are done?

Anton (packing): We are done.

Halcyon: So, no Latin?

Anton (exiting): No Latin.

Halcyon: But still.

Pablito: Still?

Halcyon: “Exit” is Latin for “he leaves”, “he goes out”.

Dana: Which Anton just did.

Mimer: And not just that.

Dana: Right. “Data” is a Latin word too.

Halcyon: In plural form – the singular is “datum”.

Mimer: Which is why we often say “a piece of data” and “a data object”.

Alfrothul: Duly noted.

Exercise 29

Occasionally, we receive an email from someone who asks us something and this email ends with “AdvThanksance.”

  1. Why is that?
  2. Suggest a similar neologism to put at the end of an email and justify it.

Exercise 30

One of the online companies in Singapore has “The grocer that delivers” as a motto. This motto juxtaposes two meanings: a literal meaning conveying that after a customer orders groceries online, drivers will bring the deliveries to the customer, and a figurative meaning conveying that this company is both efficient and effective.

  1. Find a few similar mottos with juxtaposed meanings and explain them.
  2. Invent a couple of mottos with juxtaposed meanings and explain them.
Halcyon (chuckling): Like, “Buy our rear-view mirrors and never look back”?
Pablito: I guess so.
Halcyon: Because we look back in rear-view mirrors.
Pablito: I get it, Halcyon, I get it: why buying a rear-view mirror if we are never to use it?
Halcyon: Yup. And note how this juxtaposition is contradictory, unlike the one for the grocer, which is reinforcing.
Pablito: True that.

A remark

The present lecture notes are peppered with Wikipedia pointers. Acquire a sense of the raison d’être of these pointers by following several of them.

Credit and acknowledgments

Exercise 27 – multiple-choice questions was suggested by Steven Stadnicki’s posting on math.stackexchange.com.

Translating “code” as “codex” on semiotic grounds was suggested by cmw on latin.stackexchange.com.

Thanks to Kira Kutscher for fearlessly solving Exercise 28 – composing our own definitions and to Annette Bieniusa and Steven J. Green for generously sharing their Latin expertise.

Version

Added a Wikipedia pointer to French alexandrines [18 Apr 2023]

Corrected the grocer’s motto [10 Apr 2023]

Illustrated the definition of “instance” some more [26 Mar 2023]

Added the definition of “instance” [25 Mar 2023]

Added the interlude about coding [24 Mar 2023]

Added a Wikipedia pointer to solipsism [11 Mar 2023]

Added a partial solution for Exercise 21 – self-referential sentences [14 Jan 2023]

Added Exercise 18 [13 Jan 2023]

Created [10 Jan 2023]

«