Linguistic side effects
Apparently noncompositional phenomena in natural languages can be analyzed like computational side effects in programming languages: anaphora can be analyzed like state, intensionality can be analyzed like environment, quantification can be analyzed like delimited control, and so on. We thus term apparently noncompositional phenomena in natural languages linguistic side effects. We put this new, general analogy to work in linguistics as well as programming-language theory.
In linguistics, we turn the continuation semantics for delimited control into a new implementation of quantification in type-logical grammar. This graphically-motivated implementation does not move nearby constituents apart or distant constituents together. Just as delimited control encodes many computational side effects, quantification encodes many linguistic side effects, in particular anaphora, interrogation, and polarity sensitivity. Using the programming-language concepts of evaluation order and multistage programming, we unify four linguistic phenomena that had been dealt with only separately before: linear scope in quantification, crossover in anaphora, superiority in interrogation, and linear order in polarity sensitivity. This unified account is the first to predict a complex pattern of interaction between anaphora and raised-wh questions, without any stipulation on both. It also provides the first concrete processing explanation of linear order in polarity sensitivity.
In programming-language theory, we transfer a duality between expressions and contexts from our analysis of quantification to a new programming language with delimited control. This duality exchanges call-by-value evaluation with call-by-name evaluation, thus extending a known duality from undelimited to delimited control. The same duality also exchanges the familiar let construct with the less-familiar shift construct, so that the latter can be understood in terms of the former.