I'm struggling to understand how lazy evaluation or generators fit here. I
went back and read through the thread a few times and didn't see the
explanation -- although I may have missed it

Can you elaborate on how lazy evaluation or a generator would equal the
special combination that looks for +/ ?

In my view, a special combination would be something like (psuedo code)

function insert:
   if  verb = '+' then
     result = 0
     for(i = 0; i < count; i++)
          result = result + ravel[i]
     return result
   else
     result = ravel[count-1]
     for(i = count - 2; i >= 0; i--)
           result = exec(verb, ravel[i], result)
     return result

In this simple example, it seems clear to me that knowing that the verb is
"+" provides an opportunity to optimize. I'm not sure what the lazy or
generator solution would look like

sidenote: pesudo-code could certainly have errors... just hoping to add
something concrete to the discussion to help explain

On Mon, Mar 5, 2018 at 3:33 PM, james faure <[email protected]> wrote:

> Just about every single special combination is equalled by lazy evaluation
> - with the very rare exceptions being those that use a completely different
> algorithm.
>
> 'in an interpreter time spent on code analysis is a cost to be minimized':
> This is extremely superficial, not even because the time spent analyzing
> code is negligible compared to execution time, with potential for big
> returns, but because generators have nothing to do with code analysis.
>
> Your second point is also off topic.
>
> ________________________________
> From: Chat <[email protected]> on behalf of Raul Miller <
> [email protected]>
> Sent: Monday, March 5, 2018 8:34:59 PM
> To: Chat forum
> Subject: Re: [Jchat] Where is J going ?
>
> You are talking about the use of generators as an array type, which I
> gather was the gist of your proposal in the propositions thread?
>
> ...
>
> I am looking forward to seeing your work on this, and the benchmarks
> on its performance.
>
> But I do not see how an implementation of that approach would be an
> adequate replacement for most of the optimizations documented on the
> http://code.jsoftware.com/wiki/Vocabulary/SpecialCombinations page.
>
> And you did say "The SC based system has has got to go".
>
> Note also:
>
> (*) in an interpreter time spent on code analysis is a cost to be
> minimized (though you can get away with more of this when working on
> large data sets and inefficient code than you can on small data sets
> and efficient code), and
>
> (*) the combinations chosen here were picked in part because they show
> up relatively frequently in real code, and in part because order of
> magnitude performance improvements were easy to implement.
>
> Thanks,
>
> --
> Raul
>
>
>
> On Mon, Mar 5, 2018 at 2:09 PM, james faure <[email protected]>
> wrote:
> > Since our discussion was in the source forum, I'll repeat myself here:
> >
> > Special Combination's require special code and are incapable of
> optimizing anything other than an extremely specific case.
> >
> > How you managed to think I don't like optimizations is beyond me - of
> course SC's are better than nothing, that's not the point.
> >
> > ________________________________
> > From: Chat <[email protected]> on behalf of Raul Miller
> <[email protected]>
> > Sent: Monday, March 5, 2018 7:48:02 PM
> > To: Chat forum
> > Subject: Re: [Jchat] Where is J going ?
> >
> > Yes.
> >
> > Thanks,
> >
> > --
> > Raul
> >
> >
> >
> >
> > On Mon, Mar 5, 2018 at 1:40 PM, james faure <[email protected]>
> wrote:
> >> Is that a serious question ? After all the time I spent explaining the
> alternative ?
> >>
> >> ________________________________
> >> From: Chat <[email protected]> on behalf of Raul
> Miller <[email protected]>
> >> Sent: Monday, March 5, 2018 7:38:27 PM
> >> To: Chat forum
> >> Subject: Re: [Jchat] Where is J going ?
> >>
> >> Why do you think optimizations are bad?
> >>
> >> Thanks,
> >>
> >> --
> >> Raul
> >>
> >>
> >> On Mon, Mar 5, 2018 at 1:30 PM, james faure <[email protected]>
> wrote:
> >>> I mean Special combination: http://code.jsoftware.com/wiki/Vocabulary/
> SpecialCombinations
> >>>
> >>> Vocabulary/SpecialCombinations - J Wiki<http://code.jsoftware.
> com/wiki/Vocabulary/SpecialCombinations>
> >>> code.jsoftware.com
> >>> J typically executes verbs one by one, right-to-left, each verb not
> knowing what is coming next a =: 1000 1000 ?@$ 0 NB. 1 million random
> values in a 1000 by 1000 ...
> >>>
> >>>
> >>>
> >>> ________________________________
> >>> From: Chat <[email protected]> on behalf of Brian
> Schott <[email protected]>
> >>> Sent: Monday, March 5, 2018 6:24:45 PM
> >>> To: Chat forum
> >>> Subject: Re: [Jchat] Where is J going ?
> >>>
> >>> I think it means stop_condition.
> >>>
> >>> On Mon, Mar 5, 2018 at 9:36 AM, Devon McCormick <[email protected]>
> wrote:
> >>>
> >>>> Again, I ask, in
> >>>> " 4 The SC based system has has got to go... "
> >>>> what is "SC based"?
> >>>>
> >>>>
> >>>>
> >>> ----------------------------------------------------------------------
> >>> For information about J forums see http://www.jsoftware.com/forums.htm
> >>> ----------------------------------------------------------------------
> >>> For information about J forums see http://www.jsoftware.com/forums.htm
> >> ----------------------------------------------------------------------
> >> For information about J forums see http://www.jsoftware.com/forums.htm
> >> ----------------------------------------------------------------------
> >> For information about J forums see http://www.jsoftware.com/forums.htm
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> 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