Because children and adults interpret speech in real-time, rapidly making commitments to interpretation essentially on a word-by-word basis, they must learn to deal flexibly with temporary ambiguities that arise in the input. In this talk, I'll present a series of language studies that examine the relationship between language processing, language learning, and cognitive flexibility. Individual differences in how well children flexibly respond to representationa conflict during executive function tasks predict how well they deal with temporary syntactic ambiguity during real-time comprehension. I explore how the processing challenges associated with real-time comprehension constrain grammar learning, and might even constrain the types of grammars that arise in languages of the world. The results reveal some of the ways in which the cognitive abilities of the individual shape the linguistic-communicative system of the group.