← Back to context

Comment by layer8

12 days ago

Why over a socket? You could perform the same protocol more efficiently with normal functions in-process. Maybe we need a standard serializing LPC protocol just using the platform ABI. Or maybe this comes down to something like ZeroMQ in-process.

Mostly because sockets are supported by everything today, and they're easy to understand. What you're describing would certainly work but it looks similar to what the OP did in the blog post, with all the complexity it comes with.

  • The OP doesn’t serialize. My proposal would still serialize as with RPC, but instead of passing the data over a socket, just pass the data as a binary blob over a regular function call.

    • The main thing on my mind is that the build system would become more bespoke when doing it that way, compared to running a few processes that interact with each other.

      The overhead of socket read+write is typically much less than the serialization overhead, although both can be optimized to the point of irrelevance for many applications.

      It's also interesting because it ends up looking like a microservices architecture, except all on one machine (even all in one process tree).