It is a good programming practice to avoid side effects. Especially so if
there is a possibility of parallelism of execution. Telling the interpreter
or compiler that things like cells or rows are operationally independent
means that each can be done in any order and several may be in progress at
once. The order in which each starts does not imply the order in which they
complete.

But don't expect any parallelism at that level on PCs and the current
multiprocessors now on the market. They have local cache which works well on
unrelated tasks, but when dealing with related tasks, like working on
adjacent rows of a matrix, different processors on each row, there will be
cache collisions invalidating local cache. Need a different
hardware architecture for that kind of parallelism. But maybe there is
opportunity for parallelism on a much larger scale.

But these are some of the reasons for all the "maybe's" in my previous note.
What works badly today may become quite efficient in the future.

On Mon, Mar 14, 2011 at 4:23 PM, Zsbán Ambrus <[email protected]> wrote:

> On Mon, Mar 14, 2011 at 9:47 PM, Henry Rich <[email protected]> wrote:
> > Sometimes the interpreter executes a verb twice on an operand - usually
> > when two different executions returned different shapes/types and it's
> > easier to reexecute than to use the previous result.
>
> It also sometimes executes verbs on dummy arguments you didn't supply
> in order to guess the shape of the result of a ranked verb for empty
> arrays, eg.
>
>   $ 3 :('leak=:42;<y';'i.3 5 4')"0 $0
> 0 3 5 4
>   leak
> +--+-+
> |42|0|
> +--+-+
>
> I wonder, does it also execute verbs on dummy arguments to guess the
> neutral element of a verb (for the insert adverb)?
>
> Ambrus
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to