There's almost no reason why RPC should not just be
send(sk, (void *)&mystruct, sizeof(struct mystructtype), 0)I agree it will usually work, but this becomes an ABI concern, and it's surprisingly common to have ABI mismatches on one platform with the items I've noted above.
My issue with gRPC is simple, the Go gRPC server code does a lot of allocations. I have a gRPC service where each container does 50-80K/second of incoming calls and I spend a ton of time in GC and in allocating headers for all the msgs. I have a similar REST service where I use fasthttp with 0 allocs (but all the stupidly high number of connections due to the lack of multiplexing thru the connection).
As for go / javascript? I think most languages have the ability to inspect a raw buffer.
Yes, you have to use an encoding scheme like JSON or Protobufs. Dumping memory directly down the pipe as you're suggesting doesn't work.
> As for go / javascript? I think most languages have the ability to inspect a raw buffer.
No language has the ability to read a raw buffer and know what the contents are supposed to mean. There needs to be a protocol for decoding the data, for example JSON or Protobufs.
You could get around this with a ton of effort around serdes, but it'd amount to reinventing ASN1 or Protobuf.