« first day (626 days earlier)      last day (2023 days later) » 
00:00 - 22:0022:00 - 23:00

12:22 AM
@nathanrogers ×
 
12:48 AM
(Monadic ×, obviously.)
 
(Of course)
(How can sign be dyadic)
 
(Now I'll spend all night trying to think of how dyadic sign could be useful)
(Wait, I got it! Dyadic × could take the left argument and add the right argument that many times, and then multiply by the XOR of the signs! Oh wait)
 
(Nah, if anything, it'd be determining sign of 0 default 0)
 
(Why are we even discussing this)
 
1:29 AM
(I don't know)
 
 
4 hours later…
5:32 AM
well taking the sign wasn't much help in either case
I'm at a loss for how to solve the balanced bracket problem without the stack solution.
 
@ngn that’s right
@ngn x(f g h i)y ←→ x f (g y) h i y
 
 
1 hour later…
ngn
6:51 AM
@nathanrogers Another way to solve this is to keep removing ajdacent pairs of () or [] or {} until convergence. If you end up with the empty string, everything's properly balanced.
 
ngn
7:29 AM
I don't quite understand if that's the algorithm you are trying to implement there, actually.
g←{0@(⍸4=⍵)⊢⍵} could be just g←4|⊢
 
 
1 hour later…
8:52 AM
warning: solution to the bracket matching challenge; No idea if this will always give correct answers, but it was fun to write and doesn't use explicit-ish loops :D
 
 
1 hour later…
10:07 AM
The Apl loop I would say use less memory and is more fast than using set loop with ¨
 
10:17 AM
@RosLuP what APL loop?
 
ngn
@dzaima I think he was referring to :For
 
\o/ (with a bit of modifications because differences) I got that thing to work in my APL
 
ngn
10:35 AM
@dzaima that's way too long
 
@ngn yeah, but I couldn't find many improvements to that specific idea. This is what I have now (with the only difference to my APL is the need to remove ⊃¨)
 
ngn
Nathan, avert your eyes please :)
''≡{⍵/⍨2∧/1,¯3≠2-/'([{)]}'⍳⍵,0}⍣≡
(it assumes the input consists only of brackets)
 
10:50 AM
@ngn I specifically didn't want to use
 
ngn
@dzaima oh, ok, i'll try without it. btw, i've just realised the above fails for "))"
 
@ngn also for (((((((()())())())())())())())()
 
ngn
@dzaima (⍳≢s){(⍺⊃s),⍨⍵⌿' '}¨... - you could have s itself as the left arg and use instead of ⍺⊃s
 
@ngn that's already in that improved version linked in that message
 
ngn
@dzaima oops.. it seems i opened the wrong link
@dzaima s{⍺,⍨⍵⌿' '}¨ -> s↑⍨¨-1+
¯1+2×⍵ -> -¯1*⍵ and some minuses are likely to cancel out
 
11:03 AM
@ngn seems to break it for )( & )
 
ngn
right... i'd better try to understand why you're prepending those spaces
 
@ngn to separate the levels
 
ngn
even if they are negative levels?
 
@ngn about negative levels I have no idea :p
those should probably be checked separately beforehand, but i'm lazy
 
11:24 AM
this is what I got for the boring ⍣≡ version
 
ngn
@dzaima so, in your non-⍣ version you're grouping the chars according to their level? that smells like ⌸
this passes the tests: (~∘' ')¨↓⍉↑s{⍺,⍨⍵⌿' '}¨ -> s⊢∘⊂⌸⍨
 
@ngn o.O
so that's what dyadic is for
 
ngn
@dzaima :)
aka "group by"
 
I looked at it for like 5 minutes thinking about implementing it and gave up understanding it
on the topic of ⊢∘⊂, how about 2 monadic operators for {⍺⍺ ⍵} and {⍺⍺ ⍺}?
 
ngn
11:39 AM
@dzaima you mean you want to introduce new ones?
 
@ngn mhm
ಠ_ಠ why did I think there were right & left tack underbar versions?
 
ngn
I don't know. It's hard to reason about what we should or shouldn't add to a language if its goals are unclear and not objectively measurable.
 
ngn
11:57 AM
@dzaima another simplification: ⊃¨+/¨↓⍉ -> +⌿
 
@ngn i never know when to use , though that should've been obvious..
:47158434 I know even less about the brackets :p
 
ngn
@dzaima that's just /[⎕io]. yep, you can specify along which axis reduce operates
 
ngn
12:16 PM
(⊢≡1 0⍴⍨≢) -> {⍵≡≠\=⍨⍵}
 
@ngn I know that that bracket notation exists, I just barely understand how the hell it works
 
ngn
@dzaima do you want to know the technical details? :)
 
@ngn sure?
 
ngn
it creates a "derv" ("derived function" or maybe in this case "derived operator") - a pair of "/" and the thing in square brackets
I don't know if this will show here, let me try...
⎕←+/[2]
 
@ngn
    [2]
  ┌─┘
  /
┌─┘
+
SYNTAX ERROR
 
12:24 PM
the idea of how it works makes sense to me, just I can't be bothered to start thinking about how to implement all the builtins to have it changeable, and until I just imagined squishing a 3D cube it made no sense how it'd even be a changeable thing
 
ngn
uh... not quite what i expected
i expected the top of the tree to be "[" with two branches coming out from it - "/" and "2"
@dzaima there's a technique to do that with three nested loops
 
@ngn that's for what?
 
ngn
one loop goes over all axes before the one in brackets (call it K), one over K, and one over the rest
 
@ngn oh so for & I've done exactly that
 
ngn
hang on... I'm trying to find an example, this might take a while
@dzaima oh, right :) so you're familiar with this
 
12:30 PM
@ngn nope, that was completely guessing & playing around with stuff..
so am i supposed to copy paste that around everything that can have a bracket parameter? ._.
also i have no idea how that'd work for something that changes the shape in the process, i.e. the reduce op
@ngn glad that I was at least on track with the idea :D
 
ngn
@dzaima here's a piece of java code i wrote one, implementing apl-like arrays
*once
 
12:55 PM
so it is just tedious work getting the dimensions working
 
ngn
@dzaima it's easy: the results's dimensions are the argument's dimensions without the one that's being reduced
 
@ngn that much is easy. Creating the 3 loops with the indexes in & out being correct is the hard part
how about i just make ↓[n] and use that for everyting :|
 
ngn
@dzaima if you imagine that all axes before K are merged, and all axes after K are merged too, you're left with only 3
it's not so hard to figure out the indices in a cube
in which you're always reducing along the mid axis
i mean, it looks hard in the beginning, but once you've done it i'm sure you'll find out it's been easy :)
 
\o/ i successfully transpiled your reduce to my apl :p
 
ngn
@dzaima told ya :) i was afraid you might give up because of my dubiously-named variables
 
1:08 PM
now to actually make that [] notation
@ngn I don't understand what the hell those variables are still nor how it works, but it seems to work
 
ngn
@dzaima x - the array (of class A), x.s - the shape, x.a - the data, id - identity element, r and s - the content and shape of the result
n0 - product of all dimensions before "axis", n1 - the dimension at "axis", n2 - product of the rest of x.s
 
ngn
1:42 PM
@pierre @AttilaVrabecz a k question for you, guys, this came up a couple of times here in chat: why does +:' (flip each) require a :? +'x creates a list of projections which is hardly ever useful, so why not have ' treat + as unary in this case?
 
2:17 PM
heh an object without a toString function is calling hashCode to make javas default toString, but hashCode is throwing an error with the message "hash not supported for "+this, which is again calling toString :D
 
ngn
@dzaima that's not the default hashCode(), is it?
 
@ngn it's my default for the Obj class
should the 2nd ⎕IO here affect fs invocation or not?
 
ngn
@dzaima my guess is yes
 
@ngn I meant that as asking whether it should or shouldn't in my APL as I have the ability to choose
 
ngn
@dzaima I think all apl implementations should get rid of ⎕io :)
 
2:29 PM
@ngn ...and switch to which IO?
 
ngn
@dzaima 0, of course
with ⎕io←1 you'd have +1 / -1 all over your implementation
which you probably already have...
 
@dzaima eh actually I don't have the ability to choose as the scope isn't passed to all functions getting called
well, I've just added 3 so ¯\_(ツ)_/¯
@ngn to upset you even more, I've got ⎕COND which dictates what's truthy, falsy & what should error upon converting to boolean :P
 
ngn
@dzaima well, it's your language... :)
 
@ngn the fact that it's my language doesn't remove your freedom of being upset :p
 
ngn
@dzaima lol :)
 
2:52 PM
aight a commit of +11 files & 13 changed files later, here's your reduce translated to my system
oh right, as my / & are separate things (reduce & replicate respectively), should / be Dyalogs / or ?
 
ngn
3:08 PM
@dzaima nice :) the 3 loops are a well-known way to implement array operations, you don't have to name your functions after me :)
@dzaima in APL the tendency is to work more often with the last dimension(s), so I think Dyalog's way is more consistent
take and drop are notable exceptions
 
@ngn which dyalog's way? :p (I have no idea which dimension counts as the last one)
 
ngn
@dzaima the last of the shape vector
 
so you're suggesting my / = Dyalogs /, right?
 
ngn
@dzaima yes, I think / without []-s should work on the last dimension
it's different in k - it's more convenient to work on the leading "dimension" (if we can call it so)
 
@ngn g←{0@(⍸4=⍵)⊢⍵} could be just g←4|⊢

what I'm going for is if you get where not open and not closed, merging the lists while inverting one side
a←(g open⍳⍵)+-g close⍳⍵
then 2+/a, you should wind up with zero where there is a matching pair
the resulting sum works sometimes to continue with matching pairs of numbers. in the specific example I gave, the result of the first application is this
3 ¯3 5 4 ¯4 ¯5
that looks like I'm on the right track
{g←4|⊢ ⋄ (2+/(g open⍳⍵)+-g close⍳⍵)~0}s

the result of this is
3 ¯3 5 4 ¯4 ¯5
for s←{()}{[()]}{}{}{}{}
repeated applications however, aren't as polite
er wait... why is it working this time?
was g wrong this whole time?
0= ⍴h h s
 
ngn
3:28 PM
@nathanrogers anyway, dzaima and i managed to reduce it to this:
open←'([{' ⋄ close←')]}'
f←{∧/{⍵≡≠\=⍨⍵}¨+⌿(open,¨close)∘.⍷⍵⊢∘⊂⌸⍨a+⍨+\¯1*a←⍵∊open}
 
yeah I'm going back through the logs
 
4:21 PM
can you expand that without all the commuting and training
 
@ngn +⍨ ಠ_ಠ
 
ngn
@dzaima it was a minus initially and i forgot to remove the ⍨
 
@ngn I know :p
@nathanrogers tio.run/…
 
ngn
@nathanrogers commute is just A f⍨ B ←→ B f A; there are no trains here
 
)∘.⍷⍵⊢∘⊂⌸⍨a
that's pretty dense is all I'm saying
 
4:31 PM
@ngn I understand not understanding what order do things in ⍵⊢∘⊂⌸⍨ group first
 
ngn
⎕←⊢∘⊂⌸⍨
 
@ngn
     ⍨
   ┌─┘
   ⌸
 ┌─┘
 ∘
┌┴┐
⊢ ⊂
SYNTAX ERROR
 
ngn
^ @nathanrogers this is how it parses (ignore the syntax error)
the important primitive here is the "Key operator" ⌸
it calls its operand with groups of items from its right argument, grouped according to its left argument (lengths must match)
⍨ swaps left and right
⊢∘⊂ is the operand - it simply encloses (⊂) the group, the ⊢∘ is there only to ignore ⍺ because ⌸ passes the current key as ⍺
⊢∘⊂⌸ is a common idiom
 
i'll be back
 
 
3 hours later…
7:36 PM
Oh look, I have the ability to chat now.
 
@arcfide Welcome to the Orchard. I'm very happy to have you here.
Announcement: Ask @arcfide all your tacit APL questions — you won't be disappointed.
 
It will take me a little time to get used to this, since I am definitely not used to this form of chat, and I'm not sure how much I'll be on, but at least I'm here a bit.
 
@Quintec ^^
@arcfide Quick intro: use an @ to ping a user. Hover over a msg and click ↳ to ping that message's author while also indicating that you're replying to that specific message (this keeps conversations sane and allows later readers to follow). Use markdown for formatting. Messages beginning with ⎕← are evaluated by Dyalog APL. Enter )about for more info on that.
⎕←⎕UCS 72 105 32 64 97 114 99 102 105 100 101
 
@Adám
Hi @arcfide
 
@Adám @Adám, thanks, I'm testing the functionality now. Let's see if it works.
Ah, looks like I don't have to compose @ with :.
⎕←(2=+⌿0=X∘.|X)⌿X←⍳20
 
7:46 PM
@arcfide
2 3 5 7 11 13 17 19
 
Noice. Alright. Cool beans.
⎕←⎕IO
 
@arcfide Right. Btw, you can use this room to experiment with the chat syntax (though no APL bot there).
 
@arcfide
1
 
Drat...well that's unfortunate. :-)
 
⍞←⍳10 ⊣ ⎕IO←0
 
7:47 PM
@Adám 0 1 2 3 4 5 6 7 8 9
 
/me shakes is CS head.
 
⋄ ⎕IO←0 ⋄ ⍳10
Oops.
 
Is there a way to customize the fonts?
 
⋄ ⎕IO←0 ⋄ ⎕←⍳10
 
@Adám
0 1 2 3 4 5 6 7 8 9
 
7:48 PM
@arcfide If you precede your line with four or more spaces, you'll get monospace.
 
Hrm.
Okay.
Well, thanks for the tips. Time to get to some real work now. ;-)
 
@Adám arcfide doesn't have 20 rep...
 
@EriktheOutgolfer Oh, right. Well then.
 
I'm a spy in your midst.
A sheep in wolves' clothing....wait a minute.
I'm just here to munch on APLs.
 
@arcfide Well, with the current crowd, it'll probably be us that'll munch on your knowledge and experience.
 
8:00 PM
@arcfide ...what Adám said, you most probably know APL way better than me o_o
I mean, one just has to look at your incredible blog posts...
 
Yes, send tacit help
xD
 
lol there's already a lesson about tacit functions
that's easy stuff IMO, although some tend to disagree regarding dfn → train conversion
 
APP in general I am rather bad at parsing
APL
 
yeah, APL can be ambiguous if you don't read the whole code
that is, regarding variables that aren't necessarily of one type
 
Yeah, making APL do what I want is harder as the function gets longer
 
8:15 PM
generally, programming is done better if you split your function into pieces
 
and I’m not very good at reading the function breakdown thing
I can code the pieces just fine, putting them together is hard
 
"reading function breakdown"?
 
At least in the context or code golf, I could easily add many many parentheses
 
if you can code the pieces just fine, just have them execute consecutively in the correct order?
can't really understand your problem here
 
@EriktheOutgolfer this I'm guessing
 
8:17 PM
I want to minimize parentheses obviously
And sometimes using commute makes APL accidentally interpret a nomadic operator as dyadic, etc
 
maybe start with a tradfn, if that's easier
 
Yes, but code golf :P
My issue isn’t in writing APL code that works, it’s more of golfing APL code, lol
 
there's a reason FGITW is a problem :-(
 
@Quintec don't start with code golf, start with understanding APL and then move on to code golf
 
I’d like to think I understand APL
at least most of it
 
8:20 PM
@Quintec if you don't understand then you don't understand :|
 
I understand commute
 
@Quintec then there should be no "accidentally" around it
 
the docs are useful :P
 
Accidentally is the wrong word
 
commute always returns a dyadic function
 
8:23 PM
@EriktheOutgolfer it always calls the operand dyadically, not is dyadic
 
oh yeah, right
I'm a bit tired :P
(it's 23:23 here)
 
@EriktheOutgolfer same :p
 
yeah, and my sleep is actually fixed now...
 
@EriktheOutgolfer oh, not same..
 
8:57 PM
@Quintec Reading APL is like reading any other natural language. It takes exposure and time to integrate chunking and pattern matching into your workflow so that you can read things quickly, see the patterns, and extract intent and shape from the code.
I'd say one of the biggest problems people have when reading and learning APL is simply that they don't write enough of it.
They also don't spend enough time reading enough of it.
 
not to revisit old hats, but that bracket balance solution is still confusing me
can I see an ungolfed version?
 
link please?
 
open←'([{' ⋄ close←')]}'
f←{∧/{⍵≡≠\=⍨⍵}¨+⌿(open,¨close)∘.⍷⍵⊢∘⊂⌸⍨a+⍨+\¯1*a←⍵∊open}
 
@nathanrogers this is as ungolfed as it gets, I'd suggest going trough the parts of that and seeing what they give
 
h←{g←4|⊢ ⋄ (2+/(g open⍳⍵)+-g close⍳⍵)}
i was trying to go down this trail here
 
9:04 PM
"fixed font" button, Ctrl-K or generally 4 spaces at the front of every line
proper formatting helps in readability
 
listen
 
what does ¯1* mean? the +\ on that is conusing me, adding that to a
i'm not asking what do the symbols do, but I don't understand the statement itself
 
@nathanrogers -1 to the power of ⍵, aka if even, 1, else (if odd), ¯1
 
and that middle part with the box= is still not making sense
 
ngn
9:06 PM
@nathanrogers key operator
 
i've gone part by part, but I'm not understand how the solution was arrived at
 
are you trying to uncover the thought process? :-P
 
@nathanrogers it separates things by groups, example
 
because i was trying to solve it, but I guess there was a lot more to the solution than I could forsee
and I don't understand
 
9:09 PM
@nathanrogers there are definitely many many ways to solve the challenge, I went with a pretty strange one
 
what the programmer thought is nigh impossible to discover by looking at the code :D
 
@nathanrogers my idea was separate the levels of parentheses, so the most outer parentheses would be in 1 array, the ones in that in another, and so on. And then it's pretty easy to check that all the arrays have matching parentheses as they're just ()[]{}(){}[]
 
@nathanrogers There's a big difference between understanding the message conveyed by a single piece of code, and understanding the struggle, machinations, and genius that goes on behind the scenes to eventually construct that single piece of code. One is much harder than the other, and generally opaque unless someone keeps a journal of such thoughts.
 
{⍵≡≠\⍵=⍵} is a matching function?
 
9:15 PM
in the function
 
@nathanrogers ⍵=⍵ just gives an array of 1s. ≠\` is ngn-ery, which converts that to an array of repeating 0 1`s
 
ngn
@nathanrogers that's just a golfier version of (⊢≡1 0⍴⍨≢), in other words {⍵≡(≢⍵)⍴1 0}
 
@nathanrogers are you looking at my ungolfed version? I'd suggest going trough that before going trough ngns magic
 
Is it just me, do you sometimes get crazy flashing when you hover over something on the tryAPL primer?
 
@nathanrogers ¯1*⍵ gets the increments of the parentheses levels. +\ then does a cumulative sum, almost getting each parentheses depth (well, negated) with the problem being that all opening parentheses are off by one. That's fixed by ⍵ +
 
9:19 PM
@nathanrogers ⍵=⍵ simply replaces every simple scalar in with 1, ≠\ replaces every second 1 of every 1-cell (vector) with 0, then checks if that's equal to [sorry for pings]
 
pings to say sorry for pings
 
nope, that was together with a fix
wanted to make sure nathan got what I wanted him to get from that
 
@Quintec Yeah, I see that when the window is too small for the popup to fit. Should be fixed in the new version coming out shortly.
 
We get this. Now, we want to separate the parentheses with corresponding 0s in one array, ones with ¯1 in another, ect. That's exactly what is for!
 
@Adám Do you know how to fix it? I'm already at fullscreen
 
9:22 PM
@Adám nope, you're practically unable to use the Primer at all
 
^
 
^^
 
Hey, can y'all try staging.tryapl.org ? I'd like to check if that issue remains and I'd appreciate any feedback as well.
 
Circle stile(aka reverse) still flashes for me
Along with the other super long ones
 
9:25 PM
^ same
 
Chrome 69.0.3497.100 Mac Sierra
 
flashes, or just bumps the screen a little bit?
 
Flashes
 
Hm, I notice now that the pane scrolls up when you leave a glyph-button.
 
Chrome 69.0.3497.81 LinuxMint 18.3 64-bit, 1600×900
 
9:26 PM
it looks like a "#" appears at the bottom sometimes
yeah, some flashing is still present
 
Yeah, I noticed that too
 
but not that terrible thing current TryAPL has
 
OK, I can repro it in Chrome, but not in Firefox. Thanks, guys!
 
no problem
 
Feel free to look around, I've touched almost everything.
 
9:28 PM
FWIW flashing is also present in Opera 54.0.2952.64
 
@Quintec Opera≡Chrome
 
Opera is basically Chrome
 
Safari too
 
yep, webkit too
 
Huh, I don't have firefox
 
9:30 PM
Firefox isn't WebKit-based
 
Yeah ik
 
@dzaim
@dzaima tio.run/…
this is what i meant by ungolfed
the names are best guesses as to what each one does
though I still really don't understand it
could you comment that and relink it @dzaima. I don't want to keep rehashing stuff here because I'm too dense to follow it
 
So one by one - do you understand what match does?
 
no
the \{1} is throwing me
i haven't seen that syntax before
 
\{1} isn't one thing
 
9:44 PM
@nathanrogers it's separated as ≠\ & {1}¨⍵
 
what does ` mean?
 
is it just me or did stackexchange change the chat formatting?
 
so you're just mapping 1 to each value of ⍵?
 
{1}¨⍵ basically means "1 for each element in ⍵", or an array of ones that has the same length as ⍵
 
@nathanrogers it means chat formatting sucks
 
9:44 PM
so you're mapping each value of ⍵ to 1
 
not understanding≠sucks :P
 
@dzaima ``≠\``
 
what good does a ≠\ do if each value is 1
of course each value is =
 
@EriktheOutgolfer I could've sworn '\\' worked before
 
because they're all 1s
 
9:46 PM
So walk through it one by one: let's say we start with 1 1 1 1 and apply ≠\.
 
@nathanrogers ≠\ is one of ngn's clever cumulative reduces :D
no need to use those yourself, it's just for golfing
 
1≠1 gives 0, since 1=1. Now using that 0, 0≠(the next)1, which gives 1.
 
so then it returns alternating 0's and 1's?
 
@Quintec \ doesn't actually "use that"
@nathanrogers yep
 
um
why?
 
9:48 PM
It's a scan
 
ngn's clever cumulative reduces are very hard to understand...
Feb 26 at 15:47, by Erik the Outgolfer
good luck explaining ngn's cumulative reduces, they're just so packed together :D
 
f\a b c d(a) (a f b) (a f b f c) (a f b f c f d)
@EriktheOutgolfer that should be pinned :P
 
It does "use that", evaluating from the right, no?
Ah, never mind
 
> If you happen to see some weird scan (\) in code, and you're a total newbie, it's probably just ngn. Do not fret, ask for explanation by somebody slightly more into APL.
 
\ is practically O(n^2), which sucks, but ngn can do his magic with that fact
 
9:50 PM
@EriktheOutgolfer Yep, definitely me.
 
@EriktheOutgolfer Actually, ≠\ is famous among APLers as cumulative XOR.
 
ngn
@EriktheOutgolfer lol :)
 
so ⍵≡alternating 0's and 1's?
what good does that do?
 
to understand code, you often need to look around a bit
 
Well, let's move on to the next function. We'll see how match is applied soon
 
9:52 PM
@nathanrogers since ()()() gets converted to 1 0 1 0 1 0, we need to check that that does give 1 0s
 
Do you understand group
 
@dzaima ;what?
 
i can read it
 
@EriktheOutgolfer that was there before :p
 
9:54 PM
;in;the;world
 
so you're grouping things by level
and you're getting the level by the position of open brackets
the ;
is to keep variable names from mutating existing variable names
basically listing things with ; after the name, you're locally scoping those names
 
exactly
; is before the name
 
@nathanrogers the thing is you don't have a local variable what :p
 
^
 
if you have a variable named open, but you don't put ;open then you'll mutate your global open variable by calling this function
oh
 
9:56 PM
the thing is you don't want to pollute your code with useless local variables ;P
 
i had a variable named what because I didn't know what it was
:P didn't understand
 
If I named variables like that, all my variables would be named what :P
 
i can read group, but I don't know what it means
 
Can you put it into words? That usually helps.
 
@nathanrogers in my latest version, do you understand levels?
 
00:00 - 22:0022:00 - 23:00

« first day (626 days earlier)      last day (2023 days later) »