A framework for type safe exchange of mobile code