Fortran feels more functional than OOP to me. A pipe operation is great for functional programming style. R and Julia already have it.
Maybe it’s just because I don’t regularly use a language with pipe operators, but I think they make code less clear than wrapping functions around each other, especially if the functions have other parameters. Maybe it’s just me! Having said that, I wouldn’t object to the option being there in Fortran.
a pipe operator is great for the functional programming style. it actually makes codes more readable
Could be useful for simplifying nested mathematical expressions.
Normally, If our expression is too complicated, it’s often best to split up the formula into multiple parts.
So, using pipes, instead of splitting up our equations, could be useful.
Implementation probably won’t be too difficult for complier devs, because all they have to do, is group and nest the operators.
But question is, how much people will want to use pipes in Fortran?
Can something like this will make sense if pipe operator is used :
! the usual operator
call co_sum(...) |> device(...)
! or something else entirely
call co_sum(...) -> device(...)
either way I think the intent to offload the co_sum
to a device is clear.
Even targeting specific function and subroutine to offload to some device like this can be possible?
do concurrent(...)
! something
res = matmul(...) |> device(...)
end do