Dan's exercise description was performance-wise mute but quite clear about tacitness (see, http://www.jsoftware.com/pipermail/programming/2015-December/043661.html) So, it seems to me, the rumblings were justified after all.
Regarding the lack performance of tacit adverbs (or conjunctions), I do not recall ever having a need for speed (I could always launch, for instance, a tacit version of meanie, take a brake, and prepare a cup of coffee while it is furiously crunching words, just kidding). Nevertheless, one can compare the relative performance of the counterparts of your example adverb (meanie). The purpose of having a toolkit such as the one shown in the Tacit Toolkit (was dyadic J) thread (see, http://www.jsoftware.com/pipermail/programming/2015-December/043757.html) is to make one's life easier. So, NB. Using J Wicked Toolkit script... NB. Performance comparison verb... Cut=. -.&a: @: (<;._2@,~) st=. (, */&.:>@:(1 2&{))@:(] ; 7!:2@:] ; 6!:2) stp2=. [ ((('Sentence Space Time')(;:x , <y)'Space * Time') , st&>) LF Cut ] stp=. stp2 f. ". o ('0 : 0'c) NB. The definitions of the two contestants meanie=. 1 :0 NB. Your way +/ % # ) minie=. (+/ % #)cv adv NB. My wicked way stp 666 _ meanie _ minie ) ┌────────┬─────┬─────────────┬────────────┐ │Sentence│Space│Time │Space * Time│ ├────────┼─────┼─────────────┼────────────┤ │_ meanie│4736 │8.9414424e_6 │0.0423466712│ ├────────┼─────┼─────────────┼────────────┤ │_ minie │21376│5.31949556e_5│1.13709537 │ └────────┴─────┴─────────────┴────────────┘ ".&> '_ meanie 1 2 3' ; '_ minie 1 2 3' 2 2 Right, you have a point, meanie is meaner that minie (but no much hope for a long break while minie is doing its thing though). I am curious do you have an example where adverbial (or conjunctional) performance might be critical? Be that as it may, the reason of the out-performance is the relative lack of support for general adverbial (and conjunctional) tacit writing. However, J is open source and one can put a remedy: the following adverb (moe) uses a corresponding Jx Tacit Toolkit, moe=. (+/ % #)cv adv NB. Jx Wicked way stp 666 _ meanie _ minie _ moe ) ┌────────┬─────┬─────────────┬────────────┐ │Sentence│Space│Time │Space * Time│ ├────────┼─────┼─────────────┼────────────┤ │_ meanie│4736 │1.05577445e_5│0.050001478 │ ├────────┼─────┼─────────────┼────────────┤ │_ minie │21376│6.20778363e_5│1.32697583 │ ├────────┼─────┼─────────────┼────────────┤ │_ moe │2176 │5.5269888e_6 │0.0120267276│ └────────┴─────┴─────────────┴────────────┘ ".&> '_ meanie 1 2 3' ; '_ minie 1 2 3' ; '_ moe 1 2 3' 2 2 2 Apparently moe is meaner than meanie! I do not know, maybe performance of adverbs (and conjunctions) is quite critical after all ;) Incidentally, since apply (128!:2) and ". have been mentioned several times in this thread I would like to mention that in the latest Jx version (which is still cooking) apply is now dyadic ".. (128!: is kept for compatibility), monadic ".. , my favorite wicked verb, is functionally equivalent to the J Toolkit adverb train, and ~ is what 104!:1 was previously; that is, an extension of the official ~ (see, http://www.jsoftware.com/pipermail/programming/2013-February/031684.html and http://www.2bestsystems.com/foundation/j/jx0/index.html). Thus, '+:' ".. 1 2 3 2 4 6 ".. +:`.1 2 3 2 4 6 '+:'~ 1 2 3 2 4 6 On Sun, Feb 14, 2016 at 12:14 AM, Raul Miller <[email protected]> wrote: > In that case, while cam and Am themselves are not tacit, they can be > used to produce tacit expressions (and are considerably simpler in > construction and more efficient in execution than any comparable tacit > expression which I have seen). > > In a similar vein, the J interpreter, itself, is not tacit, but is an > important part of any tacit toolkit. > > Does that make sense to you? > > Thanks, > > -- > Raul > > > On Sat, Feb 13, 2016 at 11:15 PM, Jose Mario Quintana > <[email protected]> wrote: > > I am sure that you "can produce examples of these forms where the > arguments > > are not referred to explicitly in the sentence(s) that represent the > > function being defined." However, when you were "hearing rumblings from > > other people" the representations questioned were (see, > > http://www.jsoftware.com/pipermail/programming/2015-December/043676.html > ), > > > > cam > > 2 : ' u 5!:1<''v''' > > Am > > 1 : ' u cam' > > > > I do know but arguments seem to be "referred to explicitly." Am I > missing > > something? Were you referring to other rumblings from other people > instead? > > > > > > On Sat, Feb 13, 2016 at 7:34 PM, Raul Miller <[email protected]> > wrote: > > > >> http://www.jsoftware.com/papers/TacitDefn.htm > >> > >> "The predominant form of function definition in APL is explicit in the > >> sense that the arguments are referred to explicitly in the sentences > >> that represent the function being defined." > >> > >> I can produce examples of these forms where the arguments are not > >> referred to explicitly in the sentence(s) that represent the function > >> being defined. I imagine that those cases could be thought of as > >> tacit. > >> > >> For example: > >> > >> meanie=: 1 :0 > >> +/ % # > >> ) > >> > >> But of course, if you mean tacit in some different sense, the rules > change. > >> > >> -- > >> Raul > >> > >> > >> On Sat, Feb 13, 2016 at 7:21 PM, Jose Mario Quintana > >> <[email protected]> wrote: > >> > The expression noun define (0 : 0) is meant to produce (ultimately) a > >> > noun. However, monad define (3 : 0), dyad define (4 : 0), adverb > define > >> (1 > >> > : 0) and conjunction define (2 : 0) produce verbs, adverbs and > >> > conjunctions; are these (the products) tacit? > >> > > >> > Paraphrasing a certain colorful crafty politician: I do not know but > >> people > >> > say, or imply, they are explicit; very smart people tell me they are > not > >> > tacit; I do not know but... ;) > >> > > >> > > >> > On Fri, Feb 12, 2016 at 6:47 PM, Raul Miller <[email protected]> > >> wrote: > >> > > >> >> That's simpler than what I was thinking of. > >> >> > >> >> And that does satisfy my concept of tacit programming, though I think > >> >> I remember hearing rumblings from other people that this kind of > thing > >> >> is not tacit. (Actually, if tacit means "no use of names" then the 3 > >> >> :'0 :0' definition would also be tacit.) > >> >> > >> >> Thanks, > >> >> > >> >> -- > >> >> Raul > >> >> > >> >> > >> >> On Fri, Feb 12, 2016 at 6:18 PM, Jose Mario Quintana > >> >> <[email protected]> wrote: > >> >> > getnoun=. ".@:('0 : 0'"_) > >> >> > > >> >> > $getnoun'' > >> >> > 1 2 3 > >> >> > 4 5 6 > >> >> > ) > >> >> > 12 > >> >> > > >> >> > > >> >> > On Fri, Feb 12, 2016 at 2:41 PM, Raul Miller < > [email protected]> > >> >> wrote: > >> >> > > >> >> >> Wrapping 0 :0 in an explicit verb should be possible: > >> >> >> > >> >> >> getnoun=:3 :'0 :0' > >> >> >> $getnoun'' > >> >> >> 1 2 3 > >> >> >> 4 5 6 > >> >> >> ) > >> >> >> 12 > >> >> >> > >> >> >> It's also possible to do this tacitly, but yeah, doing it tacitly > >> such > >> >> >> that it triggers when a verb is executed would be tricky > (possible, > >> >> >> but overly verbose to accomplish). Also, not sure if that would > have > >> >> >> any uses... > >> >> >> > >> >> >> Personally, I rarely even bother using the predefined (noun > define) > >> >> >> cover for this. The raw 0 :0 form is actually rather convenient. > >> >> >> > >> >> >> Thanks, > >> >> >> > >> >> >> -- > >> >> >> Raul > >> >> >> > >> >> >> > >> >> >> On Fri, Feb 12, 2016 at 2:03 PM, Matthew Baulch < > >> [email protected]> > >> >> >> wrote: > >> >> >> > Ok. That explains things well. So the the line(s) containing : > >> behave > >> >> >> just > >> >> >> > as if : is an everyday conjunction. It's the lines AFTER : that > are > >> >> >> treated > >> >> >> > specially. > >> >> >> > > >> >> >> > I suppose that's quite a clear design. I'll re-read the > >> documentation. > >> >> >> Like > >> >> >> > you say, once I know what's going on, these subtle points are > more > >> >> likely > >> >> >> > to stand out. > >> >> >> > > >> >> >> > ". does indeed have unlimited potential—over the domain of > >> character > >> >> >> arrays > >> >> >> > anyway. I'm trying to wrap this construction in a verb so I can > >> obtain > >> >> >> > these multi-line definitions without explicitly calling ". . > Just > >> for > >> >> >> > feelings of purity. It doesn't seem like this can be > accomplished > >> >> >> tacitly. > >> >> >> > I'm starting to think that 0:0 has to appear in each definition, > >> and > >> >> so > >> >> >> > defining such a verb may not be possible. Oh well. > >> >> >> > > >> >> >> > Thanks. : makes sense now. > >> >> >> > On 12 Feb 2016 2:11 pm, "Henry Rich" <[email protected]> > wrote: > >> >> >> > > >> >> >> >> > Forgive me if I'm wrong, but I don't see a discussion of > >> >> 'expressions > >> >> >> to > >> >> >> >> the > >> >> >> >> > right of zero' (such as '-.LF' in '0 : 0 -. LF') > >> >> >> >> > in either of your links. > >> >> >> >> > >> >> >> >> No. But that isn't surprising when you understand what's going > >> on. > >> >> >> >> > >> >> >> >> 0 : 0 creates a noun. > >> >> >> >> > >> >> >> >> Because conjunctions are executed before verbs, > >> >> >> >> > >> >> >> >> 0 : 0 -. LF > >> >> >> >> > >> >> >> >> is the same as > >> >> >> >> > >> >> >> >> (0 : 0) -. LF > >> >> >> >> > >> >> >> >> (0 : 0) creates a noun that can be used just as any other noun > is > >> >> used. > >> >> >> >> You can add to it, subtract from it, execute it... The (-. LF) > >> has > >> >> >> nothing > >> >> >> >> to do with the execution of (:). What I'm saying is, if you > are > >> OK > >> >> with > >> >> >> >> something like > >> >> >> >> > >> >> >> >> ".;._2 (0 : 0) > >> >> >> >> > >> >> >> >> [which feeds the result of (0 : 0) into a verb], you should > ipso > >> >> facto > >> >> >> be > >> >> >> >> OK with > >> >> >> >> > >> >> >> >> (0 : 0) -. LF > >> >> >> >> > >> >> >> >> which also feeds that result into a verb, just from the left > this > >> >> time. > >> >> >> >> > >> >> >> >> The (:) in (0 : 0) is executed WHEN (:) IS EXECUTED, i. e. at > the > >> >> >> >> appropriate time during the parse [see NuVoc for explanations]. > >> After > >> >> >> (:) > >> >> >> >> has read its fill, execution of the sentence continues. So, you > >> can > >> >> have > >> >> >> >> > >> >> >> >> (0 : 0) ,&(".;._2) (0 : 0) > >> >> >> >> > >> >> >> >> 1 2 3 > >> >> >> >> > >> >> >> >> ) > >> >> >> >> > >> >> >> >> 10 20 30 > >> >> >> >> > >> >> >> >> 40 50 60 > >> >> >> >> > >> >> >> >> 70 80 90 > >> >> >> >> > >> >> >> >> ) > >> >> >> >> > >> >> >> >> 10 20 30 > >> >> >> >> > >> >> >> >> 40 50 60 > >> >> >> >> > >> >> >> >> 70 80 90 > >> >> >> >> > >> >> >> >> 1 2 3 > >> >> >> >> > >> >> >> >> > >> >> >> >> Two (0 : 0) in one sentence [the parentheses are not required]! > >> and > >> >> >> >> executed right-to-left. > >> >> >> >> > >> >> >> >> > >> >> >> >> > >> >> >> >> (".) has unlimited potential, but often is put to mundane use. > >> When I > >> >> >> was > >> >> >> >> starting with J I felt a frisson of daring when I used it, but > now > >> >> it's > >> >> >> >> just another verb to me. > >> >> >> >> > >> >> >> >> > >> >> >> >> Henry Rich > >> >> >> >> > >> >> >> >> > >> >> >> >> > >> >> >> >> > >> >> >> >>> I'd welcome any correction. > >> >> >> >>> > >> >> >> >>> Cheers. > >> >> >> >>> It's pretty well explained at > >> >> >> >>> > >> >> >> >>> > http://code.jsoftware.com/wiki/Vocabulary/NounExplicitDefinition > >> >> >> >>> > >> >> >> >>> The question is, How would you know to read that? Suggestions > >> >> >> welcomed. > >> >> >> >>> > >> >> >> >>> When you say "expression following the 0", I'm not sure which > 0 > >> you > >> >> >> mean. > >> >> >> >>> > >> >> >> >>> : is the all-purpose entity creator; the left 0 says 'create a > >> >> noun', > >> >> >> and > >> >> >> >>> the right > >> >> >> >>> 0 says 'make that noun from the upcoming lines of input'. > >> >> >> >>> > >> >> >> >>> Full details are spelled out in several pages starting at > >> >> >> >>> http://code.jsoftware.com/wiki/Vocabulary/cor > >> >> >> >>> > >> >> >> >>> Henry Rich > >> >> >> >>> > >> >> >> >>> > >> >> >> >>> On 2/11/2016 12:55 AM, Matthew Baulch wrote: > >> >> >> >>> > >> >> >> >>> Thanks everyone. This (let's say) creative use of 0 : 0 makes > >> sense > >> >> to > >> >> >> me > >> >> >> >>>> now. I wonder if it's an accidental consequence of the > >> >> implementation > >> >> >> >>>> that > >> >> >> >>>> allows an expression following the 0, or whether it's a > >> deliberate > >> >> >> design > >> >> >> >>>> decision. Either way, it makes sense to have it documented. > >> Can't > >> >> see > >> >> >> it > >> >> >> >>>> in > >> >> >> >>>> NuVoc or the Dictionary. Of course, I may have overlooked it. > >> >> >> >>>> > >> >> >> >>>> Honestly, to obtain something simple like multi-line noun > >> >> >> definitions, ". > >> >> >> >>>> does seem like quite a heavy-handed tool. It does work > however, > >> so > >> >> I > >> >> >> >>>> probably shouldn't grumble. > >> >> >> >>>> > >> >> >> >>>> Cheers. > >> >> >> >>>> > >> >> >> >>>> On Wed, Feb 10, 2016 at 10:29 PM, Matthew Baulch < > >> >> >> [email protected]> > >> >> >> >>>> wrote: > >> >> >> >>>> > >> >> >> >>>> Looking at this more closely now. I'm a bit puzzled about the > >> use > >> >> of > >> >> >> -. > >> >> >> >>>> > >> >> >> >>>>> here. Obviously this is used here in dyadic form. In x -. LF > >> the > >> >> LF > >> >> >> >>>>> characters are, of course, removed from x. What is the x > here? > >> I > >> >> have > >> >> >> >>>>> seen > >> >> >> >>>>> that it works--not doubting that. Just trying to work out > how. > >> >> Sorry. > >> >> >> >>>>> There's probably something obvious I've missed. > >> >> >> >>>>> > >> >> >> >>>>> On Wed, Feb 10, 2016 at 12:52 AM, Raul Miller < > >> >> [email protected] > >> >> >> > > >> >> >> >>>>> wrote: > >> >> >> >>>>> > >> >> >> >>>>> If you do not have good names for partial calculations, that > >> >> might be > >> >> >> >>>>> > >> >> >> >>>>>> a sign that you need to think a bit more about the > >> abstractions > >> >> you > >> >> >> >>>>>> are using. It can be difficult for other people to read if > you > >> >> don't > >> >> >> >>>>>> make sufficient effort to label your abstractions. > >> >> >> >>>>>> > >> >> >> >>>>>> Also, I would note that your 'c0' is not a combinator, as > you > >> are > >> >> >> not > >> >> >> >>>>>> using its dyadic definition. So you might want to use a > >> different > >> >> >> name > >> >> >> >>>>>> for that one. Perhaps: > >> >> >> >>>>>> > >> >> >> >>>>>> v0=:c0 > >> >> >> >>>>>> > >> >> >> >>>>>> That said, if you really want to execute really long lines, > >> you > >> >> can > >> >> >> do > >> >> >> >>>>>> that using ". 0 :0-.LF and indented text. (You need the > >> >> indentation > >> >> >> >>>>>> because line feeds will not separate words here.) > >> >> >> >>>>>> > >> >> >> >>>>>> For example: > >> >> >> >>>>>> > >> >> >> >>>>>> myStruct=: ". 0 :0-.LF > >> >> >> >>>>>> v0 p0 c1 p1 c2 p2 c3 p3 c4 p4 c5 p5 c6 p6 c7 p7 c8 p8 > c9 > >> p9 > >> >> >> >>>>>> c10 p10 c11 p11 c12 p12 c13 p13 c14 p14 c15 p15 c16 p16 > >> c17 > >> >> >> >>>>>> p17 c18 p18 c19 p19 c20 p20 c21 p21 c22 p22 c23 p23 c24 > >> p24 > >> >> >> >>>>>> c25 p25 c26 p26 c27 p27 c28 p28 c29 p29 c30 p30 > >> >> >> >>>>>> ) > >> >> >> >>>>>> > >> >> >> >>>>>> I hope this helps, > >> >> >> >>>>>> > >> >> >> >>>>>> -- > >> >> >> >>>>>> Raul > >> >> >> >>>>>> > >> >> >> >>>>>> On Tue, Feb 9, 2016 at 4:59 AM, Matthew Baulch < > >> >> >> [email protected]> > >> >> >> >>>>>> wrote: > >> >> >> >>>>>> > >> >> >> >>>>>> Suppose I wish to construct a complex, non-regular deeply > >> nested > >> >> >> >>>>>>> > >> >> >> >>>>>>> structure: > >> >> >> >>>>>> > >> >> >> >>>>>> to model some inherently non-linear system. A natural > approach > >> >> (for > >> >> >> me, > >> >> >> >>>>>>> anyhow) is to construct a library of combinators, or a > domain > >> >> >> specific > >> >> >> >>>>>>> language, with which to specify the (boxed) structure. > >> >> >> >>>>>>> > >> >> >> >>>>>>> J rises easily to the task, and before long I'm looking at > >> long > >> >> >> >>>>>>> function > >> >> >> >>>>>>> trains of the form > >> >> >> >>>>>>> > >> >> >> >>>>>>> myStruct =: c0 p0 c1 p1 c2 p2 ... cN pN > >> >> >> >>>>>>> > >> >> >> >>>>>>> where the ci are (combinator) verbs, and the pj are > >> (parameter) > >> >> >> nouns. > >> >> >> >>>>>>> Nice. Easy. > >> >> >> >>>>>>> > >> >> >> >>>>>>> Only trouble is, N may be large and J prefers such > >> statements to > >> >> >> sit > >> >> >> >>>>>>> on > >> >> >> >>>>>>> > >> >> >> >>>>>>> a > >> >> >> >>>>>> > >> >> >> >>>>>> single line. Correct? I can split my definition: > >> >> >> >>>>>>> > >> >> >> >>>>>>> msPartA =. ..... > >> >> >> >>>>>>> msPartB =. ..... > >> >> >> >>>>>>> ..... > >> >> >> >>>>>>> msPartX =. ..... > >> >> >> >>>>>>> myStruct =: msPartA msPartB .... msPartX > >> >> >> >>>>>>> > >> >> >> >>>>>>> though this feels awkward. The most obvious issue is that > the > >> >> >> PartA, > >> >> >> >>>>>>> > >> >> >> >>>>>>> ..., > >> >> >> >>>>>> > >> >> >> >>>>>> PartX are distracting; unless of course I can find a > natural > >> way > >> >> of > >> >> >> >>>>>>> splitting and naming them. Ideally, the parts should be as > >> close > >> >> >> to a > >> >> >> >>>>>>> comfortable line width as possible. Again, awkward. If > >> myStruct1 > >> >> >> and > >> >> >> >>>>>>> myStruct2 have the same partitioning scheme but myStruct2 > >> (for > >> >> >> >>>>>>> > >> >> >> >>>>>>> instance) is > >> >> >> >>>>>> > >> >> >> >>>>>> much larger than myStruct1, there will be many sparsely, or > >> many > >> >> >> >>>>>>> overpopulated lines. Awkward too. > >> >> >> >>>>>>> > >> >> >> >>>>>>> I love J. It handles complex regular data so elegantly. > How > >> can > >> >> I > >> >> >> >>>>>>> bring > >> >> >> >>>>>>> similar elegance to irregular data? Can my combinators be > >> >> rescued, > >> >> >> or > >> >> >> >>>>>>> should I use another approach? > >> >> >> >>>>>>> > >> >> >> > >> ---------------------------------------------------------------------- > >> >> >> >>>>>>> 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 > >> >> > ---------------------------------------------------------------------- > >> >> 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
