Cap'n Web: A new RPC system for browsers and web servers
Posted by Happy_Junket_9540@reddit | programming | View on Reddit | 9 comments
Posted by Happy_Junket_9540@reddit | programming | View on Reddit | 9 comments
QuantumFTL@reddit
Schemas are the main thing I _like_ about Cap'n Protocol. I can't imagine a system where I want my networking code to have _less_ type safety, much less in TypeScript, of all things...
beders@reddit
There’s no type safety over the wire. Especially not when one end is a browser. You probably mean data validation which is something you must do anyways. You can’t rely on marshaling alone.
aka-rider@reddit
Here’s the neat part. Type safety although not the part of the implementation, implicitly present. They just don’t enforce particular implementation.
For instance.
class MyServer implements MyNetworkContract …
class MyClient implements MyNetworkContract …
iamaperson3133@reddit
The
.map
magic for fetching into array items is cursed.SnS_Taylor@reddit
This is the kind of stuff I’m on reddit for. Super cool. The chained promise calls resolving in a single network call is really fun. Just very clever use of the JS systems.
Happy_Junket_9540@reddit (OP)
Right?? I can’t wait to demo this to my team.
chasemedallion@reddit
With the record/replay logic for serializing map callbacks, what happens if the callback does something like projecting a random value (eg assigning a uuid to each output object)?
valarauca14@reddit
Nice, S-Expression RPCs. Love me some LISP.
wd40bomber7@reddit
This reminds me a lot of Windows COM or even WinRT where the RPC language is fully object oriented. Though unlike those RPC mechanisms, this one doesn't require schema which is interesting...