Call-by-reference semantics for RPC Does call-by-reference semantics for remote procedure call (RPC) have a real use case?  Why does call-by-reference RPC exist?  Is it useful for anything?  Is there a scenario where call-by-value can't do the job?

In a simple sentence: Do we need to have a (call by reference)-able RPC protocol? if yes, Why?



Background: Call-by-reference can be implemented for RPC.  For instance, one implementation strategy is copy &amp; restore: the value is copied from the client to the server when you make the call, and then copied back afterwards.  There are other ways to implement it as well.
The idea is to be able to modify the argument. FORTRAN used call-by-reference always, Algol-60 used the (mathematically clean, but hard to implement and with surprising corner cases) call-by-name; Pascal distinguishes between call-by-value and call-by-reference ("gets the variable"). But call-by-reference has its surprises, introducing aliasing between variables. Thus Ada offers call-by-value-return too.

If caller and callee reside on different machines, the performance gain of not copying arguments in and out, just using a pointer, is lost. Even worse, doing call-by-reference is quite inefficient (need to copy back and forth each time something changes). If you are defining what to do, I'd just ditch call-by-reference, and fight users tooth and nail to keep it out.