From typed programming languages to synthetic homotopy theory