A compiler for lambda calculus