The Pyretic language and runtime system