Compiling Distributed System Models into Implementations