Foundations for programming languages