« first day (1367 days earlier)      last day (1280 days later) » 

12:27 AM
@TessellatingHeckler To switch to the new runtime, all you have to do is prepend the provided functions to the beginning of the constants array (second argument) instead of calling the result of the runtime on them.
 
@Marshall using which bytecode for a new runtime?
 
@TessellatingHeckler The one currently in docs/bqn.js, although you should also be able to produce it with $ src/cjs.bqn r.
The provide of provide.concat(... is the list of provided functions (as a native rather than BQN list, if there's any difference).
 
@Marshall cjs.bqn r does produce bytecode, cool
 
@TessellatingHeckler And you should really change the strings in cjs.bqn so you have PowerShell-compatible output if you haven't already.
 
12:44 AM
I sure haven't already
I'm not clear whether it needs to be BQN arrays or PS arrays going into run()
the blocks I've made are (&$arr 0,1,0,0 4) to make them BQN arrays, which works, but the compiled code from cjs.bqn doesn't do that
 
The JS code handles both. But you could also make them native (PS) arrays and convert to BQN as part of the bqn() function.
Or always use BQN arrays. Lots of options.
 
ok that's somewhat more compatible output from cjs.bqn
 
1:21 AM
and maybe the provide functions
running the new runtime returns ... 22
that doesn't seem right
 
@TessellatingHeckler It's only off by 20.
The runtime shouldn't actually be runnable now: it should just be the list of primitives.
But I'd expect the same errors from earlier while creating it.
 
oh hang on; I left a break; just after the bit that was failing
p: 798; counter 589; state: 8; stack count: 1
Exception calling "Pop" with "0" argument(s): "Stack empty."
there we go
 
So now
End of src/cjs.bqn
-ref ⇐ ∾∾⟜(@+10)¨ E_isdef◶E_proc‿E_redef¨ impl∾<"⟨"∾"⟩"∾˜1↓⥊","⊸∾˘chr
+ref ⇐ ∾∾⟜(@+10)¨ E_isdef◶E_proc‿E_redef¨ impl
Beginning of src/cjs.bqn
+⟨IsArray,Type,Log,GroupLen,GroupOrd,!,+,-,×,÷,⋆⌊,=,≤,≢,⥊,⊑,↕,⌜,`,⊘⟩
And then you can cut the runtime short and run tests.
For example, I'd try cutting it off at the definition of around line 30 and adding ≠3‿2‿1‿0 or something like that. Then just print the result of that "runtime".
 
I don't seem to have that line to remove at the end of src/cjs.bqn
 
@TessellatingHeckler Wow, both those filenames are wrong. src/pr.bqn, then src/r.bqn.
 
1:37 AM
@Marshall phew; ok got them
@Marshall edit r.bqn and comment a chunk out, then /src/cjs.bqn r ?
 
@TessellatingHeckler That's right.
The first actual computation is for identity, which is halfway down in the current runtime. Everything before that should run fine, and then you'll be able to test it freely as long as you never reduce on an empty list.
 
@Marshall that outputs 1
it should output a list of things?
I can find out what it is from the JS online REPL
 
@TessellatingHeckler is length/tally, so it would seem we've found a problem. Try (Shape) instead?
Then (0<=)3‿2‿1‿0, since it's probably that half of that's the problem.
 
setting PuTTY to APL385 font shows me some of these characters in remote Vim, but not all of them
 
Is lesseq possibly missing a [bool]? There's one in IsArray.
@TessellatingHeckler Switch to BQN386!
 
1:49 AM
@Marshall ≢ gives 4
 
@TessellatingHeckler 4 or ⟨4⟩? Should be a list.
Although your source looks pretty clear on that point.
 
@Marshall 4 not @(4); if this is calling ≢ core where I have &list $x.sh...
 
@TessellatingHeckler You could check 0⊑≢3‿2‿1‿0 to see if that's the cause.
 
2:05 AM
@Marshall maybe need to logoff before that becomes available, or KiTTy (PuTTy variant) doesn't like it
@Marshall that's also 4 as an int
 
@TessellatingHeckler That one's correct, so I'm guessing there's an issue between the runtime and output instead of with itself. It has to be one of the functions in (0<=) instead, I think.
 
getting an int where it should be a single item array smells of powershell array unrolling; that's why the [current code](https://gist.github.com/HumanEquivalentUnit/5c737af7514274e91deb3ef57e4629d2) has `,$e[0]` inside `$ge` and that was the fix for getting mixed arrays of 21 things vs 42 things.
And it has `return ,$s.pop()` in stack case 25. That is the last instruction run
 
@TessellatingHeckler Definitely possible there's a problem, but it can't be causing to return 1.
 
@Marshall yep, that returns 0 and online JS REPL it returns 1
that's not like a Dyalog train of (0<=) 3 2 1 0 (is it?)
 
@TessellatingHeckler The train's the same, but monadic = is Rank (like ≢⍴). The parens aren't necessary.
 
2:25 AM
=3‿2‿1‿0 gives rank 1
0<1 gives 0 -_-
 
You never answered that question about [bool] in lesseq
 
@Marshall must have missed it; oh I see where you asked
I don't think so, +$true is 1 and +$false is 0 and the comparisons -le/-ne/-ge return bools; it seems more unneeded in IsArray
breakpoint on $lesseq triggers once, $x and $w come in as 0, and -le returns $true on them
 
@TessellatingHeckler That's bizarre. What's 1≥0 do?
Oh, &$call $g $w $x in has the arguments swapped: it should be &$call $g $x $w.
 
@Marshall triggers the same on $lesseq, again both $x and $w are 0, returns true, and the output overall is 1
@Marshall oooh
@Marshall Now they come into $lesseq with different values
(0<=)3‿2‿1‿0 returns 1
hmm; if I uncomment the next _fold block and assignment, cjs.bqn won't compile anymore. The whole runtime still heads to a pop() empty stack
 
2:49 AM
@TessellatingHeckler Oh, Identity is a forward reference so you'll need Identity ← ⊢.
Not sure how many of those there are. If it's a lot, it's probably possible to run it with dzaima/BQN so you get decent error messages.
CmpLen and _getCellCmp as well.
 
@Marshall is that set by identity ← (0⊑⟨"´: Identity not found"!0˜⟩) {(0⊑𝕨){𝕗=𝕩}◶𝕩‿(1⊑𝕨)}´ ⟨+‿0,-‿0,×‿1,÷‿1,⋆‿1,√‿1,∧‿1,∨‿0,¬‿1,|‿0,⌊‿∞,⌈‿¯∞,<‿0,≤‿1,=‿1,≥‿1,>‿0,≠‿0⟩ and Identity with a capital is the same definition?
 
@TessellatingHeckler Yes, identity is defined as the result of a reduction so it ends up with a subject role and has to use a lowercase letter. Identifiers are matched case-insensitively.
 
3:09 AM
ok; it runs with fold declared; I'm going to have to break
this is ~200 instructions to run through, and the pop() crash is ~600, and uncomenting some more and including CmpLen and _getCellCmp isn't compiling
 
 
8 hours later…
RGS
10:40 AM
@Adám is something like {1≥r←≢⍴⍵:⍕⍵ ⋄ ⊃{⍺,((r-1)/⎕UCS 10),⍵}/↓(∇⍤¯1)⍵} useful for APL Cart? It takes a simple array and generates a vector that looks the same in the session, by "collapsing" successive dimensions with newline characters (⎕UCS 10)
Rationale is to be able to turn a simple array into something that can be fed as the 'HTML' argument to ⎕NEW 'HTMLRenderer (⊂('HTML' ...))
Ok, it doesn't really look like the same thing, but for basic usage is pretty helpful IMO.
 
@RGS {¯1↓∊({(+/∨\' '≠⌽⍵)↑¨↓⍵}⎕FMT⍵),¨⎕UCS 10} ?
 
RGS
Is this on APL Cart? I couldn't find such a thing.
 
No, it isn't.
Benefit of this one is that it works on all arrays, not just simple ones.
 
RGS
But yes, exactly that.
Awesome, that is even better. I wasn't sure how to tackle this problem, so I just tried something that worked well enough on simple arrays.
And I guess knowing ⎕FMT also helped a bit.
 
I'm a bit busy. Can you PR?
 
RGS
10:47 AM
Sure.
 
RGS
11:25 AM
PR'ed.
 
RGS
11:35 AM
@ngn I was just about to ask you a really dumb question, but then I decided to give it another go by myself, so I wouldn't have to bother you. I managed to do it alone. And then I decided to bother you either way! Aren't you glad I did it? :P
 
ngn
@RGS is this that question? :)
 
RGS
Nah, I am not that witty. I wanted to know how you included a URL in your chat profile because I couldn't find the button to do so, but then I did.
Hm, I don't think "witty" was what I meant... but wtv
 
ngn
click on own avatar and then "profile" or "chat profile" (i can't explain what the difference is..), it should be editable. i just pasted the url as text.
 
RGS
Yeah but I already managed to do it :) If you check my profile I already have the link to my website
thanks :)
 
12:33 PM
Interesting. In playing around with Dyalog I note that [x] binds stronger in GNU APL than Dyalog. So 10 20 30 (⍳10)[2] returns 10 20 30 2 in GNU APL while it returns 30 in Dyalog.
Is there a benefit to the Dyalog way of doing it? I can't think of any case where that would be preferred compared to the GNU APL way.
 
@EliasMårtenson just recently
 
@dzaima Thank you. Very educational.
I think I'll stick with the GNU APL style. It's much more logical.
 
@EliasMårtenson benefit - you reduce the need of parenthesis to the left of brackets. And it should be rare enough that you want to create a vector with an item of a bracket axis pick
 
@EliasMårtenson Dyalog's way is backwards compatible.
 
 
1 hour later…
1:48 PM
Is there a way to get the equivalent of 2 2∘⍴¨⍳2 2 2 2 using the rank operator?
 
@rak1507 I guess you mean something like 2 2⍴⍤1↑⍳2 2 2 2?
 
RGS
^ using 2 2⊂⍤⍴⍤1↑⍳2 2 2 2 preserves enclosures, if that is something we care about.
 
I'll stick with 2 2∘⍴¨⍳2 2 2 2 I think haha
 
RGS
@rak1507 Yeah. The problem is that nor the 0 cells nor the 1 cells are what you want
⊂⍤(2 2∘⍴∘⊃)⍤0⊢⍳2 2 2 2 works with ⍤0 and 2 2∘⍴¨⍤1⊢⍳2 2 2 2 works with ⍤1 (notice the last one is the same you had in the beginning, but with extra steps)
 
If you want to work inside elements, use Each. Rank is only for doing things at the top level.
 
1:59 PM
Right, makes sense
 
2:34 PM
Is there a simple way to generate all 2x2 matrices that consist of numbers from 1-9, have no repeated elements, and don't contain pairs that are the transpose of each other? (For example, it would contain 2 2 ⍴ 2 3 6 9 but not 2 2 ⍴ 2 6 3 9)
 
RGS
@rak1507 I think the simplest way is to generate all 2×2 matrices with elements in 1-9 and then filter them out, but that is not the most efficient way.
 
I want to generate matrices a b c d so the square is aa bb cc dd
{⍵/⍨⍵≡¨11÷⍨+.×⍨¨⍵}{⍵/⍨4=≢∘∪∘,¨⍵},2 2∘⍴¨⍳9 9 9 9
I have this so far, but it has ones that are just the transpose of each other
 
RGS
@rak1507 this does not generate all the matrices like you described, right? it has some extra step?
 
@rak1507 one way - filter out ones where the item at (1;2) is bigger than the one at (2;1) (simpler done before the 2 2∘⍴ing)
 
@RGS wdym?
 
2:39 PM
@rak1507 there should be 1512 matrices returned. Yours gives like 8
 
RGS
@rak1507 What I mean is that your program doesn't output a single matrix with 1s in it, for example.
 
Right, because the digits need to be unique
 
RGS
@rak1507 And..?
 
1 1 1 1 doesn't have 4 unique elements
 
RGS
The matrix 2 2⍴1 2 3 4 doesn't show up, and its digits are unique, aren't they? Nor does its transpose.
 
2:41 PM
The square of that matrix isn't 11 22 33 44
 
@rak1507 right. so there is "some extra step"
 
{⍵/⍨⍵≡¨11÷⍨+.×⍨¨⍵} well yeah, this
 
RGS
@rak1507 Ah, but you started out by saying "Is there a simple way to generate all 2x2 matrices that consist of numbers from 1-9, have no repeated elements, and don't contain pairs that are the transpose of each other" and then your code didn't do that, so I was trying to understand what the extra step was
 
Ah fair enough, my bad
 
RGS
I also failed to interpret your extra step, wasn't even sure if a b c and d were different matrices, or the digits in the matrix, and then I didn't know if aa was multiplication or juxtaposition XD
But @dzaima 's idea is really nice
@dzaima very clever!
 
2:47 PM
{⍵/⍨⍵≡¨11÷⍨+.×⍨¨⍵}{⍵/⍨4=≢∘∪∘,¨⍵}2 2∘⍴¨{⍵/⍨2⊃⍤1⊢2>/↑⍵},⍳9 9 9 9
This works, cool
Thanks @RGS and @dzaima
 
@rak1507 mine's 7 bytes shorter - using trains and merging the two filters together (currently just ignoring the {⍵/⍨⍵≡¨11÷⍨+.×⍨¨⍵})
also (∪≡⊢) to check if contents are unique
 
This isn't for code golf, so having the filtering steps separate is easier for me
That's clever, didn't think of that
 
ah
in which case, (((2∘⊃>3∘⊃)∧∪≡⊢)¨⊢⍤/⊢)
 
Yeah, nice
 
2:51 PM
Wow that's impressive
 
@dzaima heh, i changed (2∘⊃>3∘⊃) to (>/2 3⊇), but (2∘⊃>3∘⊃) is actually a bit faster - ~2.2ms avg
@rak1507 well, it is working with a ton of small arrays and executing trains many many times, both being things dzaima/APL can be slightly bettter at than dyalog
 
Sorry if this is a stupid question, but how come your APL variant runs faster despite Dyalog presumably having more resources?
 
RGS
DzAiMa HaS a BiG bRaIn
 
@rak1507 i have the backing of the whole jvm, which is, in most cases, pretty much just pure virtual function and small object spam, so it's reasonable it's quite optimized for it
 
I will take your word for it
 
2:56 PM
Dyalog destroys my impl when large arrays and actually good APL code is involved though
 
Ah, fair enough
 
RGS
Honest question @dzaima, how many hours of sleep do you get per night, on average? (approximately)
 
@RGS approximately (4×isHolidayOrWeekend)+5+?3 or something idk really
 
RGS
What is the value of ⎕IO?
 
@RGS no clue, can't test
 
RGS
3:01 PM
Ok :p
 
@rak1507 and fwiw, that runs in 1.5ms average (without the last dfn), while i can only get it down to ~1.7ms in dzaima/APL
@RGS (depends on whether you're optimistic or pessimistic :p)
@dzaima might be ¯1 sometimes even :P (i.e. when i have to transfer from going to sleep at 5 to waking up at 7)
@dzaima 1.2ms avg in dzaima/APL
@dzaima and 0.77ms avg with ⎕VI←1
@dzaima 0.63ms
@dzaima (completely forgot about 2 2∘⍴¨ there (and also before), and also a final ; surprisingly it only increases that to 0.78ms)
 
4:08 PM
is there an edible form of APL
 
@Razetime Like alphabet spaghetti, but with APL glyphs? That would be awesome. APL on Toast.
 
I suppose spamming s would make spaghetti APL.
 
 
1 hour later…
5:19 PM
@xpqz hmm interesting ideas
 
I wouldn't want to swallow a tally, it looks painful
 
 
2 hours later…
7:05 PM
I saw someone mention the "rank operator" earlier. What is that?
 
Oh that. The one that has the most bizarre precedence rules of anything in APL
I still haven't implemented it, because I can't think of a good way to do it that doesn't require special parsing rules.
 
@EliasMårtenson Huh? It's an ordinary operator.
I guess if you're following GNU (and I'm remembering correctly), then operators have higher precedence than stranding, but that only means that the programmer might have to parenthesize the right operand.
 
@Marshall Is it? when I do something like +⍤3 8 9 10, the 3 binds to the ⍤ while the 8 9 10 is an array. No?
 
@EliasMårtenson In most APLs, stranding binds tighter than operator application, so that would be one length-4 operand.
 
7:16 PM
To be honest, I read the ISO spec and couldn't make sense out of how it's supposed to work.
 
@EliasMårtenson the parsing rules of , , @, , , (and . when not used for maps or outer product) are exactly the same
 
OK, and GNU APL's behaviour doesn't make much sense to me.
Let me try in Dyalog.
OK, Dyalog is at least consistent.
Basically, assuming some function ff, as well as a variable a assigned as follows: a ← 3 4 ⍴ ⍳100
Then, GNU APL has different behaviour in these two cases:
 
once you have parsed strands, you parse operators, from left to right. Each monadic operator gets bound to whatever is on its left, and every dyadic operator gets a left operand of the thing to its left (which, due to the order of parsing might be some other derived monadic or dyadic operator) and the thing on its right (which must be a single "thing") is its right operand
 
ff⍤1 a and ff⍤1 3 4 ⍴ ⍳100
In the first case, GNU APL binds the 1 to ⍤ and uses a as an argument. That's just weird.
Anyway, it's really late. Time to sleep. I'll work on this tomorrow.
 
 
2 hours later…
RGS
8:59 PM
@EliasMårtenson where did you find the spec? I found it once but it looked like I had to pay $$$ to access it
 

« first day (1367 days earlier)      last day (1280 days later) »