« first day (1089 days earlier)      last day (1558 days later) » 

6:05 PM
I'm looking through J and I can't figure out where their equivalent of ¨ or their equivalent of [apply function along this axis, please] is
 
6:23 PM
@Sherlock9 perhaps something like rank? I don't speak J, though I know they're fond of it. Marshall tried to explain a method of using the rank operator in Dyalog APL to mimic the behaviour of each but I have forgotten how it worked, I'll be honest.
Rank 0 -- operates on individual atoms of y, producing a result of the same shape
This verb operates on atoms of y and produces a result with the same shape as y. - is an example of this type of verb:

i. 2 3
0 1 2
3 4 5
- i. 2 3
0 _1 _2
_3 _4 _5
 
6:41 PM
There's an each in the standard library. It is the equivalent of ⊂∘f∘⊃⍤0
 
@Adám ah, that's the expression I was thinking of
I really should take a look into J. What benefits does it have over Dyalog APL? They're both array based, and from what I can tell somewhat similar.
 
If you feel great satisfaction from generating ASCII noise, then J is it.
Joke aside. J is more consistent in some parts of the syntax, while APL is more consistent in others.
J very much pushes you towards tacit programming. APL gives you the choice.
J has a well-defined stdlib and package system. APL is not there yet.
J's array model allows one thing APL's doesn't (enclosed simple scalars) and APL's array model allows one thing J's doesn't (mixed-type simple arrays).
APL takes prototypes to the extreme (for good and for bad). For J, every enclosure is the same "type".
@JamesHeslip Real benefits? J has arrays of functions. Well, not really, but almost. J allows operator phrases, and returning functions.
 
6:59 PM
I was reading up on their verbs, and adverbs, etc. Not really sure what that means, but I'd assume some sort of composed function like APL's jot capability. I don't know that there's much for me to learn from J, with the exception of syntax and practicing my tacit programming. Packages aside, that is.
 
@JamesHeslip noun=array, verb=function, adverb=monadic operator, conjunction=dyadic operator.
 
@Adám my guess would be, in an example like +/, the verb is the plus, the adverb is the reduce.
 
@JamesHeslip Right.
 
Ah, awesome. Makes sense when you think about it in the sense of the words- what you're doing and how you're applying it.
 
Oh, another thing. J generalises some operators, which makes them more powerful, but slightly more awkward to use for simple cases. E.g. APL's +⍀ is +/\ in J.
 
7:14 PM
Hmm, interesting. Different, not necessarily a reason to use it though. I'm (stupidly) kinda looking for something to do with the little free time I have, hence the interest in J. How about Dyalog APL extended? I've seen codegolf posts using it, but never really taken notice. Since we use very vanilla D16 at work, I've often strayed from experimenting with these things at home. Wouldn't want to go to use something in the office and not be able to...
 
7:32 PM
J does have extended integer precision, e.g. 299792458x, and support for both floats and rational numbers, e.g. 1r12. These two things combined make it a lot easier to calculate, say, Bernoulli numbers to a certain precision than in J
 
7:55 PM
@Sherlock9 Ah, very good points. I completely forgot about those. It also facilitates input in various complex and number-base formats. (Though NARS200 has most of all these features.) CC @JamesHeslip
 
8:11 PM
*than in Dyalog APL, I mean.
@Adám Ah I'll have to check out NARS2000 some time. I bet there's a lot that Dyalog APL has that NARS2000 doesn't have though.
 
@Sherlock9 Goes both ways. Dyalog's strength is mainly in dealing with the world outside. And performance, of course.
 
@Adám Also, would you happen to know if J supports anything like Dyalog's dfns with ⍵, ⍺, ⍵⍵, and ⍺⍺? Trains still confuse me and I'd rather not use them exclusively just yet
 
@Sherlock9 Yes, J does support such. It is called explicit and its ugliness is what makes me claim that J pushes tacitness.
 
Good lord that looks woolly
I'll try parsing that article again in the morning
Thanks again, Adám
 
 
3 hours later…
11:08 PM
@Adám While it is ugly, I believe it was the best compromise without a dedicated syntax.
 
Which functional language doesn't have a syntax for functions‽
 
ngn
are apl and j truly functional, though? they are missing an important ingredient - treating functions as first-class values
 
That isn't really relevant for this. They are close enough to need a function syntax, imho. That said, tradfns are not great either.
 
@Sherlock9 Quick introduction: 3 :'body' or 4 :'body' (a number, a space, a colon, then a plain string) can be used to define a monadic verb or a dyadic/ambivalent verb respectively. (Other numbers can define an adverb/conjunction/noun - check the docs for them.) In the body, x gets the value of the left arg (if present), and y the right arg. You can then write the body just like an ordinary J expression.
@ngn I guess they're pretty close: you can pass a function to another "function" (though it's called an operator), partially apply a function, write an anonymous function, ...
 
11:40 PM
> This means the language supports passing functions as arguments to other functions, returning them as the values from other functions, and assigning them to variables or storing them in data structures.
APL fails at "storing them in data structures". J at least has a built-in to fake it.
^ unless the namespaces count.
 

« first day (1089 days earlier)      last day (1558 days later) »