Any programming language with an effect system could do that as well.
More recently discussed are OCaml's effect system, or Flix programming language.