« first day (1778 days earlier)      last day (51 days later) » 
00:00 - 19:0019:00 - 00:00

adr
12:28 AM
@xpqz Yes I did! Thank you. I was wondering how you got around using thorn to format your result and had a hunch it might have something to do with those settings (incidentally, I later realized all the settings are linked in the Primer section of tryapl.org).
 
 
5 hours later…
5:10 AM
@Adám how do I set ]box on -trains=parens permenantly
(windows ide)
 
 
1 hour later…
6:30 AM
/⌿ work on the last and first axis right (when used as reduce)?
how do i reduce on other axis?
rank?
 
 
2 hours later…
8:13 AM
@PyGamer0 Session>Save
@PyGamer0 Yes, either with rank or /[axis]
 
 
1 hour later…
9:17 AM
0
Q: What is the space-time complexity of the scan operator in APL?

Adam NathanTypically scan, both left and right variants, are O(n) in both space and time. However it seems that APL's \ operator is like scanl but seems to behave differently in that it is right associative and runs over the array each time, making it O(n^2). For example, nums ← 10?10 ⍝ 1 7 4 5 10 3 9 6 2 ...

 
 
1 hour later…
10:32 AM
2
Q: What is the correct approach to efficiently perform a scanl in APL?

Adam NathanFollowing from my previous question, it seems that APL performs a scanl in O(n^2) but the compiler is smart enough to optimize for simple primitives. What then is the best strategy to apply \ to non-simple functions? Additionally, there are many cases when the right associativity does affect the ...

 
 
3 hours later…
1:15 PM
has anyone here tackled AoC Day 8's Part2?
 proc←{
     data←⍵
     data←data[(⍋≢¨data)]
     res←7⍴'⍬'
     res[1]←data[2]~⍥⊃data[1]
     res[6]←⊃∩/data[7 8 9 1]
     res[3]←⊃(⊃data[1])~res[6]
     tmp←{⍵~⊃data[2]}¨data[4 5 6]
     two←∊{⍵~⊃∩/tmp}¨tmp
     res[2]←two∩⊃data[3]
     res[4]←(⊃data[3])~res
     res[5]←two~res[2]
     res[7]←(⊃data[10])~res
     res
 }
I came up lately with a solver without using dynamic programming/backtracking.
 
Why not use dyadic ?
 
Thanks, I didn't realize that
 
Also ⊃~⍨/2↑data instead of data[2]~⍥⊃data[1]
data[4 5 6]~¨2⊃data instead of tmp←{⍵~⊃data[2]}¨data[4 5 6] assuming data is simple, otherwise data[4 5 6]~¨2⌷data
I have a feeling {⍵~⊃∩/tmp}¨tmp can be simplified too.
 
∊tmp~¨∩/tmp
 
1:41 PM
@LdBeth I bruteforced it
didn't bother doing it smartly :P
+/10⊥⍉segs⍳(↑1⊃¨data){⍺[;⍵]}⍤¯1⊢p[1⊃¨⍸segs≡⍥{(⊂⍋⍵)⌷⍵}⍤2⊢0 2 1 3⍉(↑⊃¨data)[;;p←pmat 7];] ⍝ part 2 dyadic transpose on a 4d matrix
 
2:00 PM
@LdBeth I'm not particularly proud of mine; wondering if anyone has a smarterer method github.com/rikedyp/Advent-of-Code/blob/main/Y2021/Day8_2.aplf
 
Yea brute force is feasible since the search space is small
 
yeah, and I didn't bother doing the basic optimisations either, just 7!
 
2:35 PM
@xpqz BTW, I see people using a lot of NGET etc. to read in files ( @abrudz apparently has some tricks to share soon, and ]get in 18.2 will be nice), but if you're interested in speed, I've been using HttpCommand: github.com/rikedyp/Advent-of-Code/blob/main/kit/pget.aplf
 
@RikedyP Wrong link?
I should delete that repo. Done.
 
@Adám twas
 
@RikedyP How do you handle authentication?
 
@xpqz Log in → F12 → refresh → copy request headers from browser → paste into variable (or ]get from text file or whatever)
my repo doesn't contain the headers, and even if it did, it's a session cookie so it changes if I log out
but Adam had the same Q, I should put that info in the function comments
 
@RikedyP You can automate for the current year and day, no?
 
2:43 PM
@Adám always the same month
also you know what day it will be
@Adám using ⎕TS? that's a nice idea actually
 
Actually, I'd use ⎕DT to get UTC.
 
but like I said to you before, it doesn't matter how long your set up is
you can be sat in the session with pget 2021 6 ready to hit enter when the time comes
@Adám ah yes
 
Tilde Diaeresis shouldn't this say "Tilde Diaeresis is a Monadic operator with an ambivalent operand"
 
It should. I'm pretty sure I've logged that before, but let me have a look.
 
Gotcha
 
2:56 PM
Nope, it was for the exact same issue with – well, not exact any more, since the introduction of Constant.
also needs help.
 
Yeah
 
@RikedyP It would be nice to actually do the auth token dance in code.
 
So does
@FawnLocke Logged as issue 19552
 
Awesome :)
 
Could port that to dyalog and hang it on a ]aoc user command...
 
3:21 PM
Announcement: Dyalog is looking for beta testers for our yearly problem solving competition. While you can use any language to solve the problems, we prefer if you use an APL, or at least an array-oriented language. You will be expected to give feedback on the 10 easy and ≤10 harder problems, while rating their relative difficulties. Note that by beta-testing, you disqualify from the competition. Let me know if you're interested.
2
 
@Adám I'm up for it, I'm not a student so I can't enter anyway :P
 
@FawnLocke Non-students can enter.
 
Oh, huh. Didn't know that
 
@Adám I'll be very busy next year, so I'm interested in taking the questions ahead of time.
 
@FawnLocke You can't win money, but you can win free entry to the next physical user meeting.
2
 
3:26 PM
Awesome, noted.
 
@LdBeth The questions won't be ready before January. Is that OK with you?
 
That's fine.
 
OK, I've put you on the list.
 
@xpqz it looks like it requires the session cookie as well...?
 
@RikedyP Yeah, but has an experimental feature to fish that out from your browser.
 
3:41 PM
@FawnLocke I like your primitive reference card. Did you generate the HTML via APL? I'm guessing not...
 
No, but it would be possible, and probably easier than handwriting it :)
 
@RikedyP it will look through your browser's cookie jar for you.
 
Heh, in principle, one could automate figuring out what each primitive is, since the interpreter knows.
 
Heh
 
Yes indeed! I was asking because I wondering how it would look if the the glyph was in the middle and the the dyadic name on the left with the monadic name on the right.
 
3:44 PM
Actually, it might not know the primitive name, only the glyph name.
 
@PaulMansour I generate my site's pages using custom markdown and APL, generating the reference card might be a fun addition
 
Then the dot would not be needed.
 
how do I set a session cookie with httpcommand?
 
I was thinking of using it as as example of my HTML project..
 
      {2⊃⎕NPARTS SecretFunction ⍵}¨ '+' '⍨' '∘'
 Plus Sign  Dieresis Tilde  Jot
 
3:46 PM
@Adám oooh...
 
18.2 even knows how to type them. On my machine:
      ⎕KL¨ '+' '⍨' '∘'
 Shift+=  Alt+Control+Shift+T  Alt+Control+J
 
@PaulMansour Interesting, other than one or two inconsistencies (See each/constant) I imagine that'd be trivial.
:o
 
Another reason for putting the glyph in the center is that the way it looks now, the dyadic name is much closer to the glyph on the right than the glyph on the left, which to me is a bit confusing
 
Ah, (1 2⍴'cookie' 'session=5361...)
 
Hmm, I guess that's true. I didn't think about that perspective
 
3:49 PM
Not sure it will look better the way I'm suggesting, but maybe worth a try.
I like the idea that the location of the name on each side of the glyph is meaningful.
 
Of course. I'll do a mock up later tonight and see. (Need to actually finish the thing first ^^')
 
Yeah, dyadic name on the left and monadic on the right might make sense.
 
The Dyalog reference card is very small type face, and way too much stuff on it for the beginner. I'm teaching a class next year to some high school students, and would really like a version of this on heavy plastic card stock.
I'll look into that...
I'm also wondering where to draw the line. Between just the primitives and the comprehensive Dyalog version. I'd like to see the dfns syntax, as that is something I teach very early on.
 
I was gonna include the dfns and train syntax
Names are the wrong way around but you get the idea of how it might look i.imgur.com/UrExJAn.png
 
Excellent.
 
4:01 PM
@FawnLocke I like it. Maybe put white space or a darker line between adjacent names.
 
I think I do prefer your suggestion. It's more space efficient too
Yep
i.imgur.com/5MHXLj7.png This is how it looks with whitespace blegh, smart padding might work, but I'm gonna go with a darker line
 
I agree, a little separation between each name/glyph/name tripple somehow...
 
The dot strikes back!. Maybe more padding around the dot. Or something else entirely? Thoughts?
 
That's why I asked if it was generated via code, I didn't want to ask you to do a lot of work! I think it might take borders around the triples.
 
@Adám Can you give me a random challenge?
 
4:07 PM
@FawnLocke I'd put a full line and make it darker, or I'd put "two lines" i.e. separate boxes.
@Fmbalbuena Sure.
 
@Adám I'm leaning that way too
 
@Adám (a easy one)
 
@PaulMansour It's fine! UX and documentation is something I care a lot about. I'm happy to take it into my own hands for once
 
@Fmbalbuena Click "Next task" until you get an easy one.
 
And maybe no borders around the glyph, just the different background color that sets it off.
 
4:08 PM
Ah, yep. Missed that
 
Yeah, that'd be nice.
 
@Fmbalbuena did you try the previous years' Dyalog comp problems? Starts here: problems.tryapl.org/psets/2013.html
 
@xpqz Those are not random ;-)
@Fmbalbuena CMC: Given two integers a and b where a≤b, generate a random integer in the inclusive range [a,b]
 
@Adám what does mean the inclusive range [a,b]
 
@Fmbalbuena Any integer ≥ a and ≤ b.
 
@Adám other one non-
 
@Adám maybe that's the CMC? Pick a random year and question from 2013-2020
 
@FawnLocke Remove the horizontal lines between the doubles.
@Fmbalbuena CMC: Given two integers a and b such that a≤b, generate all the integers in the inclusive range [a,b] in ascending order.
 
@Fmbalbuena What about it?
Oh, that should have linked to the GHPages instead of the readme. Oh well.
 
4:22 PM
Star this to make me easier
2 mins ago, by Fmbalbuena
https://abrudz.github.io/lb/apl
 
If you need to save it for yourself, just bookmark it.
 
oh sorry
 
@FawnLocke I still see the outer horizontal lines.
 
Ah, right. 1 moment
 
4:25 PM
In fact, you can probably remove all lines for a cleaner look.
 
Yeah, now the lines look like + and are associated somehow, so either remove them altogether or go back to the darker separator line (which can be more compact too).
 
mismatched dels in definition
 
@Fmbalbuena What?
 
Full error:
Dyalog APL/S-64 Version 17.1.36845 Classic
For i86_64
Created: Aug 15 2019 at 00:27:20
Copyright (c) Dyalog Limited 1982-2019
      ⎕PW←32767
      ⎕TRAP←0 'E' '⍞←⎕DMX.(↑DM,¨'''' '''',⍨⊂Message,⍨'': ''/⍨×≢Message) ⋄ ⎕OFF(128⌊⎕EN)'
      '#'⎕NS⎕FIX'file:///home/runner/.bin.tio.dyalog'
line(3,2) : error AC0084: mismatched dels in definition "F’"
                                                           ^
line(12,1) : error AC0084: mismatched dels in definition "’"
 
4:30 PM
Ouch. Please use Unicode.
 
And you can just post a TIO link.
@FawnLocke Yeah. I like that. As long as there's enough spacing to make the columns clear.
 
Hmm, okay. Well I think most ideas have been explored. I like the last few iterations. @PaulMansour what do you think?
 
@Fmbalbuena No, I meant a TIO link to your failing code, not using TIO as a paste bin.
 
4:32 PM
@Adám sorry
 
@Fmbalbuena You put after F. It needs to go before F
That said, you should work on your array programming skills.
 
I think I quite like the borderless style too. If there's no opposition I'm gonna go with that.
 
but why with input does not error?
(input for calling functions)
 
Input is really the REPL.
 
4:35 PM
i know but
why
 
Because when it was set up, Dyalog APL did not support shell scripts.
Do you want another simple challenge?
 
@Adám sure
 
CMC: Write a function that takes a single positive integer as argument, and returns all the integers from and including 1 until and including the given integer.
 
@Adám not a challenge because without CMC
i want one more
@Adám ^
 
You're missing the 9!
 
4:43 PM
@Adám ^
 
@Fmbalbuena You are reading a global variable (and a!) and printing numbers, rather than defining a function taking an argument and returning a result. This is how you can fix it: Try it online!
That said, can I show you a simpler solution?
 
Up to you, but you might learn something by studying how I would solve this.
 
@Adám get the last char?
 
⊢/
 
4:48 PM
?
where i do put?
 
⎕←⊢/'Hello'
 
@Adám o
 
⎕←⊢/3141
 
@Fmbalbuena 3141
 
is possible to convert int to str?
 
4:49 PM
 
⎕←⊢/⍕3141
 
@Fmbalbuena 1
 
⎕←⊢/⍕3141*20
 
@Fmbalbuena 9
 
You can also do the division remainder when dividing by 10: ⎕←10|3141
 
4:51 PM
@Adám 1
 
@Adám but uhhh
i don't need to do mod
 
@Fmbalbuena That fails because ⍕3141*20 gives 8.736927421E69
 
@Adám sry
8736927420887616149020037979399529493530951780459820771411872802346801
 
@Fmbalbuena Btw, did you mean to use power or to multiply?
 
@Adám power
 
5:04 PM
@Adám Where would you suggest one go to start learning APL?
 
5:32 PM
 
@FawnLocke Very nice!
Turns out the grid lines were totally unnecessary.
 
Agreed. Btw, as opposed to NuVoc, you don't need the colour legend, because your tables are sorted by type and have a heading.
 
Yes, true.
 
Now I want to see the operator table…
 
I'm curious how to make constant work. As it's identical in the monadic and dyadic case.
For consistency sake, should I just write it twice?
 
5:37 PM
@FawnLocke Maybe make the glyph column a bit narrower? Maybe make those cells square?
@FawnLocke I think so.
 
@Adám Good call
 
A detail: I'd change "LCM (And)" into "LCM/And"
 
Any reason why?
 
The parenthesis kind of removes the description from the glyph column because it now is between them.
 
Ah, true.
 
5:40 PM
You will need additional width for the operators, though, up to 3 chars, I think. Maybe that can guide the glyph column width.
 
Yeah.
 
You have Ns⌶ but does the shape (and type!) really belong in this table?
 
Also, for me, the parens indicate same meaning, different word, where as the slash indcates two different meanings.
 
Agreed. Parens look like a clarification. People will be looking for "And".
What about which can take both a scalar and a vector operand?
 
@Adám I agree it's much, but I wanted things to be consistent. As I need to clarify type for rank and selfie
 
5:42 PM
You don't need to distinguish between data types, just Array vs function.
 
should it be And/LCM rather than LCM/And? As And is more common?
 
How about @ which can take a scalar, vector, or nested vector as right operand?
 
That's true. I'll make that change.
 
And which can take a scalar/vector/matrix.
 
Everything gets complicated with operators! Even the docs...
 
5:45 PM
Yeah, I've logged a handful of issues against wrong descriptions.
CMC: Given a character scalar representing a primitive function, return a Boolean result indicating if it can be used monadically. E.g. '='0 and '+'1
 
Alternatively, you can write an operator that take the function and a dummy arg.
 
Forgot text alignment..
 
@FawnLocke And System A⌶ System
 
Thanks.
Darn, just missed the 2 minutes
 
5:57 PM
Very nice. You know that there are three more monadic ops, right?
 
Yep
 
It is hard to resist to fill in the blanks with enhancements to the language.
 
Heh, you can define constant with constant. constant⍨
Is bracket axis technically an operator?
 
@FawnLocke (Rant: It is an abomination, together with outer product. You could consider bracket axis a hyperator, as it is able to bind with and modify operators like reduce…) Yes, it is.
@PaulMansour It really is. Do you know about my extensions?
 
hahah, yeah. I was gonna say we should probably forget it exists and use leading axis instead :P
 
6:07 PM
Well, bracket axis is ad-hoc, and can do things that are awkward with Rank. This isn't so much an issue with Rank, as much as there being some missing primitives.
 
Yeah
I was surprised ∩ didn't have a monadic counterpart. What a waste.
 
@FawnLocke what would it even be?
 
I suggested using it for Unique Mask, but that proposal was rejected.
 
That's the problem. I think I remember Dyalog persisting on having primitives have somewhat consistent meaning across arity. Intersection is already quite weird
 
Extended has it as self-classify, kind of like ∪∘.=⊢
 
6:11 PM
Monadic = makes sense as classify to me
 
Yeah, that's what Iverson wanted.
 
Curiously enough, monadic ∩ isn't implemented in Dzaima/APL either
 
seems weird to me that dyadic is on the left and monadic is on the right, shouldn't it be the other way round?
 
there's not much for it to be applies to dzaima/APL too
 
@rak1507 Monadic's take their sole argument on the right. Dyadics add a left arg.
 
6:15 PM
Yeah, doesn't make sense the other way around
 
nuvoc has it the other way round, and that seemed more intuitive to me
 
@rak1507 But there, both names are on the same side of the symbol.
 
true
 
That's how it was originally. But I think this is better
 
We have so many open slots for monadic functions, and none at all for dyadic function. I think we could allot a few:
∧ and ∨ for sort ascending/descending
⊥ and ⊤ for conversion from/to binary
> and < for increment/decrement
⍷ for type
 
6:19 PM
Is there Malbolge interpreter in APL?
 
No, but there is a lisp interpreter written in malbolge that has array ops. (By Kamila)
 
@FawnLocke Aware, but haven't studied in detail. I like that things like and/or should have extended valance for sorting. I worry about other types of extensions.
That was for Adam
 
@FawnLocke but I said malbolge interpreter, not APL Interpreter
 
Yeah, just pointing out something similar. There are a couple interpreters written in APL, but none for malbolge
 
that's easy to interpret
 
6:22 PM
@Adám The first 3 seem like no-brainers. Are the arguments against them? Or alternative ideas?
 
@PaulMansour Me too, I don't think we need any more glyphs, I'd probably make more changes and subtractions than additions
 
@FawnLocke Is classify the same as group in k? (Monadic =)
I always wanted that over the key operator.
 
Not that familiar with K. But I don't think so.
 
@Fmbalbuena The dfns workspace has an operator for working in balanced ternary.
 
@PaulMansour You can implement classify easily: (∪⍳⊢) It simply makes sense to be monadic =, even if it isn't the most groundbreaking addition.
 
6:27 PM
@PaulMansour it's not
 
@Adám wdym?
 
If K's group is like BQN's, I agree that's better than APL's key.
 
k's group is just {⍺⍵}⌸
 
@PaulMansour k's = doesn't really work without dictionaries
 
@PaulMansour Morten wants to redefine dyadic grade to be sort-by. Geoff said monadic and are "a waste of a development hole. 2⊥ is short and easy to read and comprehend." I've not raised increment/decrement. I think I've mentioned for type but my colleagues don't see the value of that function (evidenced by its removal when we left ⎕ML←0).
 
6:29 PM
@dzaima Yes, I suppose it could return a namespace, but that gets messy...
 
@Adám what does 'a waste of a development hole' mean?
 
Unnecessary sunk time and resources, I assume
 
Only unnecessary use of "glyph space", I think.
 
what else would it be
 
@Fmbalbuena Malbolge uses balanced ternary.
 
6:30 PM
also, monadic ⊥ sure but monadic ⊤ for binary is a lot nicer than 2⊥⍣¯1
 
Totally
 
NARS2000 uses for Type.
 
@Adám it uses just regular ternary
 
Oh, my bad then.
 
@PaulMansour and you'd lose the ability to group non-string things, which makes it pretty useless
 
6:32 PM
What would type be useful for? I think we should probably separate notation from programming, as a system function I can see it's utility
 
I'm generally against breaking changes, but I do advocate redefining scalar⊤ to mean scalar⊥⍣¯1 as I can't imagine anyone using scalar⊤ instead of ⎕CT←0 ⋄ scalar|
 
@dzaima I don't follow that.
 
@PaulMansour Namespaces cannot use anything but valid identifiers as keys.
 
@PaulMansour namespaces can only have string keys
 
Malbolge interpreter in APL when?
 
6:33 PM
@FawnLocke Type is a function that recursively replaces characters with spaces and numbers with 0s. Very useful for argument analysis.
 
Ah, I see.
 
Right. I would just have r.UniqueValues r.Indices as the the result. Yes, messy
 
@PaulMansour might as well just have two vectors then
 
Or r.Groups
 
no better than {⍺⍵}⌸
 
6:33 PM
Yes
four characters better
 
that's how it works in kamilalisp
 
@rak1507 Except you don't need to transpose, and avoid high representation costs. I often want ↓⍉{⍺⍵}⌸
 
keys returns a (nested) vector
 
@KamilaSzewczyk Can you make Malbolge interpreter in APL?
 
perhaps I can
 
6:35 PM
@FawnLocke Phil Last uses (with for Type):
null←≡∘⍷⍨  ⍝ any rank → scalar  - indicates empty or all blank and/or zero.
clean←~∘⍷⍨ ⍝ vector → vector    - without null items.
nil←∊∘⍷⍨   ⍝ any rank item-wise - indicates null items.
 
too busy with serious programming :tm: for now to do esolangs, though
 
Interesting
 
@Adám Yes. I'm not smart enough to use key, and always have to fiddle with the results. If I have the indices and the uniques, I can always get what I want.
 
Key has many issues, imo.
 
what are they?
 
6:37 PM
@Adám ∪,⍥⊂⊢⊢∘⊂⌸⍳⍤≢ is slightly faster
 
I often want to set an "alphabet" of all possible values, in a given order.
And I often want both the info from key, and they unique elements, separately.
 
maybe +/A∘.=B should be an idiom...?
or (+/∘.=)
 
Isn't that just count in?
 
yes, but it'll be quadratic at the moment when it could be linear
 
Fair
 
6:39 PM
@Adám which would solve this
 
Shame we don't have any dyadic space :P
 
@FawnLocke ?
 
For adding count in as a primitive
 
@rak1507 You mean the primitive that returns a two element vector?
@FawnLocke I have that among my extensions.
 
@Adám I was referring to +/∘.=, if that was an idiom it'd do that (right?)
 
6:43 PM
Key has many great use cases, but one thing I always find overly verbose is getting out the value of a specific key (if you use it as "group")
 
@xpqz yeah, because you need ↓⍉{⍺⍵}⌸
 
∘. is quite weird. I'd have to put it under dyadic operators, right?
 
K's dicts give me envy:
d:="ajsdhfkjhlkjhsadgkjha"
 d@"j"
1 7 11 18
 
@rak1507 Sure, but who says you want the count. Wouldn't ⍸⍤1∘.(≡¨) be better?
 
yeah, maybe
 
6:50 PM
@xpqz @rak1507 Actually {⍺←∪⍵ ⋄ ⊂⍤⍸⍤1⊢⍺ ∘.≡⍥(⊂⍤¯1)⍵} I think:
      C←{⍺←∪⍵ ⋄ ⊂⍤⍸⍤1⊢⍺ ∘.≡⍥(⊂⍤¯1)⍵}
      a←'ajsdhfkjhlkjhsadgkjha'
      u←∪a
      d←u C a
      d⊃⍨u⍳'j'
1 7 11 18
 
:) wow
You didn't even key.
 
this looks glorious
 
Very neat
 
@xpqz You can write it as C←{⍺←∪⍵ ⋄ ({⊂1↓⍵}⌸⍺⍪⍵)-≢⍺} instead, but you can really see the issues in that definition.
 
Why not ⍸⍤1⊢u∘.=a?
Bar the padding
 
6:58 PM
Because it fails on high-rank and nested arguments.
 
Ah okay.
 
But I don't need to split. That was silly. I should have used Rank instead.
 
@Adám Isn't it faster and more space efficient to use the classic sort/shift/compare technique? Or does that not generalize?
 
00:00 - 19:0019:00 - 00:00

« first day (1778 days earlier)      last day (51 days later) »