We propose two characterizations of complexity classes by means of programming languages. The first concerns Logspace while the second leads to Ptime. This latter characterization shows that adding a choice command to a Ptime language (the language WHILE of Jones [1]) may not necessarily provide NPtime computations. The result is close to Cook in [2] who used "auxiliary push-down automata". Logspace is obtained through a decidable mechanism of tiering. It is based on an analysis of deforestation due to Wadler in [3]. We get also a characterization of NLogspace. We propose a contribution to the program of Jones [1]: "We maintain that Computability and Complexity theory, and Programming Language and Semantics [...] have much to offer each other, in both directions." ; we give characterizations of complexity classes by means (of restrictions) of programming languages. The present contribution belongs to a largely wider program (see [4