Why do languages have the semantic categories they do, and what do those categories reveal about cognition? Word meanings vary widely across languages, but this variation is constrained. I will argue that this pattern reflects a range of language-specific solutions to a universal functional challenge: that of communicating precisely while using minimal cognitive resources. I will present a general computational framework that instantiates this idea, and will show how that framework accounts for cross-language variation in several semantic domains. I will then address the Sapir-Whorf hypothesis - the claim that such language-specific categories in turn shape cognition. I will argue that viewing this hypothesis through the lens of probabilistic inference has the potential to resolve two sources of controversy: the challenge this hypothesis apparently poses to the widespread assumption of a universal groundwork for cognition, and the fact that some findings supporting the hypothesis do not always replicate reliably.