-
Notifications
You must be signed in to change notification settings - Fork 16
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
What are the intended semantics of <== and <<== #27
Comments
With rakudo/rakudo#2903, I think The question is how are [4,5,6] ==>> [1,2,3] ==>> my @foo; Or should only one appending feed operator be allowed at a time? my @foo;
@foo <<== [1,2,3];
@foo <<== [4,5,6]; If more than one should be allowed, should they be allowed in combination with their respective assigning operators, like this? my @even <== grep { $_ %% 2 } <== 1..^100;
@even <<== grep { $_ %% 2 } <== 100...*; |
Also, from the parallelization pullreq:
Feed operators were benching much faster in the first pullreq I made. Should we ignore the spec about parallelizing feed operators? |
FWIW, I don't think feeds need to create containers, so we can have that performance benefit. It's only the storing in the endpoint that should create containers if the receiving wants that (e.g |
Disregard what I said about ignoring the spec, I figured out how to get parallelized feed operators to run 5x faster than the current implementation |
Before I can continue with my pullreq, there's something that needs to be resolved. Modules in the ecosystem are using feed operators with things that aren't iterable. Here's an example from CUID: sub timestamp {
(now.round(0.01) * 100)
==> to-base36()
==> adjust-by8()
==> padding-by8()
} Should this behaviour be preserved? |
Does that currently return an array or a scalar? |
A scalar |
Then I think a |
My feeling is that any function you feed a value into had better be happy with getting its input as a final extra If we've things in the ecosystem that don't play well with that - which I don't believe the example given here will - we may need to preserve the existing semantics for 6.d and below, and introduce the new ones for The feed operators really didn't get that much attention to date. The implementation before the recent work was very much a case of "first draft", and certainly didn't explore the parallel aspects alluded to in the language design docs. I'd be surprised if we can make them behave usefully going forward without breaking some of the (less thought out, and probably accidental) past behaviors. |
Also, some notes on the parallelism model with feed operators: it's quite different from the In the By contrast, the feed model is about a set of steps that execute in parallel. The parallelism is in the stages of the pipeline being run in parallel, not from the data items. It can be seen as a simple case of a Staged Event-Driven Architecture. Since a given state is single-threaded, it may be stateful - whereas if you try and do stateful things in a One slightly more general problem is that Some problems will be better parallelized with |
The parallelization part of this is done, all that's left is support for my @foo = (1, 2, 3);
(4, 5, 6) ==>> @foo ==>> my @bar;
say @bar; # OUTPUT: (1, 2, 3, 4, 5, 6) What should the value of |
See rakudo/rakudo#2899 for the start of this discussion.
The text was updated successfully, but these errors were encountered: