2 ms·
Where we see a difference between the two is that FFIs are designed to be able to directly call all sorts of uncooperative code which is oblivious to FFI, witho
by kazinator 5y ago
Where we see a difference between the two is that FFIs are designed to be able to directly call all sorts of uncooperative code which is oblivious to FFI, without adding any wrapper code to it. FFI languages have a lot of detail because of that, for describing binary types, calling conventions, memory management ownership and such. (You can use the binary types system of the FFI even if you aren't calling any foreign functions; e.g. to parse a header in a binary file.)
Whereas in RPC, we usually control both sides of the call. If there is third party code, we will glue to that from the server-side RPC stub. Even if this is a RPC based on a lower level language like C, it doesn't have to have the generality of describing any C type or function; you design your RPC API to the limitations of the RPC system. E.g. if, say, it cannot pass structures by value, you don't do that in the API. If it doesn't handle bit fields in structures, you likewise don't feature such a thing in your API.