« first day (1610 days earlier)      last day (32 days later) » 

1:03 AM
@Adám Hi Adám, thanks for welcoming me. I was curious about APL. I read some random posts in the past about people talking wonders of the language. This time I decided to play with the language. The array-oriented paradigm and the symbols it uses are what captivated me. I'm reading "Learning APL with APLX" and I must say am hooked. Oh, and recently I discovered The Array Cast podcast :)
 
 
3 hours later…
4:30 AM
@AndyAquino APLX should get you started well with APL, but I suggest Mastering Dyalog APL for a book on a more modern implmentation.
 
 
1 hour later…
5:47 AM
@Razetime There isn't actually a huge difference between APLX and the version of Dyalog APL used in Mastering Dyalog APL. mastering.dyalog.com is a WIP to update that.
 
ah ok
 
@AndyAquino Cool. Are you aware of the additional apl.wiki/Learning_resources?
 
6:17 AM
⎕←3 3 ⍴ ⍳ 9
 
  3 3 ⍴ ⍳ 9
1 2 3
4 5 6
7 8 9
 
@Adám the TryAPL part of the bot seems to be working (still need to do more testing to make sure it's stable and decide how I want to interface with Discord/IRC) \o/
 
6:42 AM
@hyper-neutrino Ooh, new, shiny. ⎕←⍳2 3
 
Oh, is it supposed to detect ⎕← everywhere in the message? oops :)
 
⎕←'test'
 
  'test'
test
 
@hyper-neutrino Any `⎕←…` I'd say.
 
alright, that makes sense :) if a message has multiple should I just run them all in succession?
 
6:45 AM
Sure. Also, I don't think it has to echo back the requested expression.
 
good point
 
You can merge all the expressions from a single message using
 
Meanwhile, an APL answer for checkered tiling is still up for the grabs :P
 
i am very sad that my approach is wrong :pensive:
 
Would it be possible to make it react also to `⋄…`?
⎕←a←⍳3
 
6:47 AM
  a←⍳3
 
@Adám like, on its own, so you would be able to do ( ⎕←code some-text ⋄ other code ) ?
 
@hyper-neutrino I said something wrong the other day when I described the desired behaviour. I think I said it should execute "the rest" i.e. after ⎕← but it should actually include the ⎕←
 
nah the prefix for the older bot was ⋄code⋄other code
 
@hyper-neutrino No, it would be an alternative syntax. You can safely include the as well.
 
@Adám oh
 
6:50 AM
The point is to allow things like ⋄ a←⍳3 ⋄ 2×a and also ⎕←a←⍳3
 
@Adám okay. so basically, find all `⎕←...` and all `⋄ ...`, remove the s from the start of the latter type, join all of them on , and then run the statement?
 
⎕←3 3 ⍴ 3
 
  3 3 ⍴ 3
3 3 3
3 3 3
3 3 3
 
oh it prints the experssion again and then the output
 
@hyper-neutrino You don't even need to remove the leading diamonds, as it is all valid APL :-)
 
6:51 AM
yeah adám mentioned that the expression itself doesn't really need to be output
 
@Razetime I think HN is going to remove that.
 
@Adám oh, right :P
 
alright
 
@hyper-neutrino But you might want to make the bot reply to the task message.
 
@Adám i can't figure out how to get that to work with multiline monospace
 
6:53 AM
@hyper-neutrino Good point. Would it be possible for the bot to reply with an inline code block if the output only has one line?
 
@Adám yes, I can special-case that - good suggestion
 
@Bubbler I have 17
 
o wow
you mentioned there's a hint you'd only mention if someone found it - i presume the py/js ones have not :P
 
Python one is manually coloring it to the end, and I don't want to decipher the JS one now :P
 
fair enough lol
 
7:18 AM
@Bubbler very honestly do not know how to solve it
so if a-b, a-c and b-c exist, then it is falsy
otherwise true
 
That's correct
 
so basically existence of a 3-cycle <=> falsy, like dlosc suggested :p
 
Yes, but you can make it much more compact than that
 
hmm
also yeah my code was previously checking if the # of unique elements around each intersection was even or 1
in other words, 1, 2, or 4, or just "not 3", lol...
 
7:45 AM
The failing testcase has something to tell you
 
i'm trying to think of a concise way to represent that... i notice a pattern but idk how to define it well yet. i'll need to keep thinking about that case in particulra
 
8:14 AM
Okay so assuming I've done everything correctly - in a normal message, all code sections starting with either ⎕← or will be joined by and run, and in a multiline fixed-font message, all lines starting with ⎕← or will be run. If the output is blank or one line, it will reply in-line; otherwise, it will use a multi-line message and just ping you normally at the end. I have no special casing for message that would be too long for one message yet.
 
@hyper-neutrino <empty response>
 
@hyper-neutrino Could you make an exception rule so that a lone ⋄ or a lone ⎕← are ignored?
 
good idea
i can just change * to + in my regex :p
alright, change applied
 
As for the "too long" issue: If a response has only one line, but that line is longer than 500 chars (including added backticks and escapes) you can simply switch to multiline.
 
8:46 AM
I have a 24 @Bubbler
thought I had 17 but it was wrong
 
9:21 AM
      (⍴a)≡⍴(,1)+a←⍪1 2
1
      (⍴a)≡⍴(,1)+a←1 2 3
1
      (⍴a)≡⍴(,1)+a←1
0
      (⍴a)≡⍴(,1)+a←⍬
1
 
 
6 hours later…
2:54 PM
@Adám is there good software that lets me type APL symbols on my keyboard that you could recommend? or like an appropriate layout to use a compose key with or smth. the LB bookmarklet is very nice so i don't really necessarily need it if there isn't a good option
 
@hyper-neutrino Since you mention the compose key I presume you're on Linux?
 
i'm on windows rn - i think i meant altgr key or something
or maybe that's wrong too. sorry i'm not too sure what things are called
 
oh, very nice. thanks
 
@RecursiveCo. So now you're interested in learning APL?
 
2:58 PM
You can switch between keyboards with Windows key+space if the APL keyboard gets annoying
 
oh, okay that's good to know
 
@hyper-neutrino What physical and soft keyboard layouts do you normally use?
 
I believe my physical keyboard layout is US? is there a good way to tell
my soft layouts are EN US and Japanese (Microsoft IME)
 
@hyper-neutrino Does Enter touch Backspace?
 
No, there's backslash/pipe between them
 
3:02 PM
US then.
Then, while true what user said, you can simply remove your current US-English layout after you add my APL layout, as it is a strict superset.
 
oh okay, cool
 
@EliteDaMyth Want to learn APL now?
 
@Adám Is it? I've had problems with shortcuts involving the left Alt key such as Ctrl+Left Alt+L
 
Oh, right, some applications do not distinguish between Ctrl+Alt and AltGr.
But Ctrl+Alt-shortcuts are very rare.
 
will it affect usage of backtick too though?
 
3:06 PM
@Adám Unfortunately, Format Document in VS Code uses it, and I use that pretty often :/ I can probably change the shortcut though
 
@hyper-neutrino Depends which one of my layouts you choose. user was talking about my AltGr layout. If you use my backtick layout, you'll have to type backtick,space to get a backtick, which is a bit annoying for markdown.
 
ah
i downloaded altgr.klc - i thought both were part of it, oops :)
 
I personally use AltGr because then I can keep it pressed while typing multiple APL glyphs, just like the way Shift works.
 
ah, good point
 
Hm, now I wonder if I should make a CapsLock based layout, so pressing CapsLock switches all keys to APL until you press CapsLock again.
 
3:09 PM
that could be cool
i don't really like, ever use caps lock for anything anyway
 
Exactly.
 
huh. so it shows I have (V15) Unified US AltGr (Alt+Ctrl) APL keyboard and US QWERTY installed under English (United States) keyboard options
but I can't switch off of QWERTY
and if I remove it, it just removes the whole thing and only my japanese layout exists
 
yeah, that's what it looks like. if i click remove the whole thing just disappears ¯\_(ツ)_/¯
 
Even the APL layout?
 
3:16 PM
yeah... no clue why
do i need a restart or smth
 
May well be. This area of Windows is quite buggy.
Every once in a while, especially after updates, you may find that Microsoft has decided to add the default layout for your computer's language.
 
yeah i have found that and it is super annoying
I cannot figure out how to remove it either
alright, brb after a restart :D
y⍺y it ⍵orked
 
@hyper-neutrino Since it doesn't give you a visible language bar, you might want to look at aplwiki.com/wiki/… to learn the locations.
 
ah good idea. thanks
 
RGS
4:25 PM
The twitter bot is now hosted and stable(r), so feel free to mention it in your tweets if you need code evaluated :P
 
@RGS I'd put the text result before the "try it" link
 
RGS
Actually a good call.
 
Two new APL executing bots in one week. Woo!
 
@RGS Did you consider whitespace issues?
Like what happens with 10⍴''?
 
RGS
4:31 PM
@Adám what whitespace issues?
 
Or 0 0⍴0
 
that's the image it sent me
 
@hyper-neutrino You don't need ⎕← for that.
 
RGS
Btw there's no need to do an explicit ⎕←
 
:-)
 
RGS
4:35 PM
If the "whitespace issues" means things that look blank, then the answer is : I don't consider them. I just evaluate things and print the result. If the result is invisible, then that's your problem :P
 
oh :p
 
The only reason we require or ⎕← here is so people can write APL code without the bot going mad.
 
@Adám
NOT PERMITTED: Illegal token
       </code>or<code>⎕←
     ^
 
uh...
 
Wat.
 
4:35 PM
i... may be bad at programming
i am checking for <code>((⎕&larr;|⋄).+?)</code>
 
You need to make sure you don't cross ` boundaries. @RGS You implemented that, no?
 
which is a non-greedy match with + but if you have stuff after the ⎕←` and then another `...` then it'll match the outer backticks
 
@hyper-neutrino
NOT PERMITTED: Illegal token
      ⎕←`
     ^
 
RGS
@ExperimentalAPLBot For a second there I was confused and thought my bot misbehaved :P
@Adám I still don't follow.
 
Nvm, I think I misremembered.
 
4:38 PM
@RGS `a` ... `b` should run a and b as code but not a` ... `b
when making sure that empty ⎕← wasn't run I also accidentally made it so if that is followed by something else it matches the outer backticks
 
RGS
Well, np, I think you just made me find a bug in the bot when the user types code across multiple lines
 
i'll just match the empty ones and then filter them out, so the regex doesn't do bad things
 
5:11 PM
@hyper-neutrino Do you know about aplcart.info?=1200⌶?
 
i don't - ⌶ does system services or something like that, IIRC?
from the mnemonics wiki page you linked
 
RGS
@Adám the link didn't work :P
 
Oh, oops. Missing a q
@hyper-neutrino Yes, and you can get to the docs for 1200⌶ by clicking (?) at aplcart.info?q=1200
 
oh, nice
 
5:27 PM
@Adám I would like to render vega-lite output with Jupyterlab/Notebook but I don't know is there anyway to define a proper mime type for vega-lite string.from Dyalog Kennel. Do you have any hints?
 
@kimmolinna I barely even understand what you're asking for. Do you have the vega-lite installed on the machine that runs the Dyalog interpreter?
 
@kimmolinna looks like you can use json maybe?
 
Jupyterlab can render pictures and some formats automatically. When I produce svg with Dyalog Kernel I can see it nicely at least with 3500 I-beam but I don't have tooltips for boxplot. Maybe I try to do it via html.
@rak1507 That's true. And I can open it by double clicking file but I'd like to embed a grraph to notebook.
 
@kimmolinna You can generate the JSON from APL, call vega-lite from APL and have it generate a file, then fetch the file and send it to 3500⌶
 
@kimmolinna yeah, I barely know what you want so I was just guessing from the website
 
5:39 PM
@Adám That's exactly what I have done with svg.
 
@kimmolinna So what is the problem?
@RGS For the bot, if the first character of the result is a backspace, keep only the last backspace-separated segment.
 
@Adám Missing tooltips. ;)
 
@kimmolinna Firstly, SharpPlot can make those. Secondly, what is the problem with using vega-lite?
 
@Adám Yes It can, but in some cases it produces quite much unnecessary lines. ;) I render a svg with vl2svg (vega-lite tool) but as I mentioned earlier It won't show tooltips for example for boxplot. If I try to use 3500⌶ with vega-lite json file Jupyterlab Notebook doesn't recognize the correct mime which is application/vnd.vegalite.v3+json" because I don't have a way to define it.
 
@kimmolinna Oh, NOW I understand your problem.
 
RGS
5:54 PM
@Adám hun?
 
@RGS We tag certain responses so that the front end can take special action.
So e.g. for ]help we send back BShelpBShttps://some.url/to/help.htm
 
is there a list of these tags?
 
RGS
@Adám oh ok, I understand
But then what if the first character of the result of something the user typed is a backspace?
How can I distinguish?
 
@RGS It cannot be, because you don't get the actual result back; you get a picture of the result, with all backspaces resolved.
 
RGS
oh I see
 
5:58 PM
@hyper-neutrino IIRC, this is the only one for now.
 
why not just keep it as is?
 
RGS
and that is why you use the backspace as the tag
 
Because the it looks like an invalid URL.
 
oh
 
@RGS Exactly.
 
RGS
5:58 PM
clever
@Adám this I didn't get
 
It was a response to rak.
 
RGS
yeah, and I didn't understand it :P
I interpreted rak's question as "why don't you return the original result, why do you return the 'rendered' result?" and then I didn't understand your reply.
 
I thought rak was asking why not keep the tag in place.
@rak1507 What were you asking?
 
I was asking why not keep the original picture because I thought you were talking about modifying it for some reason
tbh I'm a bit confused
 
RGS
@rak1507 gimme a sec
 
6:07 PM
ah
ok I understand now
 
RGS
@Adám logged as #2
 
Commented there.
 
6:28 PM
⋄]help ⍣
 
help command now works as desired :D
 
@hyper-neutrino Maybe use [url](url) so it doesn't get abbreviated?
Hm but then you'd want to strip off "https://"
 
⋄]help ⍣
 
6:32 PM
like so?
 
(Alsmost) Perfect!
@hyper-neutrino How hard would it be to replace %20 with spaces in the [url] part?
 
I can just decode the whole URL if wanted
 
I don't think we ever use any other characters that need escaping.
 
ah, okay - i'll just do spaces then
⋄]help 1200⌶
 
6:35 PM
Beautiful!
OK, I've worked 2.5 hours too long by now. ○/
 
@user4808141 Welcome back. This offer still stands:
Mar 16 at 7:02, by Adám
@user4808141 Hello aardwolf. If you want to participate here, please email access@apl.chat
 
7:05 PM
https://tio.run/##XY7BCoJAEIbvPoU3dxGR9d6zxOKKCZKiQoR1KRBb3OjYJYhO3iOCoIuPMi9i42oQDXtYmO/75@dp7Ig1j5Ow74UH1ak0TJwIf6Bew6vPJahj11qOReBwBVmBvFGQe1CPrQnqYkZJwd2ML8NAu/6Qgnv2ZX5mwP0Fz7hfBJmm04mG5v0Pazrleb5KMqFh2yXYBVvRrkXa2BrCmzNMsAiubNcH9Uwp1DKiFhYnJRk7UBvUndkbx9U3hEfNwfQmk80mF@QOtQgaTJkSUHDYqPT9Bw
What is a cleaner way to handle these function strings
Both expressions use the functions i c p with an ⍺⍺ variation of processing the result
so since the trains ⍺ all use functions i c p I pass them in as strings to be evaluated in the context of the dfn
but this is all kinds of hackish
 
ooh, AOC
 
('1-13' 'r:' 'gqdrspndrpsrjfjx') ('5-16' 'j:' 'jjjjkjjzjjjjjfjzjjj') ('14-16' 'r:' 'rrrnrrrrrcnrgxrr') ('1-3' 'k:' 'bkktwhgktv') ('3-5' 'q:' 'dxqqqzmqvs') ('11-14' 's:' 'sssssssssssssv') ('1-3' 'd:' 'cdzdq') ('13-16' 'q:' 'scdqpdgpkvbwwqbv') ('9-10' 'd:' 'ddrdddlddd') ('15-17' 'v:' 'jvvvvvvgcvvvvrcvnv')
example input
I'm assuming that inverting the input to a 2d array instead of a vector of nested vectors will solve the messiness in my code
 
7:36 PM
@Adám why can't I pass operators to operators?
 
7:55 PM
@Adám why?
 
@nathanrogers Dyalog APL is not a functional programming language unfortunately - although maybe you could get some hack working by passing namespaces containing operators? I dunno. In any case: dfns.dyalog.com/n_hyperators.htm
@nathanrogers FYI you can in NARS: wiki.nars2000.org/index.php/Hyperators
 
8:28 PM
@RikedyP But then you can't pass hyperators to hyperators.
@nathanrogers Simply because there's not been implemented a syntax for it. There's no inherent reason why it couldn't work.
 
Wish there were some way to turn functions with two arguments (applied like in Haskell) into dyadic functions, functions with four arguments into operators, etc. and vice versa
 
@user Functions that take two arguments are dyadic functions.
 
dumb question why does ⎕SE.Dyalog.Utils.repObj error on tio
 
@rak1507 Not dumb at all.
 
@Adám In APL, yeah. I meant having functions that are applied like in Haskell (fn arg1 arg2 ...)
 
8:34 PM
Everything in ⎕SE is either loaded from a binary blob .dse file (a Dyalog session file) or from text files. TIO has been set up to not load those things autmatically.
@user There's nothing inherently preventing it, however, nobody has implemented a syntax for it.
 
Yeah, I was just wishing for a different syntax (different language, really) influenced by both APL and Haskell
 
ok
ah, cool, thanks
 
@user _TwoArgAsDyad←{⍺⍺ ⍺ ⍵} ⋄ x TwoArgFn _TwoArgAsDyad y
 
That's a nice way to do it, but it doesn't work with operators unless you eval a string or something :(
 
8:41 PM
@user _ThreeArgAsOp_←{⍺⍺ ⍺ ⍵⍵ ⍵} ⋄ x (ThreeArgFn _ThreeArgAsOp y) z
@user _DyadAsTwoArg←{⊃⍺⍺/⍵} ⋄ Dyad _DyadAsTwoArg x y
 
@Adám Oh cool, didn't think of that
 
But a more general solution is to use namespaces like RikedyP mentioned.
Once we implement the new array notation, this will become a whole lot easier.
 
9:07 PM
@RGS Maybe add a sentence after "I see you mentioned me, but I found no code to evaluate." saying "Did you forget to put backticks around your code?"
 
I just really wanted to run {'`'`}{_←⍺⍺⋄1}⍬
aargh! markdown!
 
@rak1507 You have a backtick outside quotes. That's not valid APL.
 
yes it is! run it and see, perfectly valid
 
Oh, I see. Sneaky.
@rak1507 Shorter: {'`'`}/1
 
⎕←{'`'`}{_←⍺⍺⋄1}⍬
 
9:12 PM
@hyper-neutrino
NOT PERMITTED: Illegal token
      ⎕←{'`'`}{_←⍺⍺ ⋄ 1}⍬
     ^
 
That works as expected.
 
@Adám yea, I was testing whether or not it paid attention to quotes (yes it does, yay!) and whether or not it somehow parses that (it doesn't, but that's expected and not useful, so it's fine)
 
@rak1507 Not only that. TryAPL doesn't allow it, even though the full interpreter does.
 
oh
 
 
2 hours later…
11:23 PM
@@RGS What do you think of changing your bot's handle and avatar to TryAPL?
 

« first day (1610 days earlier)      last day (32 days later) »