The Mach Interface Generator (MIG) is an IDL compiler. Based on an interface definition, it creates stub code to object methods and to demultiplex incoming messages. These stub functions conveniently hide the details of Mach's IPC and port machinery and make it easy to implement and use Mach s as remote procedure calls (RPC): by using the stub functions, the client programs can call remote procedures more or less like any other C function.
These functions encode arguments into messages' format (marshalling), wait for a result on a newly created reply port, decode return arguments from the reply message (demarshalling, or unmarshalling) and pass them to the client program. Similar actions are provided in the skeletons that are linked to server programs.
MIG allows very precise semantics to be specified about what the arguments are and how to be passed.