« first day (1207 days earlier)      last day (1448 days later) » 

6:17 AM
@RichardPark An update about my issues with your Perl Weekly Challenge submissions.. It seems like it may in fact be an issue with Jupyter integration? The code indeed interprets fine on TIO.. But when trying in Jupyter-Lab: imgur.com/a/lB8nPMR
The code in question is from task 1 of week 56 but I have similar issues with each example I try in Jupyter. Here it is on TIO (url shortener used to get around SX message length limits)
 
6:46 AM
It does appear to be an issue with the Jupyter kernel. Converting the example to a tradfn fixes all the errors: imgur.com/a/rt4tx17 .
 
7:07 AM
@ab5tract does that keyboard have no "key" (⌸)? Then it's just a "board".
 
7:37 AM
Indeed. I'm still very much an APL newbie and didn't know to check for modern vs APL2 differences (it should have occurred to me though). Those keycaps are quite beautifully rendered, I especially like the contrast of displaying the APL glyphs in red. But it's unfortunately targeted towards an audience who is purely interested in the aesthetics of the keys rather than programming APL so I'm not even sure if they would be interested in switching to a modern style.
BTW if anyone is interested in a set of the keycaps used on the Dyalog kb, I was informed that they can be ordered in batches of 10 from their supplier (once things get back to normal that is). That doesn't seem like such a high threshold for a group buy.
I've got all only one ⌸ , leaving my ⌸board to board ratio kind of pitiful at the moment. :)
 
 
1 hour later…
9:07 AM
Is it possible to have an array of functions? I'm trying to apply a different function based on what the signum of a number is
 
9:27 AM
actually, i've figured a better way to do it (though i would still be interested if it is possible)
 
ngn
9:40 AM
@JoKing only through hacks with namespaces
a←⎕ns¨⍬⍬⋄a[0].f←+⋄a[1].f←×⋄a.f ⍝ a.f is an array of functions
 
ngn
9:53 AM
@xpqz faster prime sieve:
P←{⍵<3:⍬⋄a←0@1⊢1@p⊢⍵⍴⊃×/(×/p)⍴¨~1↑¨⍨p←p/⍨⍵≥×\p←2 3 5 7 11 13 17 19 23
 ⍸a⊣a[∊1,dd+d2×⍳¨1+⌊(d2←d×2)÷⍨(⍵-1)-dd←d×d←(≢p)↓⍸(1+⌊⍵*.5)⍴a]←0}
10pco in dfns could be easily sped up by adding more small primes for sieve initialisation
 
RGS
10:12 AM
@ngn is this faster just because you init'ed with more primes or did you also change the method?
Also I'm seeing some @ usage there; I believe @ got faster in 18.0 so that might be even faster in 18.0
 
ngn
@RGS it's basically the same method as pco, i just simplified it a little
later i'll try more ideas for optimisation
@RGS @ is slower in this case, i tried it :)
i believe the problem is not in @'s implementation itself but in the refcounting of local variables
 
RGS
@ngn +← 1
 
ngn
if i do 0@i⊢a at the end, variable a remains ref'ed and the @ has no choice but to copy the whole array
if i do a[i]←0, the interpreter can figure out that the array can be modified in place
in ngn/k i don't have this problem - i decrement the refcount of a local variable just before its last usage in the { }
 
RGS
@ngn Because the @ operator is not supposed to modify a variable in-place, is that it?
 
ngn
10:27 AM
@RGS it is supposed to, but only when the refcount is 1
 
RGS
@ngn I mean in general; if I have a variable v and use @ on it at some point and if I'm using v later on, @ didn't modify v right?
 
ngn
the existence of the local variable a "pins" that chunk of memory (i.e. makes its refcount=2, or in other words: it claims that it's in use though it really isn't)
 
RGS
I'm asking because I really don't know; I'm not arguing you are not right :P
 
ngn
@RGS no, that doesn't happen. apl arrays are immutable (good). only dyalog namespaces are mutable (bad).
 
RGS
Because the name of @, "at", really makes it look like I'm always doing in-place assignment
@ngn ok
so the refcount things you are talking about have to do with moments when @ could reuse the memory already spent with some array, correct?
 
ngn
10:33 AM
@RGS it modifies it in place when the refcount is 1, i.e. when you don't create your variable v. then @ would know that it's the sole user of that piece of memory, and it can do whatever it likes with it.
 
RGS
@ngn Alright, I think I understand.
And in an expression like v ← 1 2 3 4 ⋄ 5@2⊢v ⋄ (some other code where v doesn't show up) does @ modify v in-place?
 
ngn
@RGS refcounting is something a lot more general than @
@RGS as far as i can tell, no
 
RGS
@ngn but it could, right?
 
ngn
but v[2]←5 does
@RGS yes, in theory it could, if that's the last usage of v
but apl is way too dynamic for such optimisations
 
RGS
@ngn alright; thanks for the explanation
@ngn really?
 
ngn
10:37 AM
there could be closures that use v
 
RGS
Ah I see
 
ngn
or the user might want to see v in the debugger - some apl-ers have the habit of debugging as they code, so the next line might not have been written yet :)
 
RGS
@ngn oh wow, really??
I did not know people would do that
Sounds fun!
 
ngn
@RGS not if you're the one implementing the language :)
 
RGS
@ngn just to be sure, "closures" refers to what I usually call "scopes"? like in function calls and whatnot?
 
ngn
10:39 AM
@RGS yeah, something like that
 
RGS
and when defining a dfn inside another dfn, the inner dfn has access to the vars of the outer one
 
ngn
@RGS yep
which sadly isn't the case in k
 
RGS
Why did they choose to make it like so in k?
 
ngn
@RGS because it's more efficient
without closures you only need a plain stack
 
RGS
alright
 
ngn
10:42 AM
with closures you need a "cactus stack" - stack frames are allocated on the heap and form a tree-like structure
i'm not really sure how significant this is for performance
 
RGS
"cactus stack" xD
Had never heard of it
 
RGS
It makes sense, thanks
 
@ngn it's obviously pretty bad if you plan on calling functions a lot, but this is APL, where we'd hope array sizes greatly outweigh function call count (though whether that actually happens is a separate question and i run into the slowness of dfns a lot)
 
11:02 AM
@ngn do I recall correctly that K relies entirely on dynamic scoping?
 
ngn
@ab5tract no! that's apl tradfns
 
Ah, crossed wires. I've ingested a lot of info on both of them in the last 5 or so weeks since I initially fell into "The K Hole That Changed My Life" :)
Ah, it seems to be a mistaken leap in logic that I made from the lack of lexical scoping in K. TIL no lexical scoping ≠ only dynamic scoping.
 
ngn
@ab5tract it's still lexical, but limited to locals and globals only
unlike tradfns, k doesn't expose the caller's locals to the callee
 
@ngn Jeffry phrases it a bit differently here WRT lexical scoping, but I take your point.
 
@ngn i would still call that "no scoping". I would hope every language with imperative functions doesn't randomly hide local variables, and globals aren't really "scoped" either
 
11:15 AM
@ngn Right that's a great point. Dynamic scoping requires explicit implementation, not a side effect of not having lexical scoping like I was mistakenly assuming.
 
ngn
fair enough - "no scoping" :)
 
Dynamic scoping can be pretty cool, if unwieldly, but I must admire the K approach of just deciding not to scope. Is K the Bartleby of (non-esolang) programming language design?
 
ngn
@ab5tract haha, sounds right :) (i've just looked up bartleby in wikipedia)
 
@ngn This thought brought to you by my morning spent watching Simon's talk from Dyalog'16: youtube.com/watch?v=1YwhNC433XQ
:)
 
ngn
@ab5tract it's not like k's author refuses to make changes, though. he rewrites from scratch every few years and actively seeks and eliminates inefficiencies. "bartleby" is more like the k interpreter - doing the absolute minimum to perform a task, ideally nothing.
 
11:41 AM
Ah, there's more nuance to the story, but the main symbolism of Bartleby is that nothing could force him to do something he didn't want to do
But yeah, I was talking more about the design than the designer, as it were :)
 
ngn
12:05 PM
@RGS i ran into another problem with @ - repeated indices
 
RGS
@ngn wdym?
 
ngn
a←,0⋄a[0 0]+←1⋄a ⍝2
1+@0 0,0         ⍝1
 
RGS
@ngn Hm I see...
 
ngn
not a bug. i know that by design @ applies the left operand to the selection as a whole.
 
RGS
Alright; the point being it just works differently, right? but tbh I don't know if I appreciate the a[0 0] +← 1 working that way...
it looks weird
on the other hand I feel perfectly fine with simply indexing with repeated indices
Maybe I'm just slightly bipolar
 
ngn
12:32 PM
@RGS useful for histograms. i wouldn't say weird.
 
 
8 hours later…
RGS
8:08 PM
@Adám now I used ⎕load again (and it worked) but this time it didn't auto complete the path for me...?
 
@RGS afaik only the )-commands auto-complete
 
RGS
8:38 PM
@dzaima none is doing it for me and I'm 99% sure last time it was the ⎕ that did; if you recall correctly I struggled really hard with using the )load, it didn't even work D
 
@RGS another idea - how about ]cd C:/path/to/dir/of/file and then )load file.dws?
 
RGS
@dzaima (the loading worked, just not the autocompletion); also iirc someone said a couple of days ago one ought to be careful with ]cd
 
@RGS ah, so that problem's gone and a new one appeared.. )load auto-completes for me, though i'm on linux
 
RGS
well, I'm not too worried; I want to code, not dwell on weird auto-completion problems
thanks for your time :)
 
/me also prefers coding to troubleshooting the IDE...
 
8:48 PM
i though quite like investigating pointless off-topic interesting stuff, and as a result i get way less done.. ¯\_(ツ)_/¯
 
RGS
@dzaima maybe you don't understand... me too xD but I spent all day doing those things and I really want to write some APL... so it's now or never!
 
@dzaima that said, i need to get back to trying to bind the caps lock key to alt+tab, xmodmap freezing cinnamon won't stop me!
 
9:25 PM
@dzaima i really don't like X11's keyboard/language management stuff.. I have no clue what part of the thing currently makes my caps lock key open xterm (i've deleted/overwritten all occurrences of it and re-called everything i did to get that to happen), but it does..
 
RGS
9:44 PM
Does APL handle rational numbers with arbitrary precision?
 
@RGS NARS2000 has rational numbers as a type, but that's the only APL i know does
 
RGS
@dzaima so doing arithmetics with integers can still lead to floating-point inaccuracies?
 
@RGS yeah, Dyalog, from a users point of view, uses IEEE754 64-bit floating point numbers everywhere
 
Honorable mention: J has them
 
@ab5tract right. noting only NARS2000 felt wrong, that's why
 
9:47 PM
I got used to them in Raku. Hard to accept floating point as a "good enough" any more after that.
Not the fastest of language features though, especially if you want to use them as your default/underlying representation of mixed numbers
 
RGS
@Adám I still have all kinds of uncomfortable problems with the Dyalog APL competition website. One hour ago it loaded just fine and I was able to submit my last phase 1 solution and whatnot. Now I wanted to make a partial Phase 2 submission and the website is giving me a 504 Gateway Time-out error
 
10:40 PM
@ab5tract As per the wiki you have to begin the cell with ]dinput.
@RGS Your session times out after 30 minutes, but I thought we handled that more gracefully than that.
 
RGS
@Adám ah ok, when I understand the problem I'm less uncomfortable with it. How can I fix it locally?
 
@RGS Just reload the page if you've let it sit open for that long.
@RGS Yeah, you're right of course. Do you want to PR a change to all 4 of those, so they check "the opposite"?
 
RGS
@Adám already did, it's the second half of the PR I submitted
@Adám I was checking again and that's why it took so long but of course I already refreshed the page. It still gives the 504 error.
 
Oh, sorry. I'm just coming back online after my 27 hour break.
 
RGS
@Adám I know, I'm helping you catch up :P
 
10:50 PM
@RGS That worries me. I'll tell Brian (you saw him briefly), who is the one dealing with the server part of the site.
 
RGS
@Adám Alright; feel free to give him my email if he needs to reach out to me. I am not too worried, I already downloaded the 2020 stuff for phase 2 and I'm still solving the problems :P
 
@RGS This was helpful. Brian seems to have identified the issue.
 
RGS
@Adám great, lmk if I can be of further assistance
 
11:21 PM
@RGS Should we not insert the word "strictly" in the spot corresponding to "full" for the without-diagonal triangular matrix checks?
 
RGS
You can replace every occurrence of "without diagonal" with strict
I opted for the more verbose "without diagonal" because I figured "strict" would be a mathematical standard common programmers are not aware of. FWIW I myself didn't know/remember about it, and I'm (a couple of months away from being) a mathematician
 
But at least "strict" should be a synonym (=keyword) then.
Also, there's no need to repeat words from the description in the keywords.
 
RGS
@Adám oops :/ my bad
I can fix both of these ^ if you don't mind waiting until tomorrow night/Monday
 
Cool. And btw, I've never seen such a well-written PR-accompanying text!
 
RGS
@Adám thanks :) I wanted it to be clear and self-explanatory hence the effort
I'm going offline now, ○/
 
11:35 PM
○/
 
11:52 PM
Anyone have a recommendation for a PDF or print book for "J for the Dilettante APLer"?
 
@JeffZeitlin This?
 
@Adám - That's definitely a help; thanks!
How different are J7 and J9?
I found some stuff on J7, but the current download from JSoftware is J9
 
@JeffZeitlin I think J, like APL, is mostly backwards compatible, unlike K.
@JeffZeitlin Check out release notes.
 

« first day (1207 days earlier)      last day (1448 days later) »