« first day (483 days earlier)      last day (2164 days later) » 

ngn
12:00 AM
it's the only int value that has no negative, so it's dangerous and practically useless
indexing an int list out-of-bounds returns 0N
 
@ngn afaik, J only cares about prototypes when it needs to fill, and there are only three fills (0s, spaces, and "aces" which are enclosed 0-length vectors).
 
ngn
also, it has some special uses like 0N 2#x
@Adám oh... so that's where Arthur got his newest ideas from, hm...
 
@ngn And is 0N=0?
 
ngn
@Adám no
 
@ngn What is ∘.≡⍨0N 0 0.0?
 
ngn
12:03 AM
@Adám 0N is just 0x80...0 in C
@Adám it's like 63(2*)/1 in k or 2*63 in APL (if it had proper integers)
@Adám so, your expression would be a~/:\:a:(0N;0;0.0) in k
0N definitely does not match 0
0 does not match 0.0 in kona, and that's how I'd prefer it, I'm not sure what Arthur does for 0~0.0
 
@ngn What is ~?
 
ngn
@Adám ≡
 
@ngn I see, so ~/:\: is match each on the left to each on the right?
I.e. ≡⍤0 15
 
ngn
@Adám yeah, "outer product" is "each-right each-left" in k
 
Wait ... what is 0N?
 
ngn
12:09 AM
@Adám I'm not sure, I think something like ≡⍤0 1⍤1 0
@Zacharý see above
 
Ah.
 
@ngn That doesn't hold for higher-rank arrays.
 
ngn
@Zacharý k has nulls for every type
@Adám k has only rank-0 and rank-1 arrays :)
 
oK then, that seems weird.
 
@ngn No, it just treats rank and depth as the same.
 
ngn
12:12 AM
@Zacharý it's useful when you're processing a huge array and you don't want to stop for errors - you get "nulls" in the result instead
@Adám true - depending on the point of view, in any case it's simpler
 
But for every type though, is there a reason for that?
 
@ngn Did I ever tell you that as a kid I dreamt of unifying rank and depth? I knew nothing about K or JavaScript or anything the like.
 
ngn
though I admit some mathematical beauty is lost in the pursuit of practicality
 
@ngn APL is an executable mathematical notation. K is an implementation language for very large economical databases.
 
ngn
@Zacharý if null was a separate type, like ⎕null in APL, that would blow up unitype arrays into generic arrays
@Zacharý example, suppose you're indexing a with b: a@b in k, and one of the indices is out of bounds
@Zacharý if a is an int vector, normally the result would be an int vector too
but with null as a separate type it would "blow up" into a generic array of pointers to other arrays
 
12:16 AM
Ah, that makes some sense
 
ngn
if null is an "int null", however, it would remain a tidy int array, nicely packed
 
@Adám I've had that dream (in regards to APL style languages, I knew of JavaScript) as well before I knew of K.
 
ngn
you guys dream of that... seriously? :)
 
@ngn Not as nightmare, as thoughts, and experiments on paper as to how it would work.
But I seem to get stuck at 0 1⍴0.
 
ngn
@Adám you don't understand why it should be 0#,0N?
 
12:24 AM
@ngn Why isn't it 0⍴⊂,0 i.e. 0#,0?
 
ngn
2 1#0 is (,0;,0), then 1 1#0 is ,,0, then 0 1#0 should be 0#,0N, seems correct
@Adám there's no such thing, it's the same as 0#,0N
I mean, a length-0 generic array's prototype always consists of nulls
 
@ngn Ah, in that case, sure, seems right.
 
ngn
by the way, monadic ,x in k is like ,⊂⍵ in APL, not ,⍵
 
@ngn That's what I wrote.
@ngn Is the null-element for character arrays ⎕UCS 0?
 
ngn
@Adám (for the sake of anybody else reading this)
 
12:27 AM
I'd think not.
 
ngn
@Adám it's space, " "
 
@ngn Actually, I wrote ⊂, but I think it actually should be ,⊂,⍵
 
So ... it's sorta like a prototype but not really?
 
Or maybe even ,⊂1/⍵
 
ngn
@Zacharý the idea is, if you have a matrix and reshape it with 0# and then reshape it with n# it should still remain a matrix
 
12:29 AM
@ngn Why would the numeric types have special null-elements while the character type as a random 32 as null?
 
ngn
matrix, i.e. vector of vectors
@Adám I don't know :)
 
Ah, oK (I'll keep using that), I think I understand now.
 
@ngn In retrospect, I'd probably have made APL's character fill be ⎕UCS 0. Makes simple sorting saner.
 
ngn
in kona: 1#0#0 returns ,0
 
@ngn Why not ,0N?
 
ngn
12:31 AM
@Adám again, I don't know
 
I have a bad feeling about this.
 
ngn
let's see what oK does...
@Adám yeah, I might be wrong
 
@ngn My K gives ,0N
 
@Adám But it makes ascii-art and everything display based ludicrous.
 
ngn
oK returns ,() - it has adopted some k6 ideas
@Adám what is your k?
 
12:33 AM
How many K distributions are there?
 
@Zacharý J has a "Fit" operator that allows you to temporarily use any fill of your choice.
 
ngn
@Zacharý from Arthur there's the freely downloadable (32-bit for non-commercial purposes) k4, there's the abandoned k5, and there's the latest and greatest k6
 
@ngn K4 ^
 
ngn
@Zacharý there are two bloated and slow free implementations - kona (C) and oK (JS)
 
@ngn Not to mention K7 WIP.
 
12:36 AM
And they all seem to be pretty popular among K users (compared to, say, GNU, NARS, and Win for APL)
Unless of course PPCG isn't really a representative sample of APL users (probably isn't)
 
ngn
@Zacharý I'm not sure relatively how popular they are, I'd guess k4 is still by far the most commonly used among banks and HFT traders
@Zacharý definitely isn't
 
@Zacharý I don't think anyone uses NARS in production. I have no idea about GNU, but I suspect not. APL+ and APL2 are probably still the big two in production "out there", but with more and more coming to Dyalog as IBM has gone silent, and APL2000 only release updates for the sake of releasing updates.
 
ngn
@Zacharý CMC: can you guess what !!0 returns in k? (the equivalent of ⍳⍬ in APL)
 
The equivalent of ?
Why did you edit to reply to a post below it?!
 
ngn
@Zacharý by mistake...
@Zacharý hm, no
 
12:44 AM
@ngn ,0N?
 
Should we add K to the tags list now?
 
@Zacharý ⍳⍬ doesn't give in APL.
 
ngn
@Adám that would make sense if k's ! was exactly like APL's ⍳
 
I know, if it worked as in APL, there wouldn't be much point in doing a CMC.
 
ngn
 !2 3
(0 0 0 1 1 1
 0 1 2 0 1 2)
 
12:46 AM
@Zacharý I already wanted to when I added J, but I knew nothing of K then, and ngn didn't hang out here.
 
@ngn o_O
 
@ngn OK, it counts to 2×3 in base 3.
 
ngn
 !,2
,0 1
 !!0
0#,,0N
(according to my interpretation)
 
So by that logic it should count to nothing in base nothing.
 
ngn
@Adám yes :)
 
12:48 AM
@ngn Right, that's a 0×0 matrix of nulls?
 
ngn
@Adám 0x1
 
@ngn But why does it have one "number" (i.e. one column)? Shouldn't it be zero columns?
 
ngn
my reasoning is: if x is an int list, then #!x is #x and #*!x is */x
 
@ngn In K4 it gives some weird type symbol:
 
ngn
in the case of x:!0 we have #!x as 0 and #*!x as 1 because the product of an empty list is 1
 
12:52 AM
  !0
`long$()
  !!0
`long
 
ngn
I can understand the first one: $ is typecast
I'm not sure what the second one means...
do you, guys, think my reasoning is correct? there should be 1 column because the product of an empty list is 1
 
@ngn I need more data. What happens with 3-element arguments to !? What about !2 0 and !0 2 etc.?
 
ngn
@Adám !2 3 4
I don't support 0s yet
 
@ngn Ah, I misunderstood before.
@ngn So it is {⍵⊤⍳×/⍵}.
Interesting, btw, that it has the same "transposure" as APL.
 
ngn
@Adám exactly
@Adám that's because it's more efficient to have a few long lists than many short lists
 
12:58 AM
@ngn Yeah, in that case, !!0 should give 0 1#0
 
ngn
I'm confused by my own implementation now :)
should 0 1#0 be 0#,,0N or 0#,0N
 
@ngn This is very interesting. So now we have three competing extensions of to multi-element arguments. APL does Cartesian coordinate mapping, J does fill of the product, and K does mixed-base counting.
@ngn Whichever one corresponds to 0⍴⊂,0 so I guess 0#,,0N
 
ngn
@Adám so it's 0#,,0N, I was wrong about 0 1# before
 
@ngn I find it way easier to reason about high-rank arrays than deeply nested vectors.
 
ngn
@Adám for 0-length dimensions I agree
@Adám other than that, I guess k a bit uglier but much simpler
 
1:07 AM
@ngn I agree with your judgement. My childhood vision of unifying them was more the other way around; merging nested arrays into high-rank.
It was allowing arrays to be ragged by using nested shapes. E.g.
 
ngn
I feel so stupid. Of course: 0N is a scalar, ,0N is a vector, ,,0N is a matrix... what was I thinking before
@Adám what do you mean "merging nested into high-rank"... ?
 
      3 4⍴⍳12
1  2  3  4
5  6  7  8
9 10 11 12
      3 (4 2 4)⍴⍳12
1  2  3  4
5  6
7  8  9 10
Where shape would be subject to something akin to scalar extension, so that 3 4⍴ really means 3 (4 4 4)⍴
 
ngn
@Adám ah! you've shown that before... :)
 
That'd be pretty neat syntax (That might not be the right word), regardless of rank-or-depth
 
ngn
@Adám that would be a compatible extension to x#y
 
1:12 AM
@ngn And for too…
 
ngn
@Adám well... APL arrays can't be ragged
so 3 4⍴ is not quite the same as 3(4 4 4)⍴
 
@ngn No but 3 (4 2 4)⍴ could fill three arrays of the given lengths with the given data. But the 3 is a bit redundant then. (⊂4 2 4)⍴ should be enough.
@ngn Yeah, in K the extension would be natural, and quite neat. I like it.
 
ngn
@Adám what about (4 2 4)3⍴⍳12 ?
 
For Phase II (TotalEnergy) ... it might just be me being tired, but wouldn't the products of two adjacent elements of 5 5⍴¯1 1 always be ¯1, thus the answer be NOT 0 (for the first test case)? Sorry to derail the conversation. Also, ¯1ׯ1 is 1×1, so shouldn't test cases 2 and 3 give the same answer?
 
ngn
or: (4 2 4;3)#!12
 
1:21 AM
@ngn Probably not doable, but (4 4 2)4⍴⍳12 or (4 4 2;4)#!12 could be:
1  2  3  4
5  6  7  8
7  8
@ngn Well, you could argue (4 2 4;4)#!12 should be:
 
Ah, the semicolon syntax
 
… nah, wait a minute, this won't work.
@Zacharý Huh? In K it is a syntax, in J a function, in APL it is juxtaposition — most similar to K, but K requires parens.
@ngn The expansion can only work relative to what's on its left.
 
DIdn't see that that was in the K code ... whoops
 
ngn
it's certainly neat, but it's probably not worth implementing, I can't think of good use cases for this
and it can always be worked around with reshape-each
 
room topic changed to The APL Orchard: Learn and teach, questions about both golfing and general coding. For chatbot info, enter: )about [apl] [array-manipulation] [j] [k] [tips]
OK, I need to go to bed. Thank you guys for distracting me from the horrors of the real world.
 
1:31 AM
You're welcome :)
 
ngn
he's gone, open your IDEs and let's write some java now! :)
 
No, don't even joke about writing Java :P
 
@Zacharý I would abandon APL in favour of Java if that would rescue the poor children in Guatemala.
 
@ngn If you want to make clear it's a joke: replace Java with PHP :)
 
ngn
@Zacharý too late, can't edit
 
 
9 hours later…
10:40 AM
Roger's latest blog post examines the #Dyalog #APL quicksort implementation and grade function. Read it at https://www.dyalog.com/blog/2018/05/is-it-sorted/
 
 
2 hours later…
1:08 PM
TIOBot logged in!
 
@DyalogAPL welcome back
 
@DyalogAPL I bet you suffer from extreme amnesia.
5
#tio alias view
 
@Adám
Command Aliases:
⋄ -> #TIO apl {0::⎕←⊃⎕DM⋄%args%}(⎕NS⍬).⍎'⎕CY''salt''⋄⎕SE.UCMD''←box on -f=on -t=tree''⊣enableSALT⋄⍬'
⍞← -> #TIO do apl-dyalog {0::⎕←⊃⎕DM⋄⎕←%args%}⍬
] -> #TIO apl {0::⎕←⊃⎕DM⋄⎕←⎕SE.UCMD'%args%'}(⎕NS⍬).⍎'⎕CY''salt''⋄⎕SE.UCMD''←box on -f=on -t=tree''⊣enableSALT⋄⍬'
⎕← -> #TIO apl {0::⎕←⊃⎕DM⋄⎕←%args%}(⎕NS⍬).⍎'⎕CY''salt''⋄⎕SE.UCMD''←box on -f=on -t=tree''⊣enableSALT⋄⍬'

Language Aliases:
apl-dyalog -> [apl]

Message Aliases:
 
@DyalogAPL OK, not so bad. Let me fix you, poor thing.
#tio alias message )help %handle% Dyalog APL Language Elements
 
@Adám Added alias for )help
 
1:11 PM
#tio alias message )ref %handle% Dyalog APL Reference Card
 
@Adám Added alias for )ref
 
#tio alias message about %handle% You can evaluate a single line of APL by typing it into chat prefixed by ⍞←. Use ⎕← instead for boxed display and multi-line results and use ⋄ instead to silence the first statement. Use ] to call user commands. Do not use markdown, but fixed-width (4 initial spaces) is fine. Commands: )lb for language bar, )help for table of language elements, )docs for full documentation, )ref for PDF reference card, )idioms for idiom list.
 
@Adám Added alias for about
 
#tio alias message )lb %handle% ← +-×÷*⍟⌹○!? |⌈⌊⊥⊤⊣⊢ =≠≤<>≥≡≢ ∨∧⍲⍱ ↑↓⊂⊃⊆⌷⍋⍒ ⍳⍸∊⍷∪∩~ /\⌿⍀ ,⍪⍴⌽⊖⍉ ¨⍨⍣.∘⍤@ ⍞⎕⍠⌸⌺⌶⍎⍕ ⋄⍝→⍵⍺∇& ¯⍬∆⍙Install…
 
@Adám Added alias for )lb
 
1:12 PM
#tio alias message )idioms )idioms -> %handle% Dyalog APL Idiom List
 
@Adám Added alias for )idioms
 
Oh, speaking of help: shouldn't the fixpoint help for be added to RIDE? Or is it an update I'm missing?
 
@DyalogAPL Hello?
#tio alias message )idioms %handle% Dyalog APL Idiom List
 
@Adám Added alias for )idioms
 
@Zacharý Huh, good point. It is only mentioned very briefly:
     1 +∘÷⍣= 1            ⍝ fixpoint: golden mean
1.61803
 
1:16 PM
It isn't showing up at all on RIDE (at least for me)
 
@Zacharý I'm up-to-date which includes a major language bar overhaul.
 
Ah, okay
 
@Zacharý Email sent to involved parties.
 
@Adám maybe Zacharý doesn't pay £150/year for updates...
 
(I use the student edition; I'll update eventually)
 
1:26 PM
@EriktheOutgolfer RIDE is FOSS.
 
@Adám is it really RIDE that contains that though
 
@EriktheOutgolfer It is imported.
 
Ven
2:07 PM
.oO( Memorizing the 1499 idioms is the best way to leave the beginner's plateau )
 
@Ven TBF, there are some duplicates.
@Zacharý They say that the tool tip is already huge.
 
2:36 PM
⎕←5 5⍴¯1 1 ⍝Just checking something
 
@Zacharý
line(1,0) : error AC0505: error (SYNTAX ERROR) executing line "{0::⎕←⊃⎕DM⋄⎕←5 5⍴¯1 1 ⍝Just checking something}(⎕NS⍬).⍎'⎕CY''salt''⋄⎕SE.UCMD''←box on -f=on -t=tree''⊣enableSALT⋄⍬'"
                                                               ^
Complete: 1 error.
DOMAIN ERROR: There were errors processing the script
 '#'⎕NS ⎕FIX'file:///home/runner/.bin.tio.dyalog'
∧

Real time: 0.040 s
User time: 0.007 s
Sys. time: 0.017 s
CPU share: 61.04 %
Exit code: 0
 
⎕←''
 
@Zacharý
 
⍞←5 5⍴¯1 1
 
@Zacharý ¯1  1 ¯1  1 ¯1
 
2:37 PM
⎕←5 5⍴¯1 1
 
@Zacharý
¯1  1 ¯1  1 ¯1
 1 ¯1  1 ¯1  1
¯1  1 ¯1  1 ¯1
 1 ¯1  1 ¯1  1
¯1  1 ¯1  1 ¯1
 
Okay, so it's just comments then
 
@Zacharý Yeah, you can't have comments due to the one-liner nature of the chat bot. However:
⎕←5 5⍴¯1 1 ⊣ 'Just checking something'
 
@Adám
¯1  1 ¯1  1 ¯1
 1 ¯1  1 ¯1  1
¯1  1 ¯1  1 ¯1
 1 ¯1  1 ¯1  1
¯1  1 ¯1  1 ¯1
 
Okay.
 
 
3 hours later…
5:29 PM
Nobody has asked for an APL lesson for today.
 
ngn
@Adám have you prepared something?
 
@ngn No. I've run out of subjects. Any ideas?
@ngn I was thinking of some methods to find solutions in APL, but it isn't very structured, and I probably can't fill 90 mins with it.
 
ngn
@Adám it doesn't need to be structured, if you ask me, anything golfy is always welcome as far as I'm concerned
 
@ngn Not for golfing per se (there's the ) question for that. I was thinking of when you have a problem, and simply don't know how to solve it in APL, though you may know how you would solve it by hand.
 
@Adám hm, I've just thought of something
 
5:43 PM
@EriktheOutgolfer Yes?
 
(although time is over for a lesson now...)
 
@EriktheOutgolfer Dosn't prevent us from spending 1.5 hours discussing on-topic matters.
I can tell a funny story from some work I did today.
 
@Adám well, remember this? I don't know if ways to convert ISO-Extended-APL code to ISO-APL should be a lesson or a list, but, eh, at least I gave this a try :P
 
I'd be kinda here for a lesson today. I'm currently multitasking my work on my final project for college and writing a novel, one APL lesson (or funny story, I don't mind) on my secondary monitor couldn't hurt.
 
@EriktheOutgolfer Ah, if only I knew. That is basically the holy grail of APL.
 
5:47 PM
@Adám that's the other thing I was afraid of, does anybody even know
 
ngn
@J.Sallé ... writing a novel ... because everything else doesn't seem challenging enough :)
 
@ngn well I find it to be the easiest task of the three. Whenever I run out of ideas I can just go back to work on my final project :p
 
@EriktheOutgolfer Roger wrote an article about interpolation. It would be fairly straightforward to loop, but he old-school APL only.
 
@Adám looping is straight-forward anyway; → anyone?
 
@EriktheOutgolfer And here is another one that addresses the subject directly.
 
5:55 PM
@Adám good job Roger
 
@EriktheOutgolfer roger@ (hint, hint…)
 
@Adám sorry, no time to make an insightful letter of appreciation rn :/
lots and lots of studying going on
 
6:16 PM
> is a 2-by-2 matrix of the two points
provides 3-by-2 matrix as
honestly, separating M into two matrices would be clearer
 
6:38 PM
@EriktheOutgolfer You know you can comment there, right?
 
@Adám would it get noticed?
 
@EriktheOutgolfer I think he gets a notification. If not, I can tell him. Or you could just email him.
 
7:03 PM
@H.PWiz Hi there.
 
@Adám Hello!
 
@H.PWiz How would you feel about writing a book(let) together?
 
@Adám I think I need a little more information
 
@H.PWiz :-) I've been toying with the idea to make a book based on the chat lessons. Something like APL a day — the programmer's introduction to APL in 24 hours
 
I'd be happy to contribute, although I can give no garuantees on my writing skill
 
7:08 PM
@H.PWiz While English is your first language (I presume), we can always get someone to do a review of the language later. The main thing is the content. And as an active participant in those very lessons, you'd have a nice starting ground.
 
@Adám Yeah, it sounds interesting, I think
@Adám Can I edit a tacit function with )ed?
 
@H.PWiz Great. Let's have a look at that first thing this summer.
@H.PWiz Not without tricks, but we are thinking about ways to do that. Meanwhile, you can use ]defs to produce the current definition (including the assignment) and then just edit the line and press enter.
@H.PWiz A trick I came up with last week is to use a tradfn in a very not traditional way:
∇ Avg←Avg
  Avg←+⌿÷1⌈≢
∇
@H.PWiz This makes a late binding tacit function that you can edit with )ed, save with ]save etc.
 
@Adám I guess you could also put it in a namespace
 
@H.PWiz Yes, if you're anyway organising your code that way. Otherwise it becomes a bit clumsy to call. I've seen this ugly hack:
:Namespace Trains
  ##.Avg←+⌿÷1⌈≢
  ##.PlusMinus←+,-
:EndNamespace
Every time you'd close the editor, the two functions will get redefined in the parent namespace.
 
 
1 hour later…
 
ngn
hey, this was related to apl!
 
Not really.
 
@ngn Related to, but the main topic was surely linguistics.
 
who said finding the main topic is always easy?
 

« first day (483 days earlier)      last day (2164 days later) »