No idea about if you could do it with mmap from the network, that'd be an OS thing and I suspect not possible to do from a streaming protocol like TCP in most places.
No idea about if you could do it with mmap from the network, that'd be an OS thing and I suspect not possible to do from a streaming protocol like TCP in most places.
In any case, the idea that validating or describing external or untrusted data is the job of an additional system outside the programming language, rather than the job of the language's type system, seems mainly historical. Sending data over the network was a new and unusual use case when most of today's languages were being designed. It isn't now.
[1] https://en.wikipedia.org/wiki/Interface_description_language
Urbit RPC is how I imagine RPC should always be: sending a message to `:talk` isn't actually a procedure call, but instead just sending a noun that it pattern matches on. You just say "send %talk on ~doznec this noun [%msg 'hello world']", with ~doznec on the other side automagically verifying the type with a living spec of code and molds and calling the correct function that takes the type you sent.
The fact that this all happens completely transparently, even for sending messages to local apps (and hence embrassing remote servers), and as a core feature of the language is great.
Deserializing malicious Cap'n Proto messages is safe (barring some now security bug found in the implementation). Cap'n Proto RPC is explicitly designed to be used between mutually non-trusting parties.