« first day (1188 days earlier)      last day (1760 days later) » 
06:00 - 16:0016:00 - 00:00

RGS
RGS
06:04
@Adám is that the day of the year when you are evaluated at your job? I hope it goes well!
06:19
@RGS Yup.
@Adám How do you rate yourself of your abilities?
@petStorm I filled out a form.
RGS
RGS
06:50
@Adám alright; what is at stake?
Upcoming year's salary, shares, tasks, responisibiities…
07:14
@RobinSingh Welcome. Interested in APL?
@petStorm If I'd written that, I'd have shown that I don't know how to spell-check ("fillling") or how to apply markdown correctly (text in backticks).
RGS
RGS
07:50
@Adám shares of what?
@RGS Dyalog Ltd.
RGS
RGS
Oh, literally stock exchange shares?
I had no idea Dyalog was listed in the Stock Exchange
Not listed for public trading, but does have shares distributed between employees, contractors, customers, and the company itself.
RGS
RGS
Ah ok, interesting! Thanks for sharing
See what I did there?
Sorry, my brain is not functioning properly yet :-D
@petStorm Please do not spam this room.
08:00
@Adám I posted a lot less messages than others here.
@petStorm It isn't the amount of messages, but their content that matters.
It's a summary of the conversation so far.
08:32
@petStorm Right, but there's no need. The transcript is available. If you want to write summaries of conversations, I suggest you do so for the past chat lessons. That could be valuable.
 
4 hours later…
12:16
Hi @HighlyRadioactive how are your APL stufies coming along?
Good.
I read through the reference card.
(But was confused by the descriptions.)
@HighlyRadioactive Anything I can help clearing up?
RGS
RGS
@Adám That might actually be a good exercise for me as well; what type of summary do you envision?
@Adám Yes.
(Sorry, I might be inactive without warning.)
@HighlyRadioactive Go ahead. (Don't worry about breaks, that's what makes chat with reply pointers so great!)
12:24
Alrihgt
What the heck is I-Beam? @Adám
@RGS Ideally, taking a lesson and creating a Jupyter Notebook based on it, like those seen on TryAPL.
@HighlyRadioactive I-Beam is a (pun) monadic operator which takes an integer operand to select which temporary or undocumented function to access.
Pun?
And where can I find those "undocumented functio"
Two ways. Firstly, it was introduced in IBM's APL\360 as a way to call special IBM services. Call IBM → I-Be-Em → I-Be-am → I-Beam and it looks like the identically named construction material in cross section.
Secondly, many of the integers are chosen to make a pun. E.g. 201 is Roman CCI for "Colour Code Information" and 819 looks like the letters "BIg" as in big letters as in uppercase.
12:31
Uh... Pretty obscure, but I understand now.
@HighlyRadioactive The undocumented ones are… undocumented (except for internal documentation). The public ones (and one or two "secret" ones) are listed on APLcart and in the main documentation.
Well. Off-topic advertisement: 1+ have one undocumented command, d, for debugging. What is Hold?
@HighlyRadioactive Right, it is intentionally kept this way to avoid people relying to much on them. One should always use a cover function as they can change or disappear without notice. They provide a mechanism to try out things before settling on a final name or design. E.g. We've had 819⌶ for changing character case for a while. 18.0 finally gets a proper ⎕C function which takes arguments that are not like those of 819⌶.
@HighlyRadioactive :Hold you mean?
Yep. It is some kind of control structure? But I never heard of it before. @Adám
Yes, it takes a token and "holds" it until released. Any other thread attempting to hold the same token will pause until the token is released, at which point it takes over that token hold. This way, two parallel threads can make sure that e.g. only one of them modifies the database at any given time.
12:38
What is token, then? Looks like APL cares a lot about the computer
Just any string (character scalar or vector).
@HighlyRadioactive In what way?
@Adám Not a lot of Esolangs (I know APL is not an Esolang!) manipulates threads or etc
      2⌶

┌─┬┐
│2││
└─┴┘
@HighlyRadioactive Right, despite first appearances, (Dyalog) APL does come with most of the features you'd expect from a normal programming language — things you'd expect an eso/gold language, not to have.
      {⍵ ⌶} 2

SYNTAX ERROR
      {⍵⌶}2
     ∧
12:42
@Adám this differs from Dyalog's docs
@dzaima You're right. My mistake. (How in the world did you spot that? Ah, I have a suspicion…)
Did you do a diff to spot undocumented I-beams in APLcart?
@Adám i ~-and-~⍨-compared APLCart and the Dyalog table
@Adám Why can't I take an integer operand for then?
@petStorm You need to apply something to it.
I think.
@petStorm You can, but compare to ¨ as in {+¨}42 that won't work.
12:48
7 mins ago, by petStorm
      2⌶

┌─┬┐
│2││
└─┴┘
@HighlyRadioactive Evidently the interpreter allows nothing to be applied here. So what's wrong with my program?
@petStorm dfns can't return functions
(like all other operators) derives a function which can then be applied to one or more arguments.
@petStorm Am I seeing that right that you've copied from TryAPL?
@Adám That's right.
@petStorm 2⌶ returns a function that can take no arguments I guess?
@HighlyRadioactive 3⌶, 4⌶, etc returns similar functions.
12:50
@petStorm 1) The on TryAPL is "fake" to restrict you from dangerous calls. 2) it derives the function 2⌶ and returns that.
@HighlyRadioactive In a sense. Operators do not inspect their operands until function application time, and since 2⌶ doesn't exist, there's no valid argument for it.
@petStorm If you tried using a real interpreter instead of TryAPL, it'd give you a clearer message:
      2⌶'abc'
DOMAIN ERROR: Invalid I-Beam function selection
      2⌶'abc'
       ∧
Ohhh! It does not exist!
{⍵ ⌶} 819

SYNTAX ERROR
      {⍵⌶}819
     ∧
@petStorm You really need to learn how operators work.
2
So can I put an I-beam into a dfn, and take the integer as an operand?
@petStorm again, dfns can't return functions. Compare that to {+}2 erroring
12:53
@petStorm You can use a variable to supply the with its operand.
E.g. Big←819 ⋄ 1(Big⌶)'Hello' should work fine. Try it!
What is dfns?
@HighlyRadioactive Functions written as one or more statements in braces, e.g. {⍺+2×⍵}
@Adám Can we consider it as a lambda?
@HighlyRadioactive Yes, absolutely. That's what I usually call it on CGCC.
@dzaima What did you find? 60⌶ and anything else?
@Adám i unfortunately seem to have overriden my (dzaima/APL) REPL history (rlwrap doesn't like multiple REPLs open at the same time), but there were some things missing, and indeed that secret one
still have my clipboard history though, there
13:04
@dzaima Ah, you're comparing against 18.0. APLcart is still 17.1
@Adám 17.1 and 18.0 only differed by 1200⌶
...so who's going to teach the systematic APL course?
@dzaima Right. I'm adding the others to APLcart now (plus a few more unofficial ones).
1200⌶ is a really cool one, btw. I take great pride in how it turned out, and I hope it will simply be folded into ⎕DT one day.
@HighlyRadioactive What is that?
@Adám The course that begins and ends with my quote.
@HighlyRadioactive Maybe I'm being dense. What quote?
13:10
"Golfing languages like J and APL..."
@HighlyRadioactive Oh. Right, continuing your intro course. Sure, let's go. Where did we get to and how far did you get?
> how far did you get?
Absolutely nothing. I didn't even open the APL interpreter...
@HighlyRadioactive Have you installed an APL interpreter? If not, I recommend you do so.
Not yet, but I surely will
Which version should I use?
dzaima's APL?
@HighlyRadioactive no
13:15
@HighlyRadioactive I recommend Dyalog APL.
Dyalog APL isn't free...
Free enough for this.
@petStorm It is free as in beer.
@petStorm - Says who? I haven't paid for it, and it works just fine. I may end up paying for it, depending on how a project goes, but for personal use, it can be free.
13:18
@JeffZeitlin I mean free as in "freedom".
> Dyalog is free for non-commercial use but it is not free software.
I prefer to use an APL interpreter that has features as sparse as possible.
/me shrugs. FOSS APL may be a Thing, but I certainly don't insist on it. Dyalog is plenty good enough for me...
This makes me not feel overwhelmed in the number of instructions in the interpreter.
@petStorm Press F12.
13:20
@JeffZeitlin agree
@petStorm - It's a running joke between me and @Adám about me writing 1960s-style code. You don't have to use every feature that's in it...
My first exposure to APL was, in fact, APL\360 on an IBM 3033 when I was at school.
2
@HighlyRadioactive OK, you wrote IsDivisibleBy. Did you get around to write the arithmetic mean function?
HighlyRatioactive went missing by the time of arithmetic mean.
What?
Oh yeah. I wasn't there when you talk about the arithmetic mean thing.
(At least I solved it. That's for sure. :) )
13:28
@HighlyRadioactive OK, so try it now. Using only arithmetic functions, write Avg←{ your code } so you can call Avg 3 1 4 1 5 and get 2.8
You can use TryAPL if you want.
It's going to take me 6 hours to download Dyalog APL?
By the time it's downloaded the lesson is probably done.
Depends a lot on your connection speed.
My connection speed is no good.
13:30
@petStorm So use TryAPL for now. It is plenty powerful for this.
The Dyalog APL executable is probably over 1GB or something.
What's the length function?
@petStorm The exe itself is 12MB but the whole package is 300MB.
Oh wait a minute I found it
I outgolfed petStorm
You had to write that using arithmetic too!
13:34
We're comaring code length here, right? I golfed out 2 bytes. {+/⍵÷+/⍵÷⍵}
Avg←{(+⌿⍵)÷≢⍵}
Yay still 1 byte shorter
@HighlyRadioactive Good. (Of course, you could substitute the silly formula for )
Wait
The parenthesis is unneccesary
Yes, but good for performance.
(I always add unneccesary parenthesises! I once wrote ~{"*"}* to output N asterisks while ~"*"* is just fine!)
13:36
@HighlyRadioactive OK, now let's learn about comparison functions in APL. You've already seen that assignment is so = is free to use as proper comparison. APL has none of the == and === nonsense of certain other languages…
Avg←{+⌿⍵÷≢⍵}
@Adám - because one division rather than tally-omega divisions?
@JeffZeitlin Yes, and summation of integers instead of summation of floats.
@HighlyRadioactive 2-byte difference from the APL advertisement... {+/⍵÷⍴⍵}
@Adám /me nods
13:37
@petStorm You won.
@HighlyRadioactive Actually, why did you use instead of /? They're pretty much the same over vectors.
@HighlyRadioactive No, I win: Avg←+⌿÷≢ but we'll get back to that later.
@Adám APL is magic.
5
(Tacit functions...)
@petStorm After reading the reference I prefer to use instead.
13:39
@HighlyRadioactive Rightfully. Please continue to do so.
I have a feeling that my code is familiar...
APL's simple comparison functions <≤=≥>≠ apply exactly like the basic arithmetic functions like +-×÷, that is, they auto-map.
Also, they return 0 for false and 1 for true. APL has no separate Boolean type (other than internally).
This means that 2 7 1 8 = 1 6 1 8 gives 0 0 0 1
Interesting.
Is -1 true or false?
No.
2
13:42
Neither. (I think?)
Only 0 and 1 singletons are considered false and true.
Anyway, Booleans as 0 and 1 makes it very easy to do statistics on predicates.
Will :If -1 ⋄ asdfasdfasdf ⋄ asdfasdfasdfasdf or something like that error out?
@Adám Are you sure that 1 ≠ 1 here?
@petStorm No :-) of course it gives 0 0 1 1 Nice catch!
Did we learn ⌽¨?
13:45
@HighlyRadioactive Yes, that'd report DOMAIN ERROR: Boolean singleton value required
's reverse, ¨'s each... No, I've never seen these instructions before.
@HighlyRadioactive I don't think so.
⌽¨(4 2)(1 9 8 4) -> (2 4)(4 8 9 1).
Task: Given an integer vector, compute the fraction of even elements. E.g. Evens 3 1 4 1 5 9 2 6 should give 0.375
13:47
What!?
:-D
Wait lemme try it out
Others please don't beat me to the punch
It worked
Let me put it into a funciton
{≢(2|⍵)/⍵} 3 1 4 1 5 9 2 6
Evens←{+/~2|⍵}
Damn!
I hate petStorm!
13:51
That isn't a working program, you win...
Just half a second late!
(With the side effect of being longer.)
@petStorm That counts the odds.
I'm still clever.
@HighlyRadioactive Yours count the evens.
I asked for the ratio.
13:53
Sorry wrong window
{(+/~2|⍵)÷≢⍵} 3 1 4 1 5 9 2 6
Summing Booleans is better than using them to filter and then count.
Evens←{≢⍵÷+/~2|⍵}?
@HighlyRadioactive Yes, and then reciprocal it.
Oops wrong way.
13:54
@HighlyRadioactive You're missing a parenthesis too.
@petStorm That's right.
APL is evil.
"Evil" as in "mean" as in "mean stew"?
Task: Given an numeric vector, count the elements that are 5 or more. E.g. Large 3 1 4 1 5 9 2 6 gives 3
{≢⍸5≤⍵} 3 1 4 1 5 9 2 6
Damn, internet connections, I lose the competition.
@HighlyRadioactive No rush. Try to use the technique we've learned here to beat petStorm on performance!
Where?
14:01
Nevermind.
Large←{+/5≤⍵}?
Well done. Even better is {+⌿5≤⍵} but that's not relevant now.
{1⊥5≤⍵}
We didn't yet learn .
14:02
@xpqz No need for such tricks here as we're summing Booleans.
@HighlyRadioactive is /, but first-dimensional.
Yeah, so now we can pretend we already learned it.
More precisely, it works along the leading axis.
OK, you remember right?
Of course.
@JackJ. Welcome. Interested in APL?
14:04
@JackJ. Welcome. Interested in APL?
@JackJ. Welcome. Interested in APL?
Please be nice.
We're joking!
We're kidding!
@HighlyRadioactive joking can be nice and not nice
14:05
Sure, but spamming a user with pings isn't nice. It can potentially make a lot of noise audible IRL.
Set the audio notificaiton level to none.
How about the division remainder function? Do you remember it?
@petStorm Sure, like me.
@Adám Divmod?
@Adám I used it above somewhere.
14:07
@petStorm Kind of. Just mod though.
@Adám You could have just said the "remainder function"...
Task: Write IsPrime for a single positive integer.
So that APL will be a programming language.
@Adám Ahh. I read about it on the APL advertisement.
@HighlyRadioactive It already is A Programming Language.
14:09
@Adám I know.
@Adám But that's a book.
@petStorm What is this ad you're mentioning?
@petStorm And the name of APL.
@Adám An old issue of the BYTE magazine that features APL.
Oh.
14:10
The B Programming Language, The C Programming Language, The D Programming Language, and The A Programming Language.
@HighlyRadioactive The E programming language, the F programming language, etc.
Are all fun to learn.
@HighlyRadioactive A was actually a dialect of APL.
@HighlyRadioactive There's actually a language for every letter in the alphabet.
@petStorm No, they all exists.
14:11
@Adám A+ evolved from A, right?
But not for F unless you count F#.
@petStorm Right. And from there K and then Q.
@HighlyRadioactive Sure there is F without #, but can we stay on topic, please?
@Adám {T←1↓⍳⍵⋄~⍵∊T∘.×T} 4
Let me work on my solution
That does not look like emoji
14:15
@petStorm It doesn't use the techniques we've learned here.
@Adám Just forgot to negate the result, corrected.
Let me write a solution that suses the techniques we've learned here.
@Adám Okay, I'd just use Wilson's theorem. It's shorter anyway.
@petStorm How about counting the divisors?
Wait a minute!
Save my hard work!
14:19
@Adám Ahh, haven't thought of that before. But let me finish the formula first.
{⍵|!(⍵-1)*2} 5
That is, more tricks I used before.
Composing something with plain arithmetics...
@petStorm Doesn't work.
I guess I am not clever enough to compose mathematical formulas.
Ahh it's going to be ridiculously long...
@HighlyRadioactive It really shouldn't be. Take it step by step. What is your method?
14:25
Plain brute-force method.
Oh yeah
Oh wait...
I got it!!!!!!
A prime number is a number with exactly 2 divisors. Try implementing that.
I implemented that.
Here we go!
Excited to see what your solution is going to be!
Testing...
Prime←{2=+⌿⌊1÷1+((⍳⍵)|⍵)}
@HighlyRadioactive That's good. But since you're anyway using =, why not 0= instead of ⌊1÷1+?
14:29
Partial solution: {(×⍵|⍨⍳⍵)/(⍳⍵)} 10
Because I forgot.
I'm 1+-minded.
Question: Indexing?
Anyway, there's a purely arithmetic formula for primality. It'd be rather awkward to write in TMN…
@HighlyRadioactive What about it? It was the next subject I was about to take up.
Oh.
@Adám Yes, obviously.
But go ahead and ask.
One could to that ceiling trick again.
@Adám How to index an array?
XD
14:33
The simplest way is array[indices]
Alright
Also, how to append, remove and etc. items from array?
We can get to that in a moment. Let's dwell on indexing a bit.
There are other ways of indexing?
Yes, two other ways, plus you can filter with a mask or change values in-place.
What I wanted to point out though, was that APL is an array language. You can use arrays to index arrays.
Array-based language.
14:35
'HELLO'[5 3 2] gives 'OLE'
But this array-based is not the Esolang-sense of array-based.
@HighlyRadioactive What is the Esolang sense?
BF is array-based, but it's a single array, not the arrays we are manipulating here.
Ah.
Gotcha! {2=≢(~×((⍳⍵)|⍵))/(⍳⍵)} 5
14:37
That makes me wonder. Is there stack-based language in the common sense?
@HighlyRadioactive Stack based languages are very easy to learn. GolfScript is an example.
(Golfed: {2=≢(~×(⍳⍵)|⍵)/⍳⍵} 10)
@petStorm Sure, but again you're filtering instead of summing Booleans.
@petStorm In the common sense. That's the Esolang sense.
If you find yourself with a Boolean mask, you can convert it to a list of indices with .
E.g. ⍸1 0 1 1 gives 1 3 4
Ahh, the one I've already been using. (Got to go)
14:39
Yeah, we call it "where", as in "where are the trues?"
Task: Given an integer list, return the even numbers: 3 1 4 1 5 9 2 6 gives 4 2 6
I'm the only person taking the lesson now.
Alright... Solving...
No problem.
{⍵[⍸~2|⍵]} 3 1 4 1 5 9 2 6
Good.
Replicate is nonetheless more intuitive. {⍵/⍨~2|⍵} 3 1 4 1 5 9 2 6
14:47
@petStorm Sure, and here, Replicate is the right thing to use, as we're returning values, not counting them.
@petStorm Now write a more general function which takes a left argument () and returns numbers from the right argument that are evenly divisible by the left argument.
@Adám Any test cases here? I can't solve something without test cases.
RGS
RGS
@Adám you are talking about this, right?
Awful. Monads give me a donain error. 3 1 4 {⍸(⍺|⍵)} 2 2 2
@RGS Yes.
@petStorm Test cases:
      nums←3 1 4 1 5 9 2 6
      1 f nums
3 1 4 1 5 9 2 6
      2 f nums
4 2 6
      3 f nums
3 9 6
      4 f nums
4
      5 f nums
5
      6 f nums
6
      7 f nums

      8 f nums

      9 f nums
9
@petStorm Because | returns non-Booleans.
RGS
RGS
14:54
@Adám with the same problem as yesterday with / trying so hard to be an operator, I got ((0=|)(/⍨⍨)⊢)
I missed a lot.
It's a nice thing to have multiple projects to work on at the same time - so that if you get stuck on one of them, just switch to another. -- My TODO list
Well, not too good when one is a competition and the other one has to be done tonight.
@RGS Yes, this is annoying. At least we're getting an OK mitigation in 18.0. Here, since you have a parenthesis on the left, and anyway use , you might as well use only one: ⊢(/⍨)0=| It won't even be any shorter in 18.0: ⊢⊢⍤/⍨0=|
Where were we?
@HighlyRadioactive A function to return the even elements of a vector.
RGS
RGS
@Adám Ah I like the ⊢(/⍨)0=| a lot
14:58
Oh.
Still there? Alright.
@HighlyRadioactive Sure. But if you want, you can jump straight to the generalisation of taking a left argument and returning the elements from the right that are divisible by the left.
Alright.
What is , though? I can't remember everything from RC.
@HighlyRadioactive You don't need it, but it is an operator that simply swaps arguments of its operand: 3-⍨10 is 7.
RGS
RGS
@HighlyRadioactive ⍨ can also be used as an emoji when you are confused, for example
15:01
Yes, it is a frown.
Let me keep track of it
RGS
RGS
@Adám I am going to install the APL kernel and give it a go. I will have a go at summarizing one APL Cultivation lesson into a jupyter notebook and then I'll share it with you to get some feedback.
Given the perception you have of what I already know of APL, what class would you suggest I start with?
You mean summarizing a class into a file?
@RGS That'd be amazing. You don't need to follow the lessons exactly 1:1. Look at the TryAPL lessons under the heading "Closer Looks at Some Functions" and select another group of functions for such a lesson.
(I'm working on a Cellular Automaton project. Cellular Automaton is hard, so I will probably be inactie for a while.)
15:11
@HighlyRadioactive OK, do you want to stop here? (Also, APL has a CA built-in: )
No I don't want to stop here!
@RGS You could e.g. do comparison functions or indexing/picking (dyadic and ).
@HighlyRadioactive OK, then how did it go with that filter-by-divisibility function?
I'm just going to leave for 10 minutes or something.
@Adám Haven't tried it yet... (ashamed)
@HighlyRadioactive OK, then ping me when you've got it.
Let me do my 10-minute work first...
My work is only half-finished, but I promised that I will be back.
@Adám FilterByDivisibility←{⍵[⍸~⍺⍺|⍵]}
15:25
@HighlyRadioactive Did you test that with arguments other than 1 and 2? (Also, why ⍺⍺ and not just ?)
@Adám Uhh... I know there is something wrong with it.
Isn't ⍺⍺ the left operand and the left array?
@HighlyRadioactive Correct. Well, is the left argument. Even an operand can be an array (as you just did).
Alright then. When shall I use ⍺⍺?
@HighlyRadioactive When writing an operator (which you'll rarely need to do).
Oh.
Okay then
15:47
I've leaving now, gotta sleep.
I will come back tommorrow
○/
RGS
RGS
@Adám comparison functions you mean <≤=≥>≠ ?
06:00 - 16:0016:00 - 00:00

« first day (1188 days earlier)      last day (1760 days later) »