This is something I should have done ages ago, I know, but what isn’t? I finally got around to reading some classic papers about what names and variables mean in opaque contexts (such as quotation and belief):
Quine, Willard Van Orman. 1956. Quantifiers and propositional attitudes. Journal of Philosophy 53(5):177–187.
Kaplan, David. 1968. Quantifying in. Synthese 19(1–2).
Kaplan, David. 1989. Demonstratives: An essay on the semantics, logic, metaphysics, and epistemology of demonstratives and other indexicals. In Themes from Kaplan, ed. Joseph Almog, John Perry, and Howard Wettstein, chap. 17, 481–563. New York: Oxford University Press.
It’s a shame that people working on embedding of natural languages and embedding of programming languages don’t talk more to each other. (It doesn’t help that these great reads are not terribly easy to access online—email me for a copy.) If you care about topics like multilanguage interoperability, denotational/extensional vs operational/intensional semantics, values and constant expressions that evaluate to them(selves), polymorphic lift, and cross-stage persistence, then these papers are definitely worth your time. (And vice versa: philosophy of language can benefit from computational thinking too; I name two equally classic papers below.)
For example, Kaplan (1989:497) distinguishes literal expressions
(directly referential terms such as
in Scheme) from other expressions that evaluates to the same value
in all circumstances (definite descriptions such as
(if (snow-is-slight) (sqrt 9) (- (* 2 2) 1))):
The propositional component need not choose its designatum from those offered by a passing circumstance; it has already secured its designatum before the encounter with the circumstance.
He goes on to note that this distinction tends to be exposed by syntax but masked by semantics (or in finally tagless terms, exposed when the representation of terms is polymorphic in their interpreters):
When we think in terms of possible world semantics this fundamental distinction becomes subliminal. This is because the style of the semantical rules obscures the distinction and makes it appear that directly referential terms differ from ordinary definite descriptions only in that the propositional component in the former case must be a constant function of circumstances. In actual fact, the referent, in a circumstance, of a directly referential term is simply independent of the circumstance and is no more a function (constant or otherwise) of circumstance, than my action is a function of your desires when I decide to do it whether you like it or not. The distinction that is obscured by the style of possible world semantics is dramatized by the structured propositions picture. That is part of the reason why I like it.
Quine and Kaplan both worry about what goes wrong when you can’t find an expression that evaluates to a given value, or when the only expression you find is an unspeakable mental structure, or when you find two expressions that evaluate to the same value but they are not observationally equivalent. (The same worries concern André Aciman, by the way. The evening rain in Århus reminds me of the Taipei where I presumably used to imagine I lived. But I digress.)
If you think philosophy is dry to read, well, these papers serve up counterexamples on page after page. Quine (1956:179) writes of lion-hunting, presidential candidates, and spy intrigue:
There is a certain man in a brown hat whom Ralph has glimpsed several times under questionable circumstances on which we need not enter here; suffice it to say that Ralph suspects he is a spy. Also there is a gray-haired man, vaguely known to Ralph as rather a pillar of the community, whom Ralph is not aware of having seen except once at the beach. Now Ralph does not know it, but the men are one and the same. Can we say of this man that Ralph believes him to be a spy?
Responding, Kaplan (1968) suggests “taking advantage of Ralph’s belief that all members of the C.P.U.S.A. are spies”, then discusses spy pictures:
Let me recite just a few of the familiar facts of portraiture. First, not all pictures of a person resemble that person. Of two recent pictures taken of me, one resembles Steve Allen and the other resembles nothing on earth. Secondly, not all pictures which resemble a person are of that person. It is obvious that a picture of one twin will, if it resembles the twin it is of, also resemble the other twin. … Of course, if photographs did not frequently, indeed usually, resemble their subjects, they could not serve many of the purposes for which we use them. Still, on occasion, things can and do go awry, and a bad photograph of one is yet a photograph of one.
… A police artist’s reconstruction of Santa Claus, based on a careful reading of the poem The Night Before Christmas, is not a picture of anyone no matter how many people make themselves up so that it exactly resembles them, and no matter whether the artist regards the poem as fact or fiction. …
In addition to the link with reality provided by the relation of resemblance the descriptive content of a picture determines its vividness. A faded picture showing the back of a man wearing a cloak and lurking in shadow will lack vividness. A clear picture, head on, full length, life size, showing fingerprints, etc. would be counted highly vivid. What is counted as vivid may to some extent depend on special interests. To the clothier, nude portraits may be lacking in detail, while to the foot fetishist a picture showing only the left big toe may leap from the canvas.
I wish I could write like that. I wish I could overcome the habits of terseness and Anglo-Saxon monosyllabary that page limits on conference papers and grant proposals have long instilled in me. I wish I would not revise my luck away should the monkey in me rediscover Landin’s passion—“This discussion of i reveals the possibility that primitives might be sensationally nonalgorithmic”—or Reynolds’s irony—“Definitional interpreters often achieve clarity by sacrificing all semblance of efficiency.”
- Landin, Peter J. 1966. The next 700 programming languages. Communications of the ACM 9(3):157–166. [abstract]
A family of unimplemented computing languages is described that is intended to span differences of application area by a unified framework. This framework dictates the rules about the uses of user-coined names, and the conventions about characterizing functional relationships. Within this framework the design of a specific language splits into two independent parts. One is the choice of written appearances of programs (or more generally, their physical representation). The other is the choice of the abstract entities (such as numbers, character-strings, lists of them, functional relations among them) that can be referred to in the language.
The system is biased towards “expressions” rather than “statements.” It includes a nonprocedural (purely functional) subsystem that aims to expand the class of users’ needs that can be met by a single print-instruction, without sacrificing the important properties that make conventional right-hand-side expressions easy to construct and understand.
- Reynolds, John C. 1972. Definitional interpreters for higher-order programming languages. In Proceedings of the ACM national conference, vol. 2, 717–740. New York: ACM Press. Reprinted in Higher-Order and Symbolic Computation 11(4): 363–397. [abstract]
Higher-order programming languages (i.e., languages in which procedures or labels can occur as values) are usually defined by interpreters which are themselves written in a programming language based on the lambda calculus (i.e., an applicative language such as pure LISP). Examples include McCarthy’s definition of LISP, Landin’s SECD machine, the Vienna definition of PL/I, Reynolds’ definitions of GEDANKEN, and recent unpublished work by L. Morris and C. Wadsworth. Such definitions can be classified according to whether the interpreter contains higher-order functions, and whether the order of application (i.e., call-by-value versus call-by-name) in the defined language depends upon the order of application in the defining language. As an example, we consider the definition of a simple applicative programming language by means of an interpreter written in a similar language. Definitions in each of the above classifications are derived from one another by informal but constructive methods. The treatment of imperative features such as jumps and assignment is also discussed.
These two papers are standard references in computer science for embedding and defining one language in another. Nowadays it’s fashionable to call the embedded language a domain-specific language (DSL). Surely Ralph’s mind qualifies as a specific domain.
(Incidentally, some things never change: after Landin presented his paper, the audience spent half a page discussing whitespace in his programming language.)