Run-time manipulation of programs in a statically-typed language