but an explicit concurrency operator is really an "undefine the evaluation order" operator for these expressions
You're right, I do disagree :)
The token 'op' was a placeholder for any non-serialising operation That is, not and, or, &&, ||, ',' or any operator where the existing semantics would force an evaluation order.
Therefore, it could include +, -, *, /, **, ^, &, | etc. etc. Basically, any binary operator that doesn't impose an evaluation order of it's own.
And I can only go back to my earlier examples. In
func1( <expression(s) rendering the argument list1> ) + func2( <expression(s) rendering the argument list2> )
the programmer needs to know what order the arguments will be evaluated in. He needs that so that he can put his hand on his heart and swear "I know about any and all side-effects that may occur as a result of deriving those argument lists, and I am happy that, done in the order I have specified, they will do the right thing".
At that point, if func1() and func2() have any potential for parallelism, and have been marked as such by their authors, the compiler is free to invoke them in parallel, implicitly. Ie. without any further explicit authorisation through additional syntax.
But without the knowledge of what order those argument lists will be evaluated, it isn't possible for the programmer to put his hand on his heart and so swear.
By the by, I would also like a non-serialising comma-equivalent operator. One that says, the expressions either side of this operator are unrelated, but can be run in parallel. This would enable:
my( $x, $y ) = ( $db->getData() >>,<< $lwp->getdata() );
I don't expect that syntax to be acceptable to anyone, it's just the nearest thing to anything existing I could think of off the top of my head (although it does have some merit :)
Or maybe that would be:
while( my $x = $db->getData() >>and<< my $y = $lwp->getData() ) { ## Use $x and $y }
But maybe that is already covered by junctions:
while( all( my $x = $db->getData() & my $y = $lwp->getData() ) ) { ## use $x and $y }
Be kind of neat if the problem of processing data from multiple files or multiple sockets could be reduced to
while( my $messageObj = read( any( @sockets ) ) ) { ## reply send $msgObj->socket, "Thanks for your message '$msgObj->text', we'll get back to yo +u." }
Kind of remeniscent of the 4-args select loop, but without the need for bit-twiddling.
In reply to Re^52: Hallelujah [was: Why is EO undefined?]
by BrowserUk
in thread Why is the execution order of subexpressions undefined?
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |