« first day (1253 days earlier)      last day (1402 days later) » 
02:00 - 18:0018:00 - 23:00

2:16 AM
@Adám Does Extended's Stencil really "allow small "? I get domain error for ⊂⍤⊢⌺3 3⍳1 4.
 
 
2 hours later…
4:32 AM
@Bubbler Yes, but only when used dyadically. Try it online!
 
4:43 AM
@Adám Oh, didn't notice that. (Too lazy to read the source...)
Fun fact: It was exactly 49 bytes (before I learned the "proper" use of Stencil), which is 1 byte longer than Jelly.
That definitely should be Dyalog's standard feature.
 
@Bubbler What?
 
4:59 AM
@Adám Allowing small s for . It could be Extended's way, it might be something different, but at least it shouldn't throw DOMAIN ERROR at the user's face just because it's too small.
 
@Bubbler Problem is supplying a left arg to the left operand, even if unused.
 
Just wondering how often it (left arg to the left operand) is actually used in production...
 
Almost never, I think. Could we give some sort of dummy value when too small?
 
What if we simply say 0 for an axis that is padded on both sides?
or 0J1? (just a random idea)
 
Or (⊂¯1 2)
Of course, that'll make fail, unless we extend it too.
Actually, that may not be so bad: (⊂¯1 2)↓'abcdef' gives 'cde'?
 
5:07 AM
@Adám +←1
That makes it somewhat more consistent with the left arg of
 
How?
 
which also takes a possibly nested array per (leading) axis
 
Ah, as in if you want more than one cell, you must enclose the list of indices. If you want more than one trim, you must enclose the list of trim lengths.
 
Exactly, because both accept one element per axis, and we want to do something multiple times on a single axis
 
I guess (⊂1 ¯2)↓'abcdef' should be allowed, but should (⊂1 2)↓'abcdef' also give 'def'?
 
5:12 AM
That would need some thought.
 
allows duplicates.
 
I believe it should respect actual possible use cases. What kind of use case would require to trim multiple times from one side?
 
@Bubbler You could have various things affect how much to trim.
Model: {⊃↓/(↓⍉↑1/⍺),⊂⍵}
Hm, this is potentially useful for Take as well:
      (⊂5 ¯3){⊃↑/(↓⍉↑1/⍺),⊂⍵}'abcdef' ⍝ first 5 of the last 3
def
      (⊂¯3 5){⊃↑/(↓⍉↑1/⍺),⊂⍵}'abcdef' ⍝ last 3 of the first 5
cde
Maybe the order should be reversed?
 
Hmm. I was thinking in terms of filters imposes, so overlaying those filters (with ) gives a filter that trims maximal lengths from both sides. For , that would be taking maximal lengths from both sides (by overlaying the filters with )
So can essentially extract an infix while can extract an outfix, maybe
gtg for now
 
5:27 AM
@Bubbler It'd in effect concatenate the two (positive and negative) maximal magnitude takes.
@Bubbler That makes sense, but this can also do that (though the argument for it is less intuitive) but can also "dig" things out.
@Bubbler Makes constructs like {(⍺↑⍵)(⍺↓⍵)} sensible.
@Bubbler Hm, That doesn't make much sense on higher-rank arrays though.
      (⊂2 ¯1){⊃⍪/(↓⍉↑1/⍺)↑¨⊂⍵}'abcdef'
abf
      (⊂2 ¯1){⊃⍪/(↓⍉↑1/⍺)↑¨⊂⍵}4 3⍴⎕A
ABC
DEF
JKL
      (2 ¯2)(2 ¯2){⊃⍪/(↓⍉↑1/⍺)↑¨⊂⍵}4 3⍴⎕A
AB
DE
HI
KL
 
 
2 hours later…
7:18 AM
@Adám Extracting a multi-dimensional infix sounds OK to me because the result is a contiguous subarray (and you can get any contiguous subarray with appropriate left args), while a multi-dimensional outfix might sound weird (possibly because of the symbol , and possibly because the implied overlay combiner is but interaction between multiple axes is always ).
 
@Bubbler Right, I was just about to write a new model.
 
But nD outfix has its uses too. The most natural use case would be to collect 1×1×... corners of a matrix or cube etc.
 
Right.
 
I could extend the model to overtakes, so positive overtakes add the prototype at the end and negative ones add at the start, at once.
 
@Bubbler Do you have a model?
 
7:28 AM
So e.g. ((-,¨⊢)1+⍴)↑⊢ pads the array once in every dimension and direction.
@Adám Not yet, I'm just about to try writing one.
 
@Bubbler Very useful.
@Bubbler Also, (3 3)(¯3 ¯3)↑⍪1 would create a 5-by-5 all-0 matrix with a 1 in the middle, right?
In fact, the shouldn't even be needed.
 
@Adám No, but (¯3 3)(¯3 3)↑⍪1 would do.
 
@Bubbler Ah, yes, that's what I mean.
Not pretty, but I think this works (without the overtake extension):
      (2 ¯1)(1 ¯1){⍵⌷⍨∊¨(,/↑(⊂⍬)∘,¨⍺)↑¨∘⊂∘⍳¨⍴⍵}4 3⍴⎕A
AC
DF
JL
 
8:02 AM
The extension turns out to be incredibly hard to implement.
 
Yeah, even the basic version took me a while. Funny though. It is so intuitive.
 
@Bubbler OK, but then you can just loop over the dimensions.
 
Yeah, I guessed so, but I have to leave again
 
 
2 hours later…
10:04 AM
APL, the only programming language where Microsoft Windows' window action buttons _ ⎕ × is meaningful code (at least if you enter _←× or similar when prompted).
 
RGS
@Adám we are still missing the overlapping squares, though
 
@RGS That's only when maximised.
Also, it isn't really the actual button chars: 🗕🗖🗙 and 🗕🗗🗙
@user82382 Hi Guys Math. If you want to participate here, email me: adam@ with the same domain as www.dyalog.com
 
 
2 hours later…
12:06 PM
@YuliiaSerhiienko Welcome to the Orchard. Great to see you here!
 
12:24 PM
@Memberfor3months Valid, but not meaningful. It is valid in HTML too.
 
@Memberfor3months Sure, but that's because Jelly ignores unknown characters. In HTML those characters do even more, namely print the Unicode characters with the code points corresponding to the characters given.
Btw, _ ⎕ × issues a prompt where entering _←× assigns the × function to _ and returns the × function. Now the value from is substituted for and _ has a value, so we have × × × which is the 3-train ××× that APL answers with. Try it online!
 
It's a really clever program.
(It's the square of the product of two numbers, isn't it?)
(I don't really think the monadic form is useful for any occasion.)
 
@Memberfor3months Yes.
 
12:46 PM
(Monadic form is still really clever. It's a more interesting way to check if the input is not equal to 0.)
(In which 0≠⊣ achieves the same bytecount, by the way.)
To sum up, this 3-train is indeed extremely clever!
 
@Memberfor3months The 2-train is shorter.
 
I wonder what is the corresponding APL glyph for 🗗...
 
@Memberfor3months No need to strike through or parenthesise or remove your messages. Either say it, or don't.
@Memberfor3months ?
 
_ ⌹ × is (probably) meaningful here.
 
1:08 PM
@Memberfor3months Depends entirely on the value of _
 
1:20 PM
Fancy walking me through some more matrix gymnastics?
Given:
m←2 2⍴⍳4
⊢data←2 2⍴⊂m
┌→────────────┐
↓ ┌→──┐ ┌→──┐ │
│ ↓0 1│ ↓0 1│ │
│ │2 3│ │2 3│ │
│ └~──┘ └~──┘ │
│ ┌→──┐ ┌→──┐ │
│ ↓0 1│ ↓0 1│ │
│ │2 3│ │2 3│ │
│ └~──┘ └~──┘ │
└∊────────────┘
I want to merge along second axis, and then along first to give
┌→──────┐
↓0 1 0 1│
│2 3 2 3│
│0 1 0 1│
│2 3 2 3│
└~──────┘
I came up with the following:
(⊃⍪⌿)⍪(⊃,/)¨↓data
but it seems to me that this may be solvable with the dyadic transpose, too?
 
@xpqz My first attempt: ,[1 2],⍤2⊢↑data
Bit of a gross mix of ravel-with-axis and rank and I need to check it's even right
also not enclosed result oops
Also not ⎕IO←0 oops
 
Can it be general in the size -- so if I had 3x3 instead of 2x2 sub-matrices?
 
@xpqz this should work for that i think, doesn't yours?
update: mine is trash, trying again
 
tbh considering it's nested to start with yours looks pretty good imo
 
1:27 PM
@dzaima I can barely keep track of one APL, let alone two :)
@RichardPark I was just disappointed having to use ¨...
 
@xpqz Yes:
      4 4⍴2 0 1 3⍉↑data
0 1 0 1
2 3 2 3
0 1 0 1
2 3 2 3
 
yeah!
 
@Adám As you can see, I am far from mastery :P
 
@Adám maybe a cultivation dedicated to the dyadic transpose?
 
@xpqz That's a good idea.
@xpqz Problem is how do we determine the 4 4?
Is there a better way to find the final shape than ((1 1⊃+⌿),(0 0⊃+/))⍴¨data ?
 
1:39 PM
is it not (⍴data)×⊃⍴¨data?
or are we trying to be more general? I guess you can't do this with ill conforming sub-arrays
 
@RichardPark Oh yes, of course. Or better: (⍴×⍴∘⊃)data (no need to find the shape of them all)
 
What is known to me is that the sub-arrays are always either 2x2 or 3x3, and completely and cleanly tiles the final array.
 
@xpqz So you can even squareroot the final count of elements.
 
Yes
 
@xpqz No, wait, is data always square too?
 
1:41 PM
Always square
 
Still, it probably won't get any better than (⍴×⍴∘⊃)⍴2 0 1 3⍉↑
@xpqz Hang on, my code might not be right!
 
I dont' think that works for the 1x1 case.
 
I suspect my test case wasn't good due to duplicate data.
@xpqz It should be (⍴×⍴∘⊃)⍴0 2 1 3⍉↑ (I had the first two axes swapped, and didn't notice as they were identical in your initial case.)
@xpqz What do you mean by the 1×1 case?
      ((⍴×⍴∘⊃)⍴0 2 1 3⍉↑) 1 1⍴⊂2 2⍴⍳4
0 1
2 3
 
Yeah
Hmm
 
Btw, for code golf (and the general solution where the submatrices are not uniform): ⊃,/⍪⌿data
 
1:52 PM
I'm getting a DOMAIN ERROR:
DOMAIN ERROR
      ((⍴×⍴∘⊃)⍴0 2 1 3⍉↑)1 1⍴⊂2 2⍴⍳4
 
@xpqz Where's caret () and what is ⎕ML?
 
DOMAIN ERROR
      ((⍴×⍴∘⊃)⍴0 2 1 3⍉↑)1 1⍴⊂2 2⍴⍳4
      ∧
      ⎕ML

1
Dyalog 17
 
And ⎕IO←0?
 
Meh
 
We've all been bitten.
 
1:54 PM
I blame @RichardPark :O
 
RGS
@Adám "for code golf" makes it look like it is not a nice solution in general..?
 
@RGS It is more expensive.
 
RGS
@Adám in terms of what?
 
      ⎕io←1 ⋄ data←(9⍴3↑1)(9⍴3↑1){↑(⊢/⊆⍺)⊂¨(⊃⊆⍺)⊂[1]⍵}9 9⍴⍳81 ⋄ ⎕io←0
      ]runtime -c ⊃,/⍪⌿data  "((⍴×⍴∘⊃)⍴0 2 1 3⍉↑)data"

  ⊃,/⍪⌿data               → 2.1E¯6 |   0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
  ((⍴×⍴∘⊃)⍴0 2 1 3⍉↑)data → 1.2E¯6 | -41% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
And that's only a 3 3⍴⊂3 3⍴
 
What abouy (⊃⍪⌿)⍪(⊃,/)¨↓data?
Wow
Don't do that!
 
1:59 PM
Right.
 
My solution seemingly both stupid AND slow.
So it seems the dyadic ⍉ is pretty honed in general.
 
@xpqz it's not that bad on bigger inputs
 
RGS
2:29 PM
@Adám I see
 
Ugh, {⊃,/⍪⌿⍵} can't be a tacit function in any sensible way.
 
RGS
@Adám because of / and ⌿ ?
 
Yeah.
⊃(,/⍪⌿) or (⊃,/)⍪⌿ :-(
 
2:50 PM
For a moment there I was stuck trying to figure out what the :-( bit did in APL..
 
@xpqz i really wish the default SE chat made the difference between code blocks and regular text clearer
 
@xpqz I use the Stylus browser extension with dzaima's css
 
(note: ^ is dark theme)
 
an apple magically appears in my hand
 
@matt OK, I'm available now, if you want.
 
2:57 PM
sure :)
 
Well, we're actually almost done with the intro parts.
Did I teach you about indexing?
 
nnnno i don't think so
 
There are a few way to do so, but the most intuitive (for those that know other languages, at least) is with square brackets:
      'abcdefg'[3]
c
 
ah finally something that looks like javascript
but isn't
 
At first glance. What's really cool in APL is that you can index with an array.
      'abcdefg'[3 1 4]
cad
 
3:00 PM
WOW that's awesome
 
Do you remember how to get the length of an array (e.g. a character vector)?
 
...is it bad if I don't?
 
No. It is easy to look up too. It is monadic which looks like a tally mark, for tallying!
 
another episode of "terrible monospace"
 
Ah yes.
(You can override the font to one that doesn't have the issue, btw.)
 
3:03 PM
(I can?)
 
10 mins ago, by Adám
@xpqz I use the Stylus browser extension with dzaima's css
 
I'll have to try that.
 
Well, it doesn't set the font, but you can create your own style (or modify his) to change the font too.
Do you remember how to create your own function?
 
yep {a,w} (replace a and w with alpha and omega)
"greeklish"
 
Right.
Now, while APL of course has a built-in to reverse arrays, with what you know, write a function that takes a vector and reverses it: {your code}'abcd' should give 'dcba'
 
3:09 PM
@Adám (fwiw, that chrome issue affects latvian chars like āē too, not just APL)
 
@dzaima Oh wow. And also various mathematical non-APL symbols.
 
@Adám did you teach me how to loop?
 
RGS
@matt prob not, you don't need to loop here :)
 
seems like I do
 
@RGS well, depends on what you call "looping"
 
3:13 PM
@matt No. And you don't need to. If you feel like looping in APL, then have another think. It is needed sometimes, but it is usually bad to do so.
 
[having another think]
fwiw try running this:
'abcdefghijklmnopqrstuvwxyz '[8 5 12 12 15 27 23 15 18 12 4]
 
RGS
@dzaima sure, but when talking to newbies the "looping" meant is generally the same
 
@matt Right. So can you construct a list of indices such that the text is reversed?
 
for any given text or just for 'abcd'?
 
@matt Well, you can start with 'abcd' and then try to generalise it.
 
3:17 PM
for abcd it would be:
      'abcd'[4 3 2 1]

dcba
 
Very good. What is the system here?
 
uh... [(length of array) (length of array - 1) etc etc]?
 
Great. Now write that in APL.
Remember how to generate indices 1 2 3 4…N?
 
first thing I tried gave me a syntax error :(
 
That's OK. A lot of APL development is through experimentation.
 
3:24 PM
[having another think]
[think failed]
 
@matt You described it very well here
@Adám And this is quite a good hint, try to have at least one more think :)
 
RGS
@matt please note that one thing is to understand what you want to do and then another thing is how to do it :)
 
yeah @RGS I've realized that by now :)
[think #3]
 
RGS
trying a couple of different things in the interpreter (or wtv you are using to run APL code) is perfectly natural... also don't forget to check the small pieces that compose your possible solutions are acting as they should when taken apart
 
sigh nothing
 
3:29 PM
@matt Start with just this bit: (length of array) (length of array - 1)
 
RGS
@RichardPark +← 1
 
too early for APL :/
leaves
 
RGS
@matt it is never too early to learn :P Can you crack RP's suggestion?
 
@RGS sometimes it is
like right now
 
@matt If you haven't quite left yet, btw I mean you should ignore any indexing and just write an APL expression to give (length of array),(lenght of array-1)
@matt But it's also perfectly fine to go away and come back
 
3:34 PM
it's just too early.
 
@matt (If you're OK with it), how about 1 2 3 4…length of array?
 
[throws apple away]
 
RGS
Did matt leave for good, now?
 
I doubt it. APL is addictive.
 
too addictive
 
RGS
3:37 PM
Also, I find it amusing that my solution (with the [] and the built ins you were hinting at) always needs a minor tweak, regardless of the ⎕IO setting
 
I have no idea what any of that means
 
@RGS If only ⎕IO could be 0.5, it'd "just work".
@matt Don't worry, that's master-class level.
 
@matt Don't worry it's magicians code speak so we don't give you the answer :P
 
@matt Btw, you shouldn't be discouraged. We were all new to APL once. Richard and RGS learned it quite quickly.
 
@RichardPark hmm
 
3:40 PM
@matt Are you still looking for the index generator?
 
yep.
 
@matt lol
Can we give him this? If you glide your mouse over the language bar you should find it
 
@matt Oh, I'll give you that: ⍳N
 
@Adám yes of course they did
 
It took much longer for me. From I started with APL until I was really comfortable with it was over a decade. Some people learn slowly.
 
RGS
3:42 PM
@Adám yes... it just upsets me, you know? Now I have ⎕IO←0 by default, like a good mathemagician. So I wrote the solution and noticed I needed a little nudge to make the indices work. So I thought "oh wow, I cannot believe this is one situation where ⎕IO←1 just works better", so I changed ⎕IO with my hopes up! Only for them to be crushed :D
 
more "magician code speak"?
 
Yeah.
 
RGS
@matt please notice that "RGS learned it quite quickly" is a subjective statement! Supposedly this is an easy task and I also needed a couple of tries to get everything correct :P
 
@matt Ignore us and just get integers (1 2 3 4... lenght of array)
 
@RGS But if you define an and indexing that fakes ⎕IO←0.5 it will work.
 
3:44 PM
@RGS While the "task" is simple to explain, I think it's quite a good hook into what "array thinking" is like
 
leaves, for good this time
 
RGS
@RichardPark definitely!
@RichardPark that is more or less how I define recreational maths! problems that are simple to explain but need good thinking to figure them out
 
@Wezl Your chat profile's "about"… Is that lisp+APL+C?
matt'll be back. Once you bite into the APL, it is hard to let go.
 
@RGS It's a double-edged sword unfortunately. For example, many of the contest problems have this "toy problem" vibe to them - but if you want people to attempt something more realistic you have to give lots of context and generally the problem might be simpler but require more reading and interpreting
 
@Adám Yup!
 
3:49 PM
CAPLisp
 
throws ALL the apples away
 
apl/⍨←0
 
@matt haha! welcome to the cult
 
I'd rather not join a cult, thank you very much
 
@matt Well I guess it's not technically one in that we won't harass you if you decide to leave (for good this time ;))
 
3:52 PM
that's a relief
but why call it a cult if it isn't a cult?
 
Tongue-in-cheek. The APL community does seem more personal, tight-knit, and long-living than that of other programming languages. APL programmers often self-identify as "APLers".
 
most of them anyway
 
That said, there's no central organisation (in fact, APL is less uniform across implementations than most languages) and people have successfully left while still keeping cordial with those that stayed, so no, it isn't a cult.
 
One thing I find appealing is the curious mix between ancient and hyper-modern.
 
wdym?
 
3:58 PM
The array aspect of APL maps very neatly onto today's processors.
But it took Dyalog 18 major releases to be able to execute a text file :)
 
just more magician language
 
@xpqz And that was only after many many years of its predecessors before Dyalog 1.0.
 
should probably leave so as not to make you go crazy
 
@matt Intel the other day announced array-oriented instruction set extensions. That will super-charge APL I expect.
 
w h a t
 
4:01 PM
Basically all machine learning and signal processing is based on vectors.
Machine learning is the latest shiny.
 
w h a t
 
So APL seems ideally suited to a "come back" given the kind of data processing that's happening right now.
 
this is very CAWMFUHSINK
 
@xpqz eh, currently it only supports 8-bit ints and 16-bit bfloats, and only has one instruction - dot product
 
@xpqz I think the newest announced ones are for low-precision floats, which APL doesn't use. The important instruction set is VBMI, which is in Ice Lake.
 
4:03 PM
@xpqz Yup, and after half a century the funny characters are finally not an issue any longer.
 
funny characters = magician language
 
Mathematics uses funny symbols too.
 
But I would say even Dyalog doesn't use SSSE3 to the full extent, and that's 14 years old. It's more an issue of implementers understanding vector extensions than the extensions supporting APL operations.
 
what is happening
maybe I should leave
 
@Marshall Does k/q use vector instructions?
 
4:07 PM
@xpqz Shakti K does.
 
@matt I can only speak for myself as a newbie like yourself - learning APL is a rewarding pursuit, but the initial slope of the learning curve is steep for sure. Stick with it.
 
rewarding? how so?
 
As an intellectual exercise. Seeing a whole page of python/js vanish into 20 symbols of APL.
It's a super-power.
 
@xpqz 20‽
 
Not an exact measure. Some variance :)
 
4:10 PM
also @Adám how do you type interrobangs?
 
@matt I have made my own keyboard layout that has it.
 
what is said layout?
 
@matt Here.
@matt Which OS are you on?
 
chromebook & ios13
 
Ah, right, you said so.
Ctrl+Shift+U,2,0,3,D should do it.
 
4:14 PM
‽ didn't know that trick existed!
 
with quite a bit of refactoring to how REPLs happen, yay
 
@xpqz Look here!
 
@Adám what about ios?
 
@matt Awkward.
 
@Adám Quite. Although that's pretty poor python, to be fair.
 
4:21 PM
@Adám ouch
 
@xpqz That may be, but the author felt confident enough about it to post an answer. Even a beginner in APL will write a very short solution there.
 
teleports all the apples into a volcano
 
My golfed python offer:
list({(x*y) for x in range(11) for y in range(11)})
∪∊(⍳11)∘.×⍳11
 
RGS
4:37 PM
@RichardPark I don't mind the "toy problem" vibe but honestly most of them don't even feel that toy-ish
 
@RGS To be sure, most of them are very good
 
RGS
Maybe one could try to figure out what "lots of context" one could give and then make several questions related to that
@RichardPark I don't think I parsed the English correctly; can you reword that, pls?
 
seems I always find a way to come back
 
@RGS Even though I said what I said earlier, I do think most of the contest problems are appropriate
 
RGS
@RichardPark Ah thanks, SoMeTiMeS i CaN't EvEn EnGlIsH
 
4:45 PM
@xpqz ∪,∘.×⍨⍳11
 
tacit for fun & profit.
 
RGS
or {l←≢⍵⋄(l⍴1 ¯1)⎕C¨ ⍵}'I can't even English' for an approximate APL version
 
@RGS You have a better excuse than I do
 
@RGS (⊢⎕C¨⍨¯1*⍳∘≢)'I can''t even English'
 
5:01 PM
Oh cool, BQN's Prefix lets you do all the upper triangular products. ∾(⊢×1↓↑)1+↕3 gives [ 1 2 4 3 6 9 ].
Eh, that was lower and ∾(⊢×≠↑↓)1+↕3 is upper. Switch ≠↑ to 1↓ to leave out the self-products.
 
teleports an apple to everyone :)
 
5:17 PM
@matt Did you want the answer to your Reverse 'abcd' problem or?
 
@RichardPark I recommend more guidance rather than giving it.
 
@Adám Yeah I get that, was just curious as to whether it was being dropped until later
 
@Adám considering that nothing I've thought of has worked...
 
5:37 PM
@matt I can guide you through it step by step. Ready?
 
02:00 - 18:0018:00 - 23:00

« first day (1253 days earlier)      last day (1402 days later) »