« first day (1944 days earlier)      last day (700 days later) » 

2:27 AM
@RomillyCocking FWIW, I just realized you also wrote the MENACE in Dyalog article which I really enjoyed. I opened an issue about various typos and such if you’re interested.
 
 
6 hours later…
8:43 AM
CMQ: What would be your favourite uses for Select (X⊇Y), Depth ((f⍥k)Y and X(f⍥k)Y), and Hook (f⍛g Y and X f⍛g Y)? Models are:
Ⓓ←{0=⎕NC'⍺':⊃⌽,⍵ ⋄ 1≥|≡⍺:⍵⌷⍨⊂⍺ ⋄ ⍵[⍺]} ⍝ ⊇
Ö←{ ⍝ ⍥
    0::⎕SIGNAL⊂⎕DMX.(('EN'EN)('EM'EM)('Message'(OSError{⍵,2⌽(×≢⊃⍬⍴2⌽⍺,⊂'')/'") ("',⊃⍬⍴2⌽⍺}Message)))
    ncs←⎕NC↑'⍵⍵' '⍺'
    0 3≡ncs:⍺⍺ ⍵⍵ ⍵       ⍝   f⍥g Y
    2 3≡ncs:⍺ ⍺⍺⍥⍵⍵ ⍵     ⍝ X f⍥g Y

    1<≢⍴⍵⍵:⎕SIGNAL 4      ⍝ non-vec/scal: RANK
    1≠1 4⍸≢⍵⍵:⎕SIGNAL 5   ⍝ not 1…3 elements: LENGTH
    (c←⎕NS ⍬).⎕CT←1E¯14   ⍝ tolerant space
    c.≢∘⌊⌽⍵⍵:⎕SIGNAL 11   ⍝ not ints: DOMAIN

    ⍺←{⍵ ⋄ ⍺⍺}            ⍝ monadic: pass-thorugh
    a←⍺                   ⍝ [17941]
    k←⌽3⍴⌽⍵⍵              ⍝ r → r r r    q r → r q r    p q r → p q r
Ⓞ←{⍺←⍵ ⋄ (⍺⍺ ⍵)⍵⍵ ⍵} ⍝ ⍛
 
 
1 hour later…
9:52 AM
Depth is seductive, but on reflection, I am actually thankful that it wasn't available when I was learning. I suspect (conjecture, obv) the temptation would be to always deal in nested, rather than flat structures.
 
10:30 AM
@Adám I feel like the monadic behavior of select is redundant
can't Dyalog come up with something more useful :P
say, {⍵⍳⍵} sounds a bit nicer as the monadic overload to me.
 
@KamilaSzewczyk but would be a whole two chars shorter in trains than ⊃∘⌽!
 
can't tell if it's ironic or not
 
I can't either
 
Four characters shorter than ⊃∘⌽∘, plus more performant too.
@KamilaSzewczyk It was kind of by mistake that I even included the monadic form.
 
I feel like ⊒ from BQN could also be a nice monadic overload.
@Adám you can always have it as an idiom
⊃⌽ and ⊃⌽, is one already
 
10:36 AM
Yeah, but idioms don't really work well in trains. Would need to be a special case of and/or
@KamilaSzewczyk I don't think that pairing makes much sense.
 
i mean occurrence count.
    ⊒   2‿7‿1‿8‿1‿7‿1‿8‿2‿8‿4
⟨ 0 0 0 0 1 1 2 1 1 2 0 ⟩
or whatever was this BQN builtin that was really hard to port to APL...
 
I personally don't like idioms that improve the big O speed of a thing; makes it so you must know the idiom exists to be able to use it, and use it in exactly the way expected from you if you don't want to suffer an immense slowdown
occurrence count is dyadic
 
Yeah. How is that related to first/pick/select. All of these are are selective.
 
@dzaima are the docs wrong then?
i don't see dyadic application here
 
@dzaima Are you sure?
 
10:39 AM
@Adám the dfn is only one char longer and ⊃⌽, is already pretty idiomatic APL i'd say
 
@Adám no, i'm stupid
 
adding a built-in for it feels redundant.
 
@KamilaSzewczyk True. Again, I didn't actually intend to include the specific monadic form. It is the dyadic form which is being considered for inclusion.
 
so with the new Dyalog ⊇Y will error?
 
ok so both occurrence count and progressive index of have horrific APL impls: {1+o-(m⌿o←⍋⍋⍵)[⍵⍳⍨⍵⌿⍨m←≠⍵]} and {((≢⍺)⍴⍋⍋⍺⍳⍺⍪⍵)⍳(≢⍵)⍴⍋⍋⍺⍳⍵⍪⍺} respectively (from APLcart)
 
10:40 AM
@KamilaSzewczyk Yes, unless we give it meaning.
 
i still feel like these BQN builtins could be useful in APL.
 
@dzaima Yes, they belong together, and could well be a new primitive.
 
they could be useful, but they don't fit on the character
 
what would fit instead?
 
well, ⊃⌽ fits more, as it picks element(s) from the right arg along with ⍺⊇⍵ ⊃⍵ ⍺⊃⍵
 
10:42 AM
I often find myself working on pairs, and while it works on simple arrays, it feels wrong to do ⊃,k,⊢/ or ⊃,∘f⊢/ while ⊃,k,⊇ and ⊃,f⍤⊇ would work much better.
On non-simple arrays, ⊃∘⌽ is wasteful.
And then it isn't even "last" for high-rank arrays.
@dzaima Yup, last would fit very well into the pattern of (essentially) being the dyadic form with a default left element.
 
      f←⊢⊃⍨≢⋄g←⊃∘⌽
      'cmpx'⎕cy'dfns'
      v←?⍨10000
      cmpx 'f v' 'g v'
  f v → 2.2E¯7 |    0% ⎕⎕⎕⎕⎕
  g v → 1.7E¯6 | +684% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
i wanted to do something funny and i wonder if i accidentally misbenchmarked something
 
First major cell: ⊣⌿
Last major cell: ⊢⌿
First element: ⊃
Last element: ⊇
 
@KamilaSzewczyk no, dyalog just doesn't have ⊃∘⌽ as an idiom
 
I'd like having a dedicated glyph for last element.
 
      f←⊢⊃⍨≢⋄g←{⊃⌽⍵}
      cmpx 'f v' 'g v'
  f v → 2.1E¯7 |   0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
  g v → 3.3E¯7 | +54% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
 
10:46 AM
Huh.
 
lesson learned i guess
 
I would have expected g to be faster, but I suppose they both are so fast that the dfn overhead makes a difference.
      f←{⍵⊃⍨≢⍵}⋄g←{⊃⌽⍵}
      cmpx 'f v' 'g v'
  f v → 4.2E¯7 |   0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
  g v → 3.1E¯7 | -26% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
 
the ways of APL are unexplored
 
11:12 AM
curiously for me, train ⊃⌽ is slower than dfns:

f←⊃⌽ ⋄ g←{⊃⌽⍵}
⎕←cmpx 'f v' 'g v'
f v → 1.0E¯6 | 0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
g v → 2.3E¯7 | -78% ⎕⎕⎕⎕⎕⎕⎕⎕⎕
 
yeah, train ⊃⌽ isn't an idiom, so it just reverses & gets the first element
 
whereas {⊃⌽⍵} is treated as an idiom, I see
 
Well, the phrase ⊃⌽ inside the dfns is, yes.
 
for the uninitiated, how far does idiom detection and optimization go in array langs? I imagine ngn/k does something with *| also?
 
*| is ngn/k's only idiom
APLcart lists Dyalog's idioms
 
11:20 AM
@dzaima Does it work in tacit definitions?
 
i wonder why {(+/∨\' '≠⌽⍵)↑¨↓⍵} is an idiom.
 
 v:!100000
 \t:10000 *|v
0
 \t:10000 (*|)v
684
@KamilaSzewczyk presumably some customers did a lot of conversion between representing strings as rows of a matrix and a vector of vectors
 
magic incantations
 
it's the "inverse" of ↑list of strings without spaces
 
wow, so every idiom on APLcart is detected and optimized in Dyalog?
 
11:23 AM
@pitr no, just the ones with Fast:
 
It's LeviOsa, not LevioSA - if you modify it ever so slightly it stops working as intended
 
TIL, thanks!
 
@dzaima Ouch.
 
@Adám well, no worse than Dyalog, the industry leader :)
(i guess kdb or k9 is more the competitor, but one cannot test whether they interpret *| as an idiom so they're irrelevant)
 
12:34 PM
@dzaima You mean because it is against the T&C to measure them?
 
the fastest* real-time in-memory database
* - until you illegally benchmark it
 
@Adám well that and the fact you can't even get a binary of them
 
@Adám I get different results using Depth than those given on dfns.dyalog.com/n_Depth.htm when I test them.
 
@dzaima Wait, you can't?
 
      a ⋄ b ⋄ a(+Depth 1 2)b
┌───┬───┬───┐
│1 2│3 4│5 6│
└───┴───┴───┘
┌────────┬────────┐
│10 20 30│40 50 60│
└────────┴────────┘
┌───────────────────┬───────────────────┬───────────────────┐
│┌────────┬────────┐│┌────────┬────────┐│┌────────┬────────┐│
││11 21 31│42 52 62│││13 23 33│44 54 64│││15 25 35│46 56 66││
│└────────┴────────┘│└────────┴────────┘│└────────┴────────┘│
└───────────────────┴───────────────────┴───────────────────┘
 
12:40 PM
Yeah?
@xpqz Well, for one, there's a typo in my model above. Missing a ⍨
 
@Adám you yourself linked to kx.com/developers/download-licenses; and shakti doesn't have downloads either
 
You just have to email them to get it. Details to follow in next episode of Array Cast.
 
@Adám I just did 'Depth'⎕cy'dfns'
The dfns page has:
      a(+Depth 1 2)b
┌───────────────────┬───────────────────┐
│┌─────┬─────┬─────┐│┌─────┬─────┬─────┐│
││11 12│23 24│35 36│││41 42│53 54│65 66││
│└─────┴─────┴─────┘│└─────┴─────┴─────┘│
└───────────────────┴───────────────────┘
 
@Adám that's still pretty much equivalent "unavailable"
 
Remember when Dyalog had that (though it was an online form which would send the email for you)?
@xpqz Oh, sorry, I misunderstood your message as meaning a difference between Depth and my here-posted model.
 
12:44 PM
Rephrased: are the examples given in dfns.dyalog.com/n_Depth.htm correct?
 
Are there free tn3270 terminal emulator work with APL\360?
 
@xpqz Nope. a(+Depth 1 2)b should pair up simple arrays from a with arrays of simple arrays from b. So the first element should be 1 2+b
 
@Adám iirc it was an automatic process; whereas "if you wish to discuss licensing" to me sounds like it would involve discussion
 
@dzaima :) -- sounds like the most obvious interpretation to me, too.
 
@dzaima Nah, it was a real person answering — Karen was just really diligent about it. And KX's phrasing is probably to avoid promising anying.
 
12:50 PM
 
@Adám Right. So the code does the right thing, but the examples in dfns.dyalog.com/n_Depth.htm are not from running the code in dfns.dyalog.com/c_Depth.htm
 
@LdBeth I would expect every 3270-compatible terminal [emulator] to be able to speak with APL\360.
 
hmm, this was on sep 2017, whereas the first email about "a free personal non-commercial 64-bit Linux licence for Dyalog" I received is from may 2018; what was I using for those 8 months?
 
@Adám At least not with c3270 or wc3270 I tried.
 
Odd. It should essentially be the same as z.
 
12:55 PM
oh right wasn't there something like dyalog 14.0 being available without having to register?
 
Yes, but that was Windows only.
 
aight now to find when I switched to linux
 
@LdBeth What is this?
Announcement: Dyalog is getting closer to opening registration for Dyalog '22 — take a look at the workshops on offer to help develop your knowledge and skills in Portugal this October.
 
I downloaded Linux Mint's iso on apr 2018; so I was using windows 14.0 until I couldn't. Having to register successfully dissuaded me to do so until I couldn't :)
 
@Adám It is c3270 connected to VM/CMS running on Hercules wiki.livingcomputers.org/doku.php?id=vm_cms_survival_guide
 
1:04 PM
@dzaima (I think there may even have been a period of me booting back into windows to use APL, just to avoid having to register)
 
It turns out APL input is not a commonly supported feature even in commercial tn3270 emulators. And some of the commercial ones that confirmed has APL support are not licensed to individuals.
 
@dzaima (and by that point I was hooked to APL! If unregistered 14.0 wasn't available when I first found it, I probably wouldn't have bothered touching APL at all)
 
@xpqz Well, I'm not sure the code does the right thing either. F⍤k doesn't add more rank when k asks for more than there is. I'd think F⍥k shouldn't add more depth when k asks for more than there is. What do you think?
 
1:24 PM
I think I would have expected a (+Depth 1 k) b to be an error if k>≡b. But my expectations are frequently wrong.
Or, similar to rank, perhaps treat that case as "max depth"
The dfns version, trying it with a larger depth, e.g. a(+Depth 1 5)b is definitly a surprising behaviour.
 
Yeah. That uses a very early model, while I was still experimenting with the concept. And I think the notes' results reflect an even earlier concept.
Heh, the test script is identical, but with the correct results (per the definition).
 
 
6 hours later…
7:33 PM
I am starting to feel like going back to Dyalog 18.0, because using /usr/bin/dyalogscript means going through all my code and adding ⎕← everywhere to see the output, and piping files to dyalog has its own problems (either I pipe stderr to devnull and don't see errors, or i don't pipe and see the whole repl output including the code I piped).
Dyalog 18.0 worked perfectly, I could use my editor of choice and run the code using dyalog -script. I feel like I am missing something, am I using a wrong work flow? Is everyone using repl to iterate on existing code?
 
@pitr Needing ⎕← for output is a really good thing, as it makes it easy to identify places that print, and you don't have to worry about results of code that you run for their side effects.
 
I do agree with that, it makes things clear, and still beats writing "print(". But it feels like the code is being polluted with ⎕← especially for short expressions like ⍳9 is now ⎕←⍳9
 
Ah, I see. Yeah, people tend to use a REPL for iterating on existing code.
The developer in charge of the scripting is currently in the middle of some planning meetings, but I will take up with him the possibility of enhancing 1010⌶ (or something similar) to enable printing results by default.
 
@Adám I see, could you clarify how repl is used in such scenarios? Let's say yesterday I wrote 10 functions and used them to get an answer. Then I deleted repl history/log/etc; or maybe afterwards I was working on another problem. Today I realize I made a mistake in one function, and I open repl. I don't have the code anywhere in a separate editor, I can't scroll up to find bits and pieces of code I wrote, potentially finding the wrong iteration of a function.
@Adám thanks!
 
7:48 PM
@pitr I'd start with ]link # /somewhere/task1 and then every function I create or edit using the editor gets automatically saved as a text file in that location. If I define things straight in the REPL, I can do ]add myFun to write it to disk.
 
gotcha, and then you ]load it later if you need to change something?
ooh a text file per function, like this? github.com/romilly/o-x-o/tree/master/menace/apl
 
@pitr No, you just ]link # /somewhere/task1 again later.
]link establishes a link between the workspace and a directory.
@pitr Yes, exactly. That was created using Link.
This also allows you to have multiple things open at once: ]link task1 /somewhere/task and then ]link task2 /elsewhere/task2 lets you do task1.myFun and task2.MyFun without them interfering with each other.
# is the root namespace, much like / is the root dir.
 
@Adám I see, thanks, that clears things up. Interesting that workspaces+repl is the most common workflow, I thought it was a relic of the past at this point. I prefer a single text file (ie. diff-able and allowing for a quick overview) per task shown in a separate window/tab in my editor of choice. Dozens of 20 byte files or binary .dws goes so against it, that I feel like I am fighting the system.
 
@pitr no no, by "workspace", I meant the temporary one that's open in the REPL, not a saved binary blob — that should only be used for delivery (of an application or an error report).
 
8:04 PM
yeah I understand that, but these are all workspaces, temporary or otherwise
 
The workspace is then just the computer's working memory. You have to have things in RAM to work with them :-)
Btw, you can have multiple things in a single text file, either straight there, or packaged in a namespace. Once you've created the link, try )ed ⍟mynamespace and then populate the area inside the :Namespace mynamespace:EndNamespace
Here is an example of lots of small functions in a single namespace file.
 
8:16 PM
ok so there's quite a few ways to get a repl flow working, the namespace looks especially good. But honestly I feel like it doesn't really offer anything over editor+dyalogscripts, I'll just add ⎕← everywhere
the only thing I'd recommend is maybe make "print by default in scripts" a setting in ~/.dyalog/dyalog.dcfg
 
That'd not have an effect. One of the issues we solved with the scripts was the influence from global settings. These scripts ignore such, so you know exactly what your code will do. However, we might be able to support a setting you can add to the top of the script, be it as APL code or a command line param.
 
9:07 PM
oops I meant in a config file passed through ConfigFile=
 

« first day (1944 days earlier)      last day (700 days later) »