by JonChesterfield · 2y ago · 0 comments
I think it's a distributed language runtime where you write functions in typescript and the runtime deals with passing data between machines.
The website is quite good at presenting the system as a nice thing that does nice things and you should like it and it's all very nice. It does a very poor job of convincing me that it works properly. I'd want to know how the scheduler works and how it handles mutable state in the presence of network partitions.
Also just found a caveat which amounts to they've got the implementation wrong:
> Arguments must be JSON serializable. This means that you can pass strings, numbers, booleans, arrays, objects, and null. You cannot pass functions, promises, or other non-serializable objects
> It does a very poor job of convincing me that it works properly. I'd want to know how the scheduler works and how it handles mutable state in the presence of network partitions.
Thank you. This is valuable feedback, and will definitely work this in to the docs.
The current pages are a strong sales pitch to semi-technical management. Look at all the things you don't have to implement!
I read this looking for indications that you've built the complicated thing correctly. Do you understand the maths involved, have you implemented it in a fashion that inspires confidence.
A distributed language runtime that works properly is a valuable thing. One that kind-of works when held carefully is a liability that people would regret trying to build on.
Functions are serializable. And deserializable. You can absolutely take one defined on one machine, kick it over the wire, then execute it on another one. Likewise closures, you serialise the associated state as well.
Promises are the same thing - a distributed language runtime should be exactly the sort of graph execution system which lets you pass promises between machines and have things work out.
Further, they don't say what other "non-serializable" things are. Is a DAG serialisable without spuriously unrolling it into a tree and failing to fold back into a DAG at the other end? How about a graph? Given that all things are serializable it is difficult to guess what things they haven't implemented.
So by "they've got the implementation wrong", I'm saying they haven't implemented the tricky part of serialisation, only the copy ints over wires part. And by "wrong", I'm saying that a language runtime dedicated to transparently running typescript functions on other machines should be able to run those functions on other machines even if they have closed over state.
Maybe the line could be written better. It is supposed to say: You can't pass functions and promises. And you can't pass in other data types that are not serialisable.
I definitely did not intend to say that functions or promises are not serialisable, and it is something we're looking into. The complexity is with serialising the closure state.
The other thing we're implementing is constraining the data types via the type system itself.
edit: punctuation
At present the docs say it can serialise things that it can serialise with a couple of examples on each side.
My best guess is there's some limitations caused by the stack under your implementation that you haven't worked around, but I don't know what those limitations are or which ones you plan to resolve.
In addition to what can be sent there's a load of design choices about what is sent.
Is aliasing within the original preserved?
Is potential aliasing introduced?
Is it compressed in transit?
Is it delta encoded with respect to information that was sent previously?
Is there some initial blob of information every instance starts up with that messages are deduplicated against?
And that's before the behaviour on mutation - when one machine changes the data, how and when is that change reflected on other machines?
I don't think the use case for this is as general as most RPC systems.
The linked site envisions a situation where you had an app running on one server, now you want to break that workload up while making the absolute minimum number of code changes.
All the clients and code would still be controlled by the same team.