Re: [Jprogramming] Tacit Expressions with Explicit J Syntax

2017-09-30 Thread Raul Miller
Tacit J sometimes has a performance advantage over explicit J. Explicit J sometimes has a performance advantage over tacit J. That said, I find both useful as tools for my own thinking. They offer ways of expressing concepts and ways of experimenting with them. They are not my only tools, but I wo

Re: [Jprogramming] Tacit Expressions with Explicit J Syntax

2017-09-30 Thread Jose Mario Quintana
The Curried adverb xi, produces tacit verbs (which might be higher-order verbs); however, in contrast to the tacit translator 13 : '...' , the product is not a translation to tacit code (i.e., it is not really a compiler). Instead, the product consists of a description of the position of the param

Re: [Jprogramming] Agenda in explicit expressions WAS: Tacit Expressions with Explicit J Syntax

2017-09-30 Thread Erling Hellenäs
Thanks. Good to get someone to acknowledge your thoughts :) /Erling On 2017-10-01 01:12, Louis de Forcrand wrote: That's what I understood from the J dictionary, NuVoc, and personal experience: $: refers to the *largest, unnamed, tacit* verb containing it. And by "tacit" here I mean in the same

Re: [Jprogramming] Tacit Expressions with Explicit J Syntax

2017-09-30 Thread Erling Hellenäs
Hi all ! I'll try to summarize this thread so far. Explicit and tacit J can be used interchangeably for everything you can do in J. Tacit J has a slight performance advantage. This can be useful in time-critical applications or time-critical parts of applications. Tacit J does not have mutable

Re: [Jprogramming] Agenda in explicit expressions WAS: Tacit Expressions with Explicit J Syntax

2017-09-30 Thread Louis de Forcrand
That's what I understood from the J dictionary, NuVoc, and personal experience: $: refers to the *largest, unnamed, tacit* verb containing it. And by "tacit" here I mean in the same "colon-level" as the $: in question. For example: In $: @ (3 : 'y') $: refers to the whole verb. In 3 : '$: y' it re

Re: [Jprogramming] Agenda in explicit expressions WAS: Tacit Expressions with Explicit J Syntax

2017-09-30 Thread Raul Miller
Hmm.. after re-reading the dictionary definition, I think I was wrong when I said that x $: <: y was the meaning for $: in that second example: Since no verbs are formed in that sentence, $: just refers to itself as the largest containing verb. Please tell me if you have reason to think I'm wro

Re: [Jprogramming] Agenda in explicit expressions WAS: Tacit Expressions with Explicit J Syntax

2017-09-30 Thread Henry Rich
The problem is that we mean different things by 'work'.  To me, that means it behaves the way NuVoc says it does.  I get the feeling that to you, 'works' means it behaves the way you want it to. It works, by my meaning.  The Dictionary is not precise about the behavior of $: in explicit defini

Re: [Jprogramming] Agenda in explicit expressions WAS: Tacit Expressions with Explicit J Syntax

2017-09-30 Thread Raul Miller
Well... that depends on what you mean by work. For example, - does not work in explicit J with agenda when what you really want is +. Thanks, -- Raul On Sat, Sep 30, 2017 at 6:04 PM, Erling Hellenäs wrote: > I guess it would be impossible to get you to acknowledge that it does not > work wi

Re: [Jprogramming] Agenda in explicit expressions WAS: Tacit Expressions with Explicit J Syntax

2017-09-30 Thread Erling Hellenäs
I guess it would be impossible to get you to acknowledge that it does not work  with explicit J in agenda :) /Erling On 2017-09-30 23:16, Raul Miller wrote: Yes, if you want to explicitly reference the definition of f, you should use the name f (like you used at first), and not $: $: refers to

Re: [Jprogramming] Jx 1.1 Release

2017-09-30 Thread Jose Mario Quintana
The link [1] was cut short; it should have been: http://www.jsoftware.com/pipermail/programming/2006-November/004188.html On Sat, Sep 30, 2017 at 5:27 PM, Jose Mario Quintana < jose.mario.quint...@gmail.com> wrote: > Jx 1.1 Release > > A Jx v1.1 Extensions Guide, a J/Jx Cheatsheet, a Jx Asserti

[Jprogramming] Jx 1.1 Release

2017-09-30 Thread Jose Mario Quintana
Jx 1.1 Release A Jx v1.1 Extensions Guide, a J/Jx Cheatsheet, a Jx Assertions script together with links to a Windows 64 bit dll, a Unix 64 bit so binaries (without avx support) and the patch corresponding to the J806 source (beta-6) can be found at the link [0]. Summary - Primitives Added

Re: [Jprogramming] Agenda in explicit expressions WAS: Tacit Expressions with Explicit J Syntax

2017-09-30 Thread Raul Miller
Yes, if you want to explicitly reference the definition of f, you should use the name f (like you used at first), and not $: $: refers to the containing sentence, which in your example was x $: <: y To have $: mean something different you need to use it in a different sentence (which is entire

[Jprogramming] Agenda in explicit expressions WAS: Tacit Expressions with Explicit J Syntax

2017-09-30 Thread Erling Hellenäs
I created a new thread. See question below. /Erling Forwarded Message Subject:Re: [Jprogramming] Tacit Expressions with Explicit J Syntax Date: Sat, 30 Sep 2017 22:35:48 +0200 From: Erling Hellenäs Reply-To: programm...@jsoftware.com To: programm...@jsoftw

Re: [Jprogramming] Tacit Expressions with Explicit J Syntax

2017-09-30 Thread Marc Simpson
Quick request as we're nearing 100 messages: How about splitting out questions about $: etc. into a new thread? I think it might be easier for everyone to follow. /M On Sat, Sep 30, 2017 at 1:35 PM, Erling Hellenäs wrote: > Hi all ! > > Is there a way to get $: to work with agenda and with expli

Re: [Jprogramming] Tacit Expressions with Explicit J Syntax

2017-09-30 Thread Erling Hellenäs
Hi all ! Is there a way to get $: to work with agenda and with explicit code?    f=: 4 : 'x (4 : ''x'')`(4 : ''s,y +{: s=.x f <: y'')@.(4 :''x < y'') y'    4 f 8 4 9 15 22 30    f=: 4 : 'x (4 : ''x'')`(4 : ''s,y +{: s=.x $: <: y'')@.(4 :''x < y'') y'    4 f 8 |stack error: f |   s,y+{:s=.x   

Re: [Jprogramming] Tacit Expressions with Explicit J Syntax

2017-09-30 Thread Henry Rich
On 9/30/2017 3:38 PM, Erling Hellenäs wrote: So, tacit code creates composites of compiled code and explicit code is still interpreted each time it is called? Broadly, that's right.  But remember that interpretation embraces parsing and bookkeeping.  Tacit code still has the bookkeeping. There

Re: [Jprogramming] Tacit Expressions with Explicit J Syntax

2017-09-30 Thread Henry Rich
It's hard to answer your question about whether explicit code can replace tacit because I think we are defining the words differently. Explicit code can replace tacit code anywhere, trivially.  If you have a tacit verb t, the explicit verb 3 : ('t y';':';'x t y')"t does the same as t. But t

Re: [Jprogramming] Tacit Expressions with Explicit J Syntax

2017-09-30 Thread Erling Hellenäs
So, tacit code creates composites of compiled code and explicit code is still interpreted each time it is called? There is nothing like a J JIT compiler? /Erling On 2017-09-30 21:22, Erling Hellenäs wrote: Hi all! OK. Yes. Considering this the differences seem very small. Long ago I remember

Re: [Jprogramming] Tacit Expressions with Explicit J Syntax

2017-09-30 Thread Erling Hellenäs
Hi all! OK. Yes. Considering this the differences seem very small. Long ago I remember looping programs I made 270 times faster by removing the loop and using some recursive tricks. Now the looping solution can often even be faster. No one want's to answer the question if explicit code can r

Re: [Jprogramming] Tacit Expressions with Explicit J Syntax

2017-09-30 Thread Henry Rich
Bill hit the nail on the head: > IMO it doesn't matter whether to use tacit or explicit, > the more important thing is to understand how J works. u@:v y  means 'Do v on y; then do u on that result'.  It is exactly the same as   (u v y). u@v y  means 'Do v on the first cell of y; then do v on

Re: [Jprogramming] print an array

2017-09-30 Thread Devon McCormick
The "calendar" verb from J's "stdlib" has an optional left argument that allows you to specify the starting day of the week: calendar=: 3 : 0 0 calendar y : a=. ((j<100)*(-100&|){.6!:0'')+j=. {.y b=. (a-x)+-/<.4 100 400%~<:a r=. 28+3,(~:/0=4 100 400|a),10$5$3 2 r=. (-7|b+0,+/\}:r)|."0 1 r(]&:>:*"1

Re: [Jprogramming] Tacit Expressions with Explicit J Syntax

2017-09-30 Thread Erling Hellenäs
If the first example was in an equivalent to tacit code, it could not call f. It would have to be like this: 4 (.x).`(.y (. y , x + {: y ). x $: <: y).@.(.x < y). 8 It would be impossible to use in a larger tacit program and you'd need Jx to solve that, as far as I understand. Same problem as i

Re: [Jprogramming] Tacit Expressions with Explicit J Syntax

2017-09-30 Thread Don Guinn
I really don't care which is faster. I use which is easier for what I want to do. I like tacit because it avoids repeating a name over and over as in non-tacit. I say non-tacit instead of explicit because explicit has to do with explicit definitions. Often I never even write an explicit definition

Re: [Jprogramming] Tacit Expressions with Explicit J Syntax

2017-09-30 Thread Erling Hellenäs
Hi all ! 4(f=. 4 : 'x (4 : ''x'')`(4 : ''s,y +{: s=.x f <: y'')@.(4 :''x < y'') y' )8 4 9 15 22 30 Here we have another example of the Henry syntax: 4(f=.(.x (.x).`(.y (. y , x + {: y ). x f <: y).@.(.x < y). y).)8 s is here the right unnamed operand of (. y , x + {: y ).  . As long as

Re: [Jprogramming] Tacit Expressions with Explicit J Syntax

2017-09-30 Thread Erling Hellenäs
Hi all! Yes, well,  I wanted to measure differences between tacit and explicit expressions as such, so I tried to avoid unrelated processing time. In case  you have significant operations, these differences disappear, of course, and the processing time in these operations dominate over interp

Re: [Jprogramming] Tacit Expressions with Explicit J Syntax

2017-09-30 Thread Raul Miller
I think your approach was fine. Integer arithmetic, after all, has a recursive definition. (Which, thankfully, we mostly just assume exists rather than using as a technique to slow things down.) https://en.wikipedia.org/wiki/Peano_axioms Thanks, -- Raul On Sat, Sep 30, 2017 at 8:59 AM, Don Gui

Re: [Jprogramming] Tacit Expressions with Explicit J Syntax

2017-09-30 Thread Don Guinn
I didn't realize that the solution was supposed to be recursive. I got tired of trying to figure out recursive or polynomial solutions for a series of numbers in Project Euler and found it easy to use matrix division when there is a polynomial solution. And given a polynomial solution for each term

Re: [Jprogramming] Tacit Expressions with Explicit J Syntax

2017-09-30 Thread bill lam
Since the time taking is small, better to run n times to obtain an average. + and - are scalar functions of rank-0, but J has integrated rank support so that there will be no performance penalty if its arguments are arrays. @ will inherent the rank of - , better to use @: in this case. 50 ts'

Re: [Jprogramming] Tacit Expressions with Explicit J Syntax

2017-09-30 Thread Erling Hellenäs
Hi all ! Can tacit and explicit J be interchangeably used everywhere ? Examples of use:    4 (3 :'- y')@:(4 :'x + y') 5 _9    3(4 :'(1: x + y)#''x'' ')`(4 :'(1: x + y)#''y'' ')@.(4 :'x < y')4 y What are the performance implications of using explicit J instead of tacit J? This little example