« first day (1362 days earlier)      last day (1295 days later) » 

12:04 AM
@cannadayr This line is setting the value of a variable: a is the value array for the block and i is an index into it, so a[i] is the variable's value. So [a,i] is basically two values simulating a pointer into the variable values.
BQN is all about immutable data, but the VM implementation is not.
 
12:38 AM
@Marshall more q's - what are d & v?
the thing that stands out to me w/

```
else {
..... let [a,i]=id; assert((a[i]===null)==d); a[i]=v;
..... }
... return v;
```

in the 'else' clause, youre modifying 'a' with 'a[i]=v;', but 'a' isn't returned
 
@cannadayr d is whether the assignment is a definition/declaration () rather than a modification (). The variable needs to be undefined iff (===) d is true. Then id is the assignment target and v are the values to set it to.
@cannadayr Yes, the point is that you're modifying the variable value, which is stored with the block. So a is just a copy of a mutable array.
 
js is so weird to me.

so to repeat what i think youre saying...
a[i] = v updates a reference in v to point to a new value when its returned
theres no implicitly passed in variables in this, correct? like its not modifying a variable not in its arguments
 
@cannadayr The variables aren't passed by reference but a is a mutable array, so it basically works like a reference.
APL/BQN and Erlang are like the only two languages that don't use mutable arrays by default...
 
oh yea the weirdest part has been (besides learning erlang, and learning how bytecode interpretation works) is translating js idioms to erlang
 
So an instance of a block, which is buried somewhere in a closure in D(), has a variable array, and a is a copy of that array. Update a and the copy with the block instance will also get the new value.
 
12:57 AM
thx, ill need to mull it over a bit and cont to pull apart the js. everytime i think i understand javascript hah...

on plus side i got this earlier (likely wrong):
```
16> erlang:apply(lists:nth(1,bqn:smap(B,S)),[[]]).
E:[{array,148,0,undefined,1000},[]]
S:[]
C:{15,1}
E:[{array,148,0,undefined,1000},[]]
S:[#Fun<bqn.10.91007752>]
C:{22,3}
E:[{array,148,0,undefined,1000},[]]
S:[#Fun<bqn.10.91007752>,{array,148,0,undefined,1000},0]
C:{11,6}

```
 
1:12 AM
my interpreter port breaks in set() as well, it can set a single value but trying to run the full compiler breaks at the assert eq(id.sh,v.sh)
it's not the set() doing it, I'm suspicious of the way one is 21 things and the other is 42 things, and it appears to be 21 things alternating with 1,2,3,4,5... I stopped with no good ideas how to make progress into it
 
@TessellatingHeckler Sounds like your variable (array, index) pairs are getting squashed together.
Those pairs are generated by case 22, and the JS interpreter treats them as ordinary values.
 
@Marshall good to hear that confirmed as a possibility; powershell does the equivalent of throwing ravel into your code almost (but not quite) everywhere. I've squashed that a few times
 
@TessellatingHeckler The variable references don't really need to be pairs (they just need to be recognized by get and set), so if there's a way to encapsulate them then just use that.
 
@Marshall case 22 s.push([ge(e,num()),num()]); I have as $s.push(@((&$ge $e (.$num)),(.$num))) which might be wrong but I don't think it will be there
might be, there are stack manipulations which pop/push and might be pop (ravel) pushing?
 
@TessellatingHeckler have you made the src publiclly available?
on phone rn cant spel
 
1:22 AM
@TessellatingHeckler The list for multiple assignment gets created in case 4. Variable references should never escape to have actual functions called on them, so that should be the only place to fix. I assume that's where they're getting squashed together.
 
@cannadayr no I haven't; I can paste it somewhere if you want, but it's not nice and doesn't work
 
@TessellatingHeckler Dollar-sign-to-identifier ratio is off the charts though.
 
@Marshall gah, case 4 has caused me a bunch of problems already, I totally believe it's still wrong. It is doing "pop N items, reverse them, push them back individually not as a single nested group", yeah?
 
@TessellatingHeckler what language?
 
@TessellatingHeckler It makes them into a BQN list, in the order they were added to the stack. It's used for list or strand notation.
 
1:31 AM
@cannadayr PowerShell currently; if I can both (make it work and understand it) that might lead to C#, and IIRC you're disinterested in .Net in all forms
@Marshall gotcha; yes I am using list() to push them back at once, and that's how I got to be able to test basic list store/retrieve
 
@TessellatingHeckler i make exceptions for apl and apl similar topics
i can post the erlang somewhere later. its gone thru several iterations.
 
I can break when it happens, which is too late to see why it happens. I don't know how far in it happens
 
having diff implementations in diff language paradigms will also be good for ppl to cont porting
 
@TessellatingHeckler If you're getting a length-42 list, it has to be case 4 that's breaking, because calling the instruction with an argument of 21 should always produce a length-21 list.
 
@Marshall what's a simple BQN expression that triggers that? is it a multiple assignment?
 
1:43 AM
@TessellatingHeckler I'd expect a‿b←1‿2 to do the trick.
 
@Marshall ok, got that through the js compiler, let's see what the bytecode does
 
1:59 AM
that's enough to trigger the bug alright
@Marshall what is let ge = (e,i) => i?ge(e[1],i-1):e[0]; intending to do?
 
@TessellatingHeckler It stands for "get environment". It starts at the current environment (the data for a block instance) and takes its parent i times, then returns it.
Variables are referenced by the depth of the environment where the variable was defined, then the index in that environment.
 
I changed the numbers from 1,2 to 77,88 so they stand out more from indexing. First case 4 leaves the stack with a single item, list 77,88, that looks good.
Then gets to case 22, drops into ge() with e as a nested emtpy list something like [[[],[]],[]]
now I suspect the stack is bust
 
@TessellatingHeckler That looks about right. e should have two parts: the variable array and the parent. The variables are a and b, which aren't initialized yet, and it has no parent so the parent doesn't matter.
 
okayyy
so next there's another case 22 and the stack has
1
--stack index 0 --stack count 2

0
--stack index 1 --stack count 2
77
88
--stack index 2 --stack count 2
apart from not knowing what the blanks are - empty parent environments I'm guessing? that could be balanced
and there in case 4, two stack pops result in four things !
surprise ravel
 
2:32 AM
maybe fixed, maybe bodged; now that snippet appears to work, the full compiler breaks elsewhere in set()
 
 
5 hours later…
7:07 AM
what happened on case 21:{let v=ge(e,num())[num()];assert(v!==null);s.push(v);break;} to make it worth putting an assert there? If I "fix" variable assignment, I get a null v here.
 
7:38 AM
What does SYNTAX ERROR: Invalid token at the time the function was fixed mean?
 
@RGS Added: aplwiki.com/wiki/tex Feel free to improve.
@Razetime E.g. you had ⎕KITCHENSINK
 
I'm trying to make a tradfn and it says this when i input a string
 
@Razetime Are you using instead of by any chance?
 
umm no
I fixed that already
 
Maybe if you show your code, or at least the part that errors?
 
7:41 AM
how do i "save" an object?
 
What kind of object?
And do you mean save as a text file to disk? Or serialise it for storage as binary blob? Or something else?
 
like a tradfn
when i double click its name an editor pops up, right
how do I save those edits
 
Oh, you mean without closing the editor?
 
OH, it's saved when you close it?
 
@Razetime You have a not-space-or-tab between and
For me, it helps a lot to change the background colour of errors to something else. That lets me discover invisible errors like this.
 
7:45 AM
fixed
I don't remember putting a not-space-or-tab but
ok
probably a backspace character
@Adám ok, how do i save without closing?
 
@Razetime In RIDE (that's what you're using): right-click → Fix
 
great
 
@Razetime You can assign a keyboard shortcut to that too. It is called FX. Edit → Preferences → Shortcuts → Search: FX then hover over the line, and click ➕ then press your desired shortcut.
 
Even better!
 
@Razetime Btw, {⍵⊂⍨⍵∊⎕A}input lends itself well to a train: input(∊⊂⊣)⎕A
 
7:56 AM
cool
for now I'm just trying to make a normal program
 
Sure. I'm not intending this as golf. I just think min-trains like this read quite well: membership partitions
 
@Adám once it actually works, then it's be cool to use the train
I still like dfns a lot more right now
 
np
 
8:22 AM
Try it online! works with caps, but lowercase fails lol
 
8:45 AM
@Razetime Well, I don't know what it is supposed to do.
 
@TessellatingHeckler the idea with the ___M functions (LOCM=22, ARRM=4) is that they create assignable/mutable arrays, that "mutate" the thing the ___O-version would've otherwise returned. In my impl they're a new type (SET_s for reference) completely separate from regular values
also yay inverse headers
({𝕨𝕗_𝕣_𝕘˜⁼𝕩: 2} is the most "complex" header that can get processed currently, but its execution isn't yet implemented)
so GNU APL allows a 5th argument with bracket axis, right? How about a b⌾(c _𝕣_ d)e:? :P (and a b⌾(c _𝕣_ d˜)e: for squeezing another variation in the same function, for extra horror value)
@dzaima actually, a b⌾(c _𝕣_ d˜)e: doesn't exist. Got it confused with a⌾((b _𝕣_ c)⟜d)e: or something like that i really don't know anymore
 
9:30 AM
@Marshall right, i'm stupid, it is a special form (underW in my code), and it probably should be definable
 
10:04 AM
8
Q: Wicka-wub a string

caird coinheringaahingInspired by this. Given a string as input consisting of only upper and lowercase alphabet characters, wicka-wub it. How do I wicka-wub a string? The example text used is "DJMcMayhem". Split the string before each capital letter, so you get ["D", "J", "Mc", "Mayhem"]. Next, take the two halve...

 
10:23 AM
phew
https://dzaima.github.io/paste/#0tVNBToNAFN1zipfuTGrCQEsUl7ZNF9oaW1emi4GhBi2QFCw2xoVb9@5056K9gzfwFp7AIzgz0AGTUtl0Egjz/nv//Zn/AXDguHj8eX99sRu0gROIT/6s7UYgtmmxZ3l4JaDv588MffCVrIQV2hLIFPj1puCUw0@aGzHP1qD3oOvgq9MbdKBrzixy72IRsDG9D93Ej0JowHRGb2KbEwAaOP6CzrwwgROxpS3CQJzQeZIRgAWdc/I19/toikLX8r2a8GAQhZT57hap@Z@ULSuU1i5lE@nkb9V@uPDmsbclEbHqlr8jx3HNc1SnMIwaB8qzCOSwOpVZJ1U@CxCjkE3DxdWoL0aAT6jAyTGyddkdDzZEooiEE4PtRNKWXANnw9MhdMhyiCVBU4DnHJSdJ0e5dNQd9zcehvIwuAerLsZURJMTxS9SSW0paktS91N5W7m0pQvbi4ulXCzukla4RM5tnPW36KhqWXGx5ZsrX035ABubXw#BQN
 
10:55 AM
pushed inverse headers. No modifiers currently because i can't decide what to do about providing 𝕊 to them (not as in what should it be, but whether to pass the Md[12]Derv to all callInvs or always re-derive it (as it's only passed for regular calls))
 
@Razetime Oh, you mean that all-lowercase input fails. OK, that's solvable.
 
yep I'm gonna try cleaning that up soon
 
@Razetime also fails on odd amount of capitals, including the special-case of only one capital
 
11:18 AM
yes that as well
 
@Razetime 1) temporary l is pointless; 2) you can get rid of some s and ,/s and ,s (i.e. making strands) by just ing the final result
also computing the '-wicka's and '-wub's together is like 10 bytes shorter
 
CMC: Write a function that returns 'https://dyalog.com/download-zone.htm#termscheck' as its result. Rules: The last line of the function must be https://dyalog.com/download-zone.htm#termscheck unless you write a dfn, in which case that should be the second-to-last line, and the last line must be }. The required line must actually be executed. No early termination allowed.
 
11:42 AM
@dzaima oh don't worry too much lol
I'll fix it later
 
@Adám is it possible if checking the result for exact equality?
 
@dzaima Yes.
 
Must the // be executed without erroring?
@dzaima (because otherwise i see no way to make a dfn work that has any resemblance of "The required line must actually be executed")
 
ngn
nice cmc
 
@dzaima (i do have a 154 byte tradfn)
 
ngn
12:02 PM
@Adám can the result be enclosed?
 
@ngn that's an implied question and answer of my question
(well, i guess enclosing could also be allowed, but if you don't need it, where's the fun in allowing it?)
 
ngn
@dzaima better be explicit. he might want to compare outputs as strings.
 
@dzaima 152 now; i also have a 158-char dfn that returns the output enclosed (including the {}s)
 
ngn
@dzaima i have 137 but enclosed :(
 
@ngn tradfn or dfn?
 
ngn
12:09 PM
dfn
 
oh nice
 
ngn
i think i got it, 144 bytes according to my calculations
 
@dzaima 116 tradfn, and 124 result-enclosing dfn by being lame
@ngn for a non-result-enclosing dfn?
 
ngn
@dzaima yes. what about your tradfn?
 
@ngn it returns the proper simple character vector (because there's really no reason for it to not)
 
ngn
12:20 PM
golfing starts here :)
 
@dzaima so, for a non-result-enclosing dfn to work, either 1) there's some magic way to redirect the dfn output from the result of //…; or 2) my logic about what //x does is wrong
 
@ngn No.
 
ngn
thought so
 
That'd be too easy.
 
@dzaima or 3) abuse some syntax so // isn't actually "replicate-reduce". But with that i'm pretty sure that's an exhaustive list of my options
 
ngn
12:25 PM
@Adám what's your best (just the score)?
 
ngn
12:44 PM
ok, i have a 130byte dfn and i give up. should i paste it here?
@dzaima still golfing?
 
@ngn stopped as i'm mostly out of ideas. but if you paste it, make sure to spoiler it
 
ngn
@dzaima how?
 
@ngn tio, paste, whatever
 
ah, figured it out
i thought i had tried it D:
oh there's still things to do beyond handling //
 
12:52 PM
@ngn My reference dfn solution is 121 and my reference tradfn is 120 including header line.
 
i have a proper 120 byte dfn, still golfing
don't think i'll get below 120
 
1:13 PM
got 114, dfn
@dzaima (note that it needs Dyalog 18)
@dzaima 109 tradfn with that, but it has a side-effect of outputting a 1
@dzaima oh wait my old tradfn also had that side-effect
 
@dzaima you may have hit a bug I found
 
@Adám it's ""proper"" behavior in mine afaik
@dzaima (double-double-quotes is a bit excessive there. just regular double-quotes is enough)
@dzaima 106, still with a side-effect of outputting garbage
@dzaima 111 with hiding that garbage
@dzaima 100 with outputting garbage (¯1 this time)
@ngn finally looked at that; #.htm←com← would only assign in # for one of the assignments (i just assumed that #. for assignment wasn't needed); also why 1⌷⊖?
 
1:48 PM
@dzaima Second to last row.
 
@Adám but it could just be 1⌷
 
Ah, true, but maybe he wants to emphasise that it is per spec.
 
@Adám but
 
True. We should punish him for such a wasteful byte. ;-)
 
@dzaima oh, it doesn't do 2 namespace accesses so #.htm←com← is intentional
 
1:52 PM
@dzaima But #. is entirely unnecessary.
 
right
it's been long enough so my original solutions: 120 dfn, 116 tradfn
 
@dzaima Ah, but the tradfn prints garbage (which, while I wasn't clear about originally, I certainly meant to prohibit.)
 
@Adám yeah; that's fixed in my 111-byter
 
@dzaima … which is…?
 
@dzaima got 107
so my latest solutions:
114, dfn: https://tio.run/##SyzI0U2pTMzJT///qKMt@VHbBAtDy0c92xQe9c5VyC8tSUksSU1RCPH0/58GlKsuARGPelflPOpuedS7C4hqueKBYo96@w6t0NDIedTRBTamb2qi5qOuthyglLqCet2j3hXGj7qagcJ5Repp6po6h1aog6RAtKGyYYlyiSGI/airSR1osKE6V0ZJSUGxlb4@xGl6yfm5@in55Xk5@YkpulX5eal6GSW5yiWpRbnFyRmpydlctf//Aw0HGpkGdPgaAA
107, tradfn: https://tio.run/##SyzI0U2pTMzJT///qKPN@VHbBAtDy0c92xQe9c5VeNQ31Rko3F4EFE7jKgGS1Y96Vz3qXVPL9ai379AKDcNHbZM1ih51dIH19k111HzU1QZSra6gXveod4XJo65moHBekXqauqbOoRXqICkQfWhFyaEVyiWG6lwZJSUFxVb6@hBH6CXn5@qn5Jfn5eQnpuhW5eel6mWU5CqXpBblFidnpCZncwGd8/8/0EyQkwA
 
2:09 PM
@dzaima OK, those are darn impressive. Respect!
 
ngn
2:41 PM
@dzaima right, i didn't see it
@dzaima well done! i too was thinking of using ⍎ but never got to the point where i could
 
Well, I hope you guys had fun.
 
ngn
@Adám it's not over yet :)
 
:o (i certainly stopped, am back to working on dzaima/BQN)
 
ngn
@dzaima the dfn could be shorter with '\w+'⎕s'&' instead of ⊆
f←{t←{⍪l⋄⍺⍺}⋄_←⍎∊'1#1t#t1',¨⍨'\w+'⎕s'⋄&←'⊢l←' '~⍨1⊃⎕nr'f'
dyalog.com/download-zone.htm#termscheck
}
 
2:58 PM
<phantomics> Is the APL that we can interact with through the chat Dyalog? The one that evaluates anything after a diamond character
 
phantomics: yeah
 
phantomics: It is Dyalog but through a whitelist similar to Try APL's.
 
<phantomics> Got it
<phantomics> Then check this weirdness out:
<phantomics> ⋄ a←9 10 11 ⋄ 1 2 a[2] 3 4 5 6[3]
4
<phantomics> ⋄ a←9 10 11 ⋄ 1 2 a[2] 3 4 5 6
2 3 4 5 6
<phantomics> Obviously I shouldn't be entering indices this way but it's strange
 
In Dyalog, standing is stronger than indexing.
1 2 a[2] 3 4 5 6[3] is ((1 2 a)[2] 3 4 5 6)[3] i.e. the 3rd element is 4.
 
i think a better example is ⋄ 'a' 'b' 'c'[2] 3 4 5 6
 
3:01 PM
@dzaima b 3 4 5 6
 
1 2 a[2] 3 4 5 6 is (1 2 a[2]) 3 4 5 6
 
<phantomics> Ok, got it
 
This is the same behaviour as APL\360. APL2 (et al) made a breaking change in having indexing stronger than stranding.
 
<phantomics> GNU APL gives me 1 2 10 3 4 5 6 in return for a←9 10 11 ⋄ 1 2 a[2] 3 4 5 6
 
GNU APL is an APL2 clone.
 
3:03 PM
<phantomics> RIght, makes sense
<phantomics> And GNU gives an error for the case with two indices
 
Try this in GNU APL: 10 20 30[2]
 
<phantomics> Error, so it's trying to get 30[2]
 
Exactly.
 
<phantomics> That clears that up, thanks
<phantomics> One other thing: Dyalog throws an error when you enter 5⍳7, but GNU returns 2, is there any harm in taking the latter approach when I mostly follow Dyalog?
 
⋄ 'a' 2[1] 2[1] 2[1] 2[1] 2[1] yay
 
3:05 PM
@dzaima a
<phantomics> Wow
 
@dzaima so stranding & indexing is kind of left-associative
 
phantomics: The traditional lenient treatment of scalars and 1-element arrays has generally been seen as "a bad thing" in hindsight.
 
<phantomics> Because the stricter handling requires you to be more careful with data formatting, protecting against bugs?
 
Not just that, but it also affords later extensions.
E.g. was prematurely defined as ∊∘, so now it cannot be extended to major cells.
 
3:10 PM
<phantomics> I see
 
@Adám would a major cell be useful, like, at all?
 
<phantomics> Is there any good place to find a summary of which APL2 functions are more lenient than other branches?
 
Similarly, monadic treats a 1-element vector as a scalar, so now it is inconsistent on vectors of length 1 (returns an array of vectors in all cases except when its argument is a scalar or a 1-element vector).
@dzaima Yes, and you can easily get ∊∘, if that's what you want, but not the other way around.
phantomics: I don't know of a summary, but you may have luck on APL Wiki's individual primitive pages. Also, btw, 5⍳7is a RANK ERROR in APL2, so that's a GNU APL special.
Ditto in APLX ― another APL2 clone.
 
<phantomics> Got it
<phantomics> RANK ERROR in APLX?
 
Yes.
 
3:15 PM
<phantomics> Good, looks like there's a clear consensus on how to handle that one
 
@Adám i guess i should trust you on that "yes", but i'm still highly skeptical about it (probably just because i highly prefer vector-of-column data structures to rank-2 arrays)
 
Huh, NARS2000 gives ⊂⍬
I can see why 5⍳5 should give ⊂⍬ but certainly not 5⍳7
 
@dzaima hmm, okay; not sure how that fits in
 
@Adám what else could it possibly be?
 
An error, since there's no correct value to return. Much like 5÷0
 
3:32 PM
@Adám (fwiw it was broken in whatever older version i had)
 
ngn
@dzaima tbh i don't understand why #. works like that
 
ngn and APL objects usually don't get along well…
 
ngn
@Adám but # is not a namespace, right :)
#.name looking up a local variable seems wrong
 
# isn't a pure namespace, but every object is a namespace too.
It is easy to confuse namespace with scope. Indeed, there is no syntax for looking up the scope stack.
 
ngn
@ngn -1 byte: ' '~⍨1 -> ~∘⊃⍨1
 
3:36 PM
It doesn't help matters that #.name← has the apparent effect of assigning out of a dfn scope, when in reality, all it does is to avoid auto-shadow.
@ngn Ah, yes, I forgot about that on for dfns. Doesn't work in the tradfn, though.
 
ngn
so, the dfn wins?
 
Dunno, where are we holding?
 
ngn
what
 
What is our collective-effort shortest dfn and tradfn?
 
I wish you could use APL in competitive programming, was just doing one and I was struggling to get a working answer in both python and haskell, but it's so simple in APL :(
 
3:39 PM
@rak1507 And why can't you?
 
Not one of the allowed languages
 
ngn
@Adám dzaima's 107 tradfn and my 106 improvement on his dfn
 
@rak1507 I don't know what site you have in mind, but couldn't you ask for it to be added? I'll be happy to represent Dyalog in that regard.
 
This one was codingcompetitions.withgoogle.com/kickstart but I'm doing the final of this bpc.londonsmp.co.uk in january and it would be great to use APL in that
Also it would be really cool to have APL in codeforces.com
 
@rak1507 "London School of Mathematics and Programming" sounds like a good fit for APL.
> Attempt as many as you can in almost any programming language (except Scratch).
I'd simply ask them.
 
3:48 PM
Your programs had to be run by an automatic judge that had a limited number of languages available unfortunately
 
Right, I understand, but why not now ask these three orgs to add APL for next time?
 
ngn
because dyalog is not free?
 
I don't see why that's an issue.
 
@Adám i would assume that'd mean they'd need to add checking code, which means writing APL, which they definitely can't do. And they definitely have many many more popular languages they'd actually be able to add before APL
supporting APL for 0-1 people is probably not worth it
 
@dzaima No, I don't think so. Most such sites simply check stdout.
 
3:52 PM
Yeah, it just needs to be able to run code and check against stdout. According to my friends I could make a post or email them and they might consider it, so I might as well
 
Now, with 18.0's LOAD= it is pretty straight-forward.
@user677578 Hi Alexander. If you want to participate here, then send me an email: adam@ with the same domain name as www.dyalog.com
 
@Adám it'd definitely be their first time considering legality of using a programming language. Also, since the finals aren't online, they'd need to set up APL input system for the competitors
 
Maybe we should state explicitly that testing submissions as part of non-profit code competitions is allowed…
 
4:19 PM
<phantomics> They could use NARS2000 or something, granted you'll lose some recent features
 
and performance
 
NARS2000 would be very difficult to set up. GNU APL or ngn/apl or dzaima/APL would be better choices.
 
4:49 PM
@TessellatingHeckler In the JS runtime, null marks an undefined variable. Line 21 gets the value of a variable, so it needs to be defined. Even though declarations are all resolved statically, a variable can be undefined at runtime because inner blocks see all declarations from the parent block, even from statements that come later. So {a}⋄a←6 should trigger that error.
 
5:46 PM
@Marshall In case 21 is v the value of a variable, instead of an array of variables?
 
@TessellatingHeckler Yes: ge(e,num()) gets the array and then [num()] pulls out the value of the requested variable.
 
@Marshall It sure triggers /an/ error. :/
 
@TessellatingHeckler Is this when running the full runtime? Note that the value for no left argument (Nothing or ·) has to be different from the one for an undefined variable.
In my Go runtime I didn't make the distinction and just removed the test, but that means it doesn't detect uninitialized variable errors. One reason I never published that runtime.
 
@Marshall I have blindly ported the old JS interpreter to PS, and running it tries to run the full compiler and can't. I've been gradually making simple bytecode in the JS one and porting it accross and trying it and fixing the errors. The current case 21 error is if I try and run the full compiler. With {a}⋄a←6 either I've got the bytecode wrong or it's breaking earlier
 
@TessellatingHeckler {a}⋄a←6 is supposed to fail in case 21. Is it doing something different?
 
5:55 PM
When I started, I had no clue how it worked and no way I could write it in anything else, now I have some idea how it works and am very tempted to restart in a more sensible language, but this feels pretty close
 
JS distinguishes between null and undefined, so you have to translate them to different values.
My guess is you're at least 3/4 of the way there.
 
@Marshall yes, I must have something wrong in the bytecode, it's not getting into running the VM
 
I get [[15,1,14,0,0,22,0,0,11,25,21,1,0,25],[6],[[0,1,0,1],[0,1,10,0]]] for the bytecode when I compile, which looks right to me.
 
6:24 PM
all of my bytecode so far has a single block at the end, it's not unpacking the first block properly
that's why, @() around them instead of ()
now it triggers a case 21 fail
 
6:47 PM
<phantomics> Here's another apl quirk brought to my attention by justin2004: disclosure identities
<phantomics> Disclosing an empty vector as with ⊃⍬ yields 0, while disclosing '' results in a ' ' space character
<phantomics> Is there a particular rhyme or reason behind this?
 
The result comes from the array's Prototype: aplwiki.com/wiki/Prototype.
You can get the same fill element from Take as well.
 
yeah, ⊃x is equivalent to ⊃1↑x
 
The idea is that an empty array has no first element, so it needs to carry around a special extra element with it.
 
(or something like that, probably needs a ravel for higher ranks)
 
@dzaima I think the identity's correct but ⊃1↑,x keeps you from having to apply it multiple times.
 
6:51 PM
<phantomics> I see, same prototype concept as with take, GNU just gives back the empty vector, I'm guessing the rest of the APL2 family does as well?
 
phantomics: You sure this isn't a ⎕ML issue? If ⊃x returns a scalar for any simple vector x except the empty one, that's pretty awful.
 
0≡↑⍬ and ' '≡↑'' are both true in GNU APL
 
<phantomics> GNU has no ⎕MLs
 
No, but is Mix in GNU and is First, which matches Dyalog with ⎕ML 2 or greater, not the default.
 
phantomics: There's no such thing as "THE empty vector".
 
6:57 PM
<phantomics> Marshall: Oh right, my mistake
<phantomics> ↑ is the corresponding GNU function
 
You can use ⊃⍬⍴ as a dialect-agnostic alternative.
 
I should probably say "glyph mapping" instead of ⎕ML because it's faster than opening an APL-enabled editor, typing it wrong before remembering APL keyboards use backtick instead of backslash, and copying into here.
 
Well, ⎕ML is more than just glyph-mapping. You could say "migration level" or "evolution level", though.
Or simply "quad-ML"
 
Glyph mapping is more precise in this case.
 
Heh, is it glyph mapping or function mapping?
 
7:03 PM
<phantomics> I always set my input mode to globally enable APL characters, in Linux it's done with setxkbmap us,apl -option grp:win_switch
 
A lot of people use win_switch for various desktop manager shortcuts these days.
 
Seems like a sensible thing for an APL programmer to do.
 
<phantomics> I have an input mode switcher too, so I can return to the normal mode by pressing Ctrl-Space twice
 
phantomics: what's "normal mode"?
 
<phantomics> The mode where win_switch works as usual
 
7:05 PM
I guess I'm just a person of limited mind ― I can't handle mode switches well.
 
<phantomics> I have a button on my desktop bar that runs the setxbkmap command, but the changes it makes are lost when I switch input modes
<phantomics> I have a Japanese mode as well as the English mode, switching into it and back returns me to the default mode where the winkey works normally
 
ah. i'm using grp:switch always, but switch between layouts (APL, latvian, BQN) from a second keyboard i have for various macros
 
when v was an empty array my assertion test was failing incorrectly; with that fixed, "{a}⋄a←6" runs and outputs 6, but it doesn't affect the full compiler run erroring in the same place, for a different reason
 
@TessellatingHeckler {a}⋄a←6 should error though. not that it matters much for the compiler
 
@dzaima huh
 
7:10 PM
 
then it's definitely not right
lol
 
@TessellatingHeckler what does x←{a} ⋄ a←6 ⋄ x give?
 
The fill value used to initialize v in D() should match the one tested for in case 21.
And not be a possible variable value or Nothing.
 
@dzaima it gives an assert failed error in the same place
 
7:27 PM
@TessellatingHeckler didn't you just say that {a}⋄a←6 alone doesn't error?
 
7:42 PM
@dzaima I did say that; it comes out with v=@() (empty array) which means v is defined and no error; x←{a} ⋄ a←6 ⋄ x appears to hit case 21 with v ending up as nothing, assertion fails
powershell has a problem with arrays of one thing being flattened into scalars, and this has me feeling that is happening somewhere, where I'm either losing something that should be an empty array, or making an empty array where there should be nothing
 
@TessellatingHeckler ah, so x←{a} assigns "nothing" (?) to x? It should already have errored when reading a
 
@dzaima i can't follow what it assigns to what
 
does x←a alone error? Does just a error?
ah right, the compiler won't compile those
 
gonna come back to it in a couple of hours
 
@dzaima [[21,0,0,25],[],[[0,1,0,1]]] should be the bytecode for just a.
 
7:50 PM
@Marshall right, was in the middle of crafting that
 
may I present some light humour for your craft:
 
@skillpatrol Page 126‽ That's a lot of APL code!
CMC: Shortest path from "God" to "Direct function" on Wikipedia.
 
ngn
@Adám there :) god -> apl -> dfn
 
does the apl page contain a link to dfn?
I couldn't find one
 
8:00 PM
@ngn Sorry, it has to be between the articles with those exact names. Nice try though ;-)
 
God
Bible
Biblical Names
List of biblical names that start with O
Omega
APL
? DFN
not sure if APL links to DFN
 
ngn
@rak1507 in the box near the bottom of the page
 
Ah yeah
There's a 7 article path then
 
Nice, but can be done shorter.
 
i have 5 (including a disambiguation page, a "see also", and both god and dfn)
 
8:05 PM
Nice, but can be done shorter.
 
Hmm can I really be bothered writing a script to do this
 
@rak1507 pretty sure that if you wanted to cheat you could find that someone has already done that for you
 
Using something someone else has written is cheating, writing it myself isn't
 
@dzaima Also, how can you trust other people's code?
 
@Adám verify that it gives an answer better than 5 (and a web thing prooobably won't give me a virus)
 
9:01 PM
@dzaima I did find one that gives 4.
 
I couldn't find one that gave 4 so I cheated, and there are 434 paths apparently! Pretty cool
 
@rak1507 No, that'd be "degrees of Wikipedia". 4 degrees is 5 articles.
 
Oh wow, so there's a better one that you found but the site didn't?
 
Yes, that site didn't, but another site did (after I found a different one myself).
 
Cool
 
9:05 PM
So yes, I know of two ways now for God → X → Y → Direct function.
 
9:38 PM
<phantomics> Sounds like a job for Terry Davis, if only he were alive
 
10:18 PM
God -> Historical Religions -> APL 🤔
 
10:46 PM
God -> Blaise Pascal -> Pascal Programming Languge -> APL -> Direct Function is the shortest I have just poking around
 
11:19 PM
Managed to successfully use the rank operator for once in my life and it is slower than just using ¨ :(
 
11:34 PM
@Marshall another question, writing it out because i just got done looking at it and its fresh on my mind...

some of the core runtime functions (ie "(x,w) => x.sh?1:0 ") take 2 arguments x and w. but some of them test if w is defined and will return different results.

will these functions always be called with 2 arguments (but one is undefined), or is this relying on javascript defaulting an argument to undefined?

i ask because in erlang functions have to be called with the right arity, while javascript doesnt.
 
@cannadayr have a look at case 5 and case 6, they have call(f,x ) and call(f,x,w)
haven't confirmed that's relevant but it's possible
 
@TessellatingHeckler thats a good point
 
11:59 PM
@cannadayr in a language without default args, you should have all functions always take 2 args (and call always take 3 args), and always call them with both
 

« first day (1362 days earlier)      last day (1295 days later) »