A DSL and library for resilient applications