Speaking of heterogeneous architecture, the IMHO transport layer (since you marked "sockets" as an answer) is just as important as the protocol layer (data serialization, etc.).
What I found that returns on time is learning a programming library that integrates data serialization between different programming languages, operating systems and architectures (bit-din / low, 16/32/64 bit, etc.).
My favorite choice is Google Protocol Buffers , with in-box support for C ++, Python, java and third-party add-ons with support for a huge number of programming languages โโ/ scripts (including Lua, Matlab, Ruby, Perl, R, Php, OCaml, Mercury, Erlang , Go, D, Lisp) and RPC implementations (e.g. Zeroc ICE ). From the list, many other products support them as the SWI-Prolog protocol buffer library .
An alternative is Thrift with support for various programming languages.
For comparison, you can check: Thrift vs Protobuf vs JSON .
source share