4 ms·
kenton, I admire your work on Cap'n Proto and Sandstorm. Question about time traveling promises - I read the documentation, and it sounds to me like - taken to
by beagle3 7y ago
kenton, I admire your work on Cap'n Proto and Sandstorm.
Question about time traveling promises - I read the documentation, and it sounds to me like - taken to the logical extreme, that would effectively mean an interpreter - because at some point, you don't just want to use return values from one call as parameters in the other - you'd also want e.g. to build a one-network-roundtrip "create-if-not-exists" call from "exists(name)" and "create(name)", which would require the second call's activation to be dependent on the first call's result (rather than its parameters) - which is just a small change.
But if you consider that, and error handling, and a few other relatively simple cases, you quickly end up with an informally specified, bug ridden, incomplete implementation of Emacs Lisp inside the RPC implementation.
So, my question is - where do you draw the line, and how do you decide to draw it? I don't believe there's a right answer, but I wonder about your philosophy.
- kentonv 7y agoIndeed, the comments allude at this possibility (note the TODO): https://github.com/capnproto/capnproto/blob/77f20b4652e51b5a7ebda414e979e059a6c7c27c/c++/src/capnp/rpc.capnp#L1050-L1093 https://github.com/capnproto/capnproto/blob/77f20b4652e51b5a... But in practice, the only kind of "script" we support currently is following a chain of named fields followed by invoking a new RPC method, unconditionally, as in: fooResult = cap.foo(); quxResult = fooResult.bar.baz.qux(); This seems to satisfy the vast majority of real-world use cases. I would only add other operations if I identified some use case where it turns out to be a really big performance win. So far I haven't seen any.