I've been toying with the idea of writing a compiler for the untyped lambda calculus  for a while; and now that I'm on vacation, I finally managed to refactor out some time to spend on it. The first iteration, echoes , generates horrible, but runnable code. It reads λ expressions (via a lispy syntax) and compiles them to plain ol' x86-64 assembly, runnable pending getting linked into the runtime. It understands a tiny bit more than pure lambda calculus — echoes has native support for booleans, integers and if statements. The compiled code obeys lazy call-by-name  semantics.
Jul 16, 13