Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^4: Multi-core and the future

by John M. Dlugosz (Monsignor)
on Sep 01, 2008 at 18:37 UTC ( [id://708278]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Multi-core and the future
in thread Multi-core and the future

Consider multiplication. @a »*« @b is explicitly element-wise looping over the operator. @a * @b is not built-in, and could be defined, for example, between two Matrix objects if you like, to do matrix multiplication. You could also define infix:<+> between two lists to simply call the hyperoperator. Also, the syntax generalizes more than the implicit way of Fortran: apply a method call to each element, rather than to the container itself.

Replies are listed 'Best First'.
Re^5: Multi-core and the future
by swampyankee (Parson) on Sep 01, 2008 at 19:24 UTC

    Usually (F90 permits overloading), F90's array operations apply the same operation to each element of an array, and cannot process arrays which aren't conformal (same organization), so F90's array operation A = B * C would be the equivalent to

    real,dimension(2,3,4) :: A, B, C integer j, k, m do j = 1, 2 do k = 1, 3 do m = 1, 4 A(j,k,m) = B(j,k,m) * C(j,k,m) enddo enddo enddo

    Of course, Fortran programmers like typing no more than any other type of programmer1, so A = B * C would be preferred ;-).

    I'm not saying that the F90 way is optimal; it's just that the philosophy behind the F90 standard is to make parallelization transparent to the application programmer, which means that having a different syntax for parallel operations would be frowned upon. Certainly, some of Perl's existing syntax (grep, many list operations) could be parallelized without any visible changes to the language.


    1 Well, maybe COBOL programmers like typing, but I wouldn't want to stereotype them.


    Information about American English usage here and here. Floating point issues? Please read this before posting. — emc

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://708278]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-25 21:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found