« first day (1655 days earlier)      last day (992 days later) » 

3:23 AM
Recently Chez has been beaten by Gambit Scheme in benchmarks, which is a "C as codegen backend" implementation :D
 
 
1 hour later…
4:41 AM
@user Kotlin is a better Java in many ways. It also compiles to JS and native, but since it's very much based on Java it shares many of the same limitations.
There are a lot of things Kotlin could do but doesn't, simply because its implementation wouldn't be efficient on the JVM. This limits the number of improvements they are able to make.
 
I think user's main language is scala
 
I really would love to see multimethods in Kotlin. So much of my code is really cumbersome because that's not available. Also something similar to CLOS :around: methods would be incredibly useful. However, the problem there is that people with no exposure to good object orientation systems are simply incapable of comprehending why they are good.
 
 
4 hours later…
8:23 AM
is there an inverse function for ?
 
9:08 AM
Seems I can use grade
 
0
Q: What are the APL2 equivalents for QUAD VI, QUAD FI, and QUAD VFI?

OlenkaI've been looking at APL code samples, and some of them use QUAD FI, QUAD VI and QUAD VFI. The first two are described in my textbooks (APL an interactive approach). When I try these in APL2, I get a VALUE ERROR. Is there a equivalent in APL2?

 
 
2 hours later…
11:00 AM
@EliasMårtenson I think the improvements they do make improve QoL for Kitlin users significantly. I do think it should incorporate some features fromScala, but honestly, many features of Scala are considered useless for practical stuff by many (most?) java devs
@Razetime I wish. I don’t code that often, but the most work I’ve done has been in some java projects (mine+shared)
Trying to work apl into my list of most used languages :p
 
11:23 AM
oh, so only for golf
 
can't golf, what to do?
 
lol i was replying to user
 
@Razetime and so
 
@LdBeth play checkers
 
I learned scala by answering on SO lol
@LdBeth Play real golf
Create a gensim api for apl so i can use it instead of python :p
Brw, is there a recommended way to interop with C? (For dyalog apl)
 
 
2 hours later…
1:23 PM
@user ⎕NA for interfacing to C from Dyalog
 
1:52 PM
(2∘|)1∧+∘÷\32⍴1
Why the 0.9999999998?
Here "explicitly" it doesn't appear 2|1 2 3 5 [...] 832040 1346269 2178309 3524578
 
2:19 PM
probably 1∧ returns an array of floats which causes that
still weird
      2|⌊1∧+∘÷\32⍴1
1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0
@MasterQuiz flooring the array works
 
(⌊≡⊢)1∧+∘÷\32⍴1 They seems to be the same thing
 
⎕DR 1∧+∘÷\32⍴1
645
⎕DR ⌊1∧+∘÷\32⍴1
323
 
@MasterQuiz not if you set ⎕CT to 0
cool old APL stuff (thanks @Razetime) cse.yorku.ca/museum/MCM
 
It seems to have stuff usable for the wiki
 
2:36 PM
Variations on the fourth power on 1E4 long vector.
cmpx  '{⍵*4}⊢⍳1E4' '{z←⍵*2⋄z*2}⊢⍳1E4' '{⍵*2}⍣2⊢⍳1E4' '{⍵×⍵×⍵×⍵}⊢⍳1E4' '×⍨⍣2⊢⍳1E4' '×⍨⍤×⍨ ⍳1E4' '×⍥(*∘2)⍨⍳1E4'
  {⍵*4}⊢⍳1E4       → 3.9E¯5 |   0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
  {z←⍵*2⋄z*2}⊢⍳1E4 → 1.0E¯5 | -74% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
  {⍵*2}⍣2⊢⍳1E4     → 7.3E¯6 | -82% ⎕⎕⎕⎕⎕⎕⎕
  {⍵×⍵×⍵×⍵}⊢⍳1E4   → 7.6E¯6 | -81% ⎕⎕⎕⎕⎕⎕⎕⎕
  ×⍨⍣2⊢⍳1E4        → 6.6E¯6 | -84% ⎕⎕⎕⎕⎕⎕⎕
  ×⍨⍤×⍨ ⍳1E4       → 6.7E¯6 | -83% ⎕⎕⎕⎕⎕⎕⎕
  ×⍥(*∘2)⍨⍳1E4     → 9.5E¯6 | -76% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
 
why is the builtin the slowest ⍨
 
what about (×⍨××⍨)
 
1e4*4 overflows into floats, and then you must use the proper power operator to get the expected precision
 
@rak1507 Performs very similarly to ×⍥(*∘2)⍨⍳1E4
 
makes sense
@Marshall not sure what you meant about python in the arraycast episode tio.run/##K6gsycjPM7YoKPr/…
 
2:44 PM
Oh, I didn't know it was out.
 
yep
 
I think the thing Python doesn't let you do is set nonlocal variables, but you can access them. That's why it has a nonlocal keyword.
 
yeah
 
Implementation of * is a mess. There is code starting in 17.0 maybe to recognize a constant right argument, but I think I found it's only consistently better when it's 2 or 3. For other values it ends up using multiplication for small (<16 or something) exponents, but one scalar at a time.
 
you can definitely set nonlocal variables in python if you like... w3schools.com/python/…
 
2:51 PM
@dzaima Thanks for the feedback. I tested for fun on different vector lengths from 1E2 to 1E7.
 
@brgal you could also test something like 1e7⍴⍳100, so it stays as integers but still is a long vector
 
@Marshall ×⍨ This is still better than (2*⍨) or (*∘2)
 
@MasterQuiz Maybe it is. I don't remember everything and don't feel like digging into it.
 
3:09 PM
×⍨ is the second example you introduced in your 2019 Dyalog talk on tacit programming with Dyalog V.18.
Then I went writing variations for the fourth power for practice and cmpx them a little. I was quite surprised by the results concerning {⍵*4}⊢Vector
https://www.youtube.com/watch?v=czWC4tjwzOQ
Will continue to watch your video !
Thanks for your input !
 
@user There is a QUADNA workspace that can be an example
 
@dzaima Good idea ! Thanks !
Here is what I got :
  {⍵*4}⊢1e7⍴⍳100       → 6.2E¯2 |   0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
  {z←⍵*2⋄z*2}⊢1e7⍴⍳100 → 1.0E¯2 | -84% ⎕⎕⎕⎕⎕⎕⎕
  {⍵*2}⍣2⊢1e7⍴⍳100     → 1.0E¯2 | -84% ⎕⎕⎕⎕⎕⎕⎕
  {⍵×⍵×⍵×⍵}⊢1e7⍴⍳100   → 1.9E¯2 | -71% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
  ×⍨⍣2⊢1e7⍴⍳100        → 1.0E¯2 | -84% ⎕⎕⎕⎕⎕⎕⎕
  ×⍨⍤×⍨ 1e7⍴⍳100       → 1.1E¯2 | -84% ⎕⎕⎕⎕⎕⎕⎕
  ×⍥(*∘2)⍨1e7⍴⍳100     → 1.5E¯2 | -77% ⎕⎕⎕⎕⎕⎕⎕⎕⎕
 
¯\_(ツ)_/¯
 
      cmpx '(⌊0.5+⊢)123.3' '⌊0.5+123.3' '⌊.5+123.3'
  (⌊0.5+⊢)123.3 → 4.0E¯7 |   0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
  ⌊0.5+123.3    → 4.4E¯8 | -90% ⎕⎕⎕⎕
  ⌊.5+123.3     → 4.3E¯8 | -90% ⎕⎕⎕⎕
well, glad to know is isn't necessary to write 0.5 instead of `.5'
 
@LdBeth APL is tokenized before execution, so that'll never make a difference
 
3:20 PM
ya, I'm confused a little by the "exactness" of idiom recognization in the manual
 
@LdBeth When you fix, you'll notice that it change it to 0.5. Wondering if there's a difference when code-golfing
 
 
1 hour later…
4:33 PM
typo in arraycast notes: "BQN Ccommunity"
 
there are so many typos in the recent arraycast transcript and notes I've stopped even mentioning it...
 
oh lol
 
the transcript is auto generated I think so that's fair enough
 
Mostly it's just punctuation being wonky. To be fair my sentence structure gets kind of crazy.
 
sure but a lot of words and phrases just get completely butchered
 
4:39 PM
"But yeah, you can write BQN like this if for some horrible reason you happen to not be me. You can. You can choose this other style."
That's a stutter, not me turning into a self-help book.
 
4:54 PM
I was trying +/{⍵/⍳⍴⍵} 1 pco ⍳2000000 to solve this projecteuler.net/problem=10 , and after a lot of time it gave me this 1.429138289E11. Is there another better way to do this? Or is it possible to find somewhere the 2009 Winner's presentation?
 
+/⍸10 pco 0 2E6
 
142913977855 Is a wrong solution
 
⎕IO←0
+/⍸10 pco 1 2E6 for ⎕IO←1
 
Why it's faster?
 
if you look at the code for pco, 1 pco uses ¨ (slow), whereas 10 pco uses a sieve (fast)
 
5:01 PM
Cause it has a specific algorithm?
 
@rak1507 Can I post it here github.com/Masterquiz/Project-Euler ?
 
sure
 
But I don't know how to quote you on GitHub
 
no need (if you really want to credit me you could put it in a comment but I don't mind)
 
5:08 PM
@dzaima @LdBeth Thanks, I'll check that out!
 
 
3 hours later…
Hmm
8:21 PM
Hey guys, I'm a python programmer who just came across APL and is fascinated by the occam's razor quality of it. Typically, when I'm learning a new language I try to re-implement some of my favorite 'personally figured out' algorithms. But with APL, I'm afraid of botching this because my way of thinking might not leverage APL's expressivity and power. So I want to describe my idea and hoping someone actually says "Oh...you can do it with 1 symbol".

The algorithm I want to code is six degrees of separation on Twitter. Given 2 usernames, find the connections between them.
Because I added lots of features to this algorithm (including counting likes, mentions, and to what degree those are symmetrical for 2 users (e.g. Target User and User 23 in example above)), it ended up being around 1500 lines in Python. I wonder how much that could shrink.
 
8:39 PM
Don't know if this migth help, but this problem remember me about this problem adventofcode.com/2020/day/7 . You can consider the bag as the person, and the bag within the bag as following. I think that the problem is the same, if you take as input a similar matrix using ]HttpCommand library to web-scripe twitter
Here there's a list of people who migth have resolved this problem aplwiki.com/wiki/Advent_of_Code
 
Hmm
Yeah this seems very relevant, thank you so much!
 
Here there's a tutorial (I don't know the level) on this library https://xpqz.github.io/learnapl/http.html#:~:text=Authorization%3A%20Basic%20dXNlcm5hbWU6cGFzc3dvcmQ%3D-,Web%20scraping,-%C2%B6
And this is the full (I think) documentation http://docs.dyalog.com/latest/Code%20Libraries%20Reference%20Guide.pdf
 
Hmm
9:16 PM
Perfect! even easier for me
 
Probably the most difficult part, or at list what I couldn't do, is take the content from a Twitter page... If you discover how, I can help you with the remaining. Let me know
 
Hmm
9:33 PM
A very generous offer, thank you. I will try to poke around to see if it's possible to do it an API-less way. But if all else fails, I might just end up using their API.
 
@Hmm Well there's not a single symbol for it but it probably could be a lot less than 1500 lines, sounds like the number of people in each degree would grow pretty fast though, even picking a small account if they follow someone with a few million followers soon you're having to make millions of requests, right?
 
Hmm
@rak1507 Yes the number of people does grow pretty fast although I have been able to go up to 5 degrees in the past. I think the trick is to go through the following not the followers (which tends to be a larger number), and if the person is by any chance following hundreds of thousands of people, or even tens of thousands, I tend to skip them because who really is reading tens of thousands? A better approximation at that point is who they're mentioning or liking on a regular basis.
 
yeah, that makes sense
 
Not too related, but this reminds me also go from a word to another, changing a character at a time, in the shortest path. But I couldn't find the link...
 
Hmm
10:01 PM
Interesting connection. I think it might be still useful to assume we have the data and try an example, like with a set of strings.
Some googling online, someone said this is creating a list of strings though please correct me if I'm wrong:
a ← 'here' 'are' 'some' 'strings'
I know it's possible to check if something is in a list like so:
1 ∊ (2, 1, 3)
But when I do
'here' ∊ a
Output is: 0 0 0 0
I will keep digging
 
(⊂'here') ∊ a
You have to enclose 'hello', otherwise it will check if there's each letter in a
 
yeah, you'll need (⊂'here') ∊ a for that, it's basically doing a 'map'
^
 
Hmm
oh that's really interesting
Similar to numpy's any
 
∊ can be roughly thought of like, for i in left arg: i in right arg, so if the left arg is 'here', it'll go 'h' ∊ ..., 'e' ∊ ...., etc, so the left arg needs to be the equivalent of ['here'] or (⊂'here')
⋄ 'here' 'are' 'notinthelist' ∊ 'here' 'are' 'some' 'strings'
 
@rak1507 1 1 0
 
Hmm
10:09 PM
Ah now it make sense, thank you. It's like looping over the characters as an array
'here' 'are' ∊ a
1 1
 
yep
 
Hmm
Now this was unexpected:
'are' 'here' ∊ a
1 1
I expected: 0 1
Or rather
0 0 or something
 
they're both in the list, order doesn't matter
 
Hmm
true, I guess I'm wondering how to know which ones matched
 
@Adám Will the android build be available for the public ? or is it for dzaima's eyes only? Over the summer I maintained a ssh tunnel on my phone for this specific purpose and would be happy if the app didn't freeze everytime my network connection got dropped
 
Hmm
10:13 PM
Never mind I think I at least have some inkling
I can know it by the order I gave
'some' 'not' 'here' ∊ a
1 0 1
index: 0 1 2
 
Something like this?
'strings' 'here'{⍺/⍨⍺∊⍵}a
 
Hmm
Oh cool:
'strings' 'here' 'not' {⍺/⍨⍺∊⍵}a
strings here
 
You use a boolean array, from ⍺∊⍵, to mask the rigth array 0 1 0 1 1/1 2 3 4 5
{(⍺∊⍵)/⍵} [To remove brackets it becomes ⍵/⍨⍺∊⍵]
 
Hmm
Yeah I think I need to study it a bit
are the curly brackets a function
or making a (dyadic?) function
 
@Hmm It defines a function, In which ⍺ refers to it's left argument and ⍵ to it's rigth argument aplwiki.com/wiki/Dfn
 
Hmm
10:30 PM
Okay now that part makes sense:
2 {⍺+⍵} 16
18
Man this is SO cool
1 0 1 0 1 / 'Heart'
Hat
 
@Hmm Welcome to APL
 
@0xACE I don't have it (yet, of course; it'll of course take some time for Dyalog to get someone to get it working and publishable). And me only having it wouldn't be beneficial to anyone either.
 
Hey @dzaima :D, Oh i thought you already had a private android build because of previous discussions... I guess you are right that it'll be public when you put it that way :D Thanks
 
10:47 PM
if I had a Dyalog Android build, I'd already have chatted about it and would have the app working in a day or two anyway
 
Hmm
11:08 PM
Okay I'm gonna try to really break it down to make sure I understand:
'here' 'are' 'some' {⍺∊⍵} 'not' 'are' 'some'
Result: 0 1 1
'here' 'are' {⍺∊⍵} 'not' 'are' 'some'
Result: 0 1

{⍺∊⍵} = For every element in the left list, check if it's in the right list. If it is, put a 1 for its index, else put a 0.

/ = For any element that has a 0 at its index, delete it.

E.g. the example you gave:
0 1 0 1 1/1 2 3 4 5
Result: 2 4 5

If an element is added:
0 1 0 1 1/1 2 3 4 5 5
Result: LENGTH ERROR
Because both sides don't match I assume.
Okay I think I almost get it now, perhaps missing a bit of an intuition for it but that will grow I'm sure.
Wow just from a simple example.
 
If you see the dyadic "/" function, you'll notice that it "replicates" the element to the rigth ⍺-times
Try:
2/1
2/1 2 3

So replicate an element 0 times is equivalent to delete it
 
Hmm
I see, okay makes sense:
0 1 2/1 2 3
Result: 2 3 3
 
11:30 PM
> # the horrible bastard child of two operating systems
Apparently that's what Dyalog thinks of Cygwin :P
> If it's stupid but it works, it's still stupid, but at least it works.
Btw, how does one install pynapl? Simply cd-ing into pynapl/pynapl and running ]load Py tells me that Py.dyalog can't be found in the SALT user folders, so how can one add files in some other directory to the path that's searched?
 
11:48 PM
@user Once I've tryied to use it, but I've never been able...
 
@user It seems the full path works too, so ¯\_(ツ)_/¯
 

« first day (1655 days earlier)      last day (992 days later) »