3 ms·
That's just about how it works with Cap'n Proto, https://capnproto.org/ https://capnproto.org/ No idea about if you could do it with mmap from the network, tha
by simcop2387 11y ago
That's just about how it works with Cap'n Proto, https://capnproto.org/ https://capnproto.org/
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.
- urbit 11y agoCP is one of many IDLs [1]. IDLs are great, but there is always an impedance mismatch in translating a language's native data structures to a language-independent IDL. Someone has to do this work, though there are sometimes various scary ways to do it automatically. 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 https://en.wikipedia.org/wiki/Interface_description_language
- chc4 11y agoYup, I've heard of Cap'n Proto before, but unfortunately never worked with it. I was under the impression that you still had to write the specfile yourself, and that deserializing malicious data was unsafe (along with being platform specific), but that doesn't seem to be the case. 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.
- kentonv 11y ago> deserializing malicious data was unsafe 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.