-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is replication enabled in imperative blocks? #13
Comments
For historical reference:
Looking forwards to seeing what you decide and how it plays out :) |
My gut feeling is that replication should be disabled in imperative blocks. As @lukechurch so kindly pointed out, replication in imperative blocks behaves badly with other language constructs. Suppose the
Would this be?
Side effects and replication are not such good bed partners. Replication should be expected to terminate. If we keep data structures finite*, function call replication should be guaranteed to terminate. So, let's assume while loops (and similar constructs) do not replicate. Consider if function calls replicated in imperative blocks. Here's a good one:
The line commented with A looks like this after variable substitution:
The result of *There is nothing in the spec indicating data structures should be finite and its nontrivial to enforce. |
@pboyer In general I agree.
Aside from the alarming metaphor here... I think it does depend somewhat on the side effect. Just like elsewhere map operators can have very useful side effects (e.g. compressing all the files they're mapped over). I think the point is that for this to be a comprehensible model the side effects shouldn't be visible inside the different executions that of the map operator. This is also important for the aspect of the specification that says that the order of a replicated dispatch is not defined. Sadly this form of isolation is tricky to enforce on top of the .NET object model. So instead I opted to rely on trying to use scoping to nudge people away from global state munging inside replicated calls.
I think you also need to assume that the functions being called terminate, or do you that for finite data structures the number of function call dispatches that any given replication will generate should be guaranteed to be finite? |
Yes, I was more concerned about cyclic data structures here. I'm proposing that the traversal of the data structure, necessary for replication, needs to terminate. That is not totally free. |
No description provided.
The text was updated successfully, but these errors were encountered: