« first day (650 days earlier)      last day (1994 days later) » 

1:23 AM
@dzaima guards are borken
> {⍵>10:3⋄4}11
4
> {⍵>10:3⋄4}0
4
 
1:35 AM
it would also seem that under certain cricumstances ⍵ and ⍺ are reversed
in particular when using ¨
actually disregard that
just the guards being broken
> {1:3⋄4}0
4
> {0:3⋄4}0
4
 
 
4 hours later…
5:15 AM
@nathanrogers my guards don't return if not told to - you want {⍵>10:← 3 ⋄ 4} where means return
 
6:11 AM
oh thx
what is the performance trade off to evaluation over branching?
when is it advisable to use guards and branches over calculating the result you want?
for instance this instead of a guard
 
@nathanrogers when you're doing it only once or twice per frame.
 
so once or twice per frame, use a guard?
more than that find some calculation?
 
@nathanrogers a simple way to score the speed of an APL program is count the number of ¨. The more, the worse it'll be.
2
@nathanrogers in general doing any operations to simple scalars is horrible for speed
 
 
1 hour later…
7:26 AM
i'm finding the hardest part of learning apl is figuring out how to shape the data to do what you need.
@dzaima ⊇ is giving me assertion error
 
7:56 AM
@nathanrogers oh god what. Can you reproduce it in the repl & get the )stack?
 
8:54 AM
(or just give the full error given by APLP5 actually, i think it already gives it :|)
 
 
6 hours later…
2:44 PM
java.lang.AssertionError
at APL.types.arrs.DoubleArr.<init>(DoubleArr.java:13)
at APL.types.functions.builtins.fns.RShoeUBBuiltin.call(RShoeUBBuiltin.java:34)
at APL.Exec.update(Exec.java:164)
at APL.Exec.exec(Exec.java:127)
at APL.Main.execTok(Main.java:280)
at APL.Main.execLines(Main.java:272)
at APL.types.functions.userDefined.Dfn.call(Dfn.java:18)
at APL.types.functions.builtins.mops.EachBuiltin.call(EachBuiltin.java:20)
at APL.types.functions.DerivedMop.call(DerivedMop.java:16)
at APL.Exec.update(Exec.java:203)
@dzaima
I can't reproduce it in the repl
 
@nathanrogers yep, that was my primary suspect for the error. It's somehow ending up trying to make a DoubleArr with shape , but DoubleArr can't be scalar
 
sorry took so long. night time and all.
 
@nathanrogers thought so. Time zones :|
@nathanrogers oh god I'm stupid was wondering what called that but literally the second line there tells me ._.
so you're calling with a scalar left arg and a number array as the right
 
@nathanrogers for that A[n] should work. Still needs fixing though, assertion errors should never ever happen
 
2:51 PM
I was trying to use it after you told me I could use it as array yesterday.
 
@nathanrogers for all other situations other than the one I described it should work, and soon it shall for it too.
heh, with assertions disabled it gives an enclosed number :D
 
@dzaima How is that even possible when 2≡⊂2?
 
@Adám a DoubleArr with shape gets converted to an array with shape with the lone item being a number. The system is in an invalid state, hence the assertion error, though
 
@dzaima Ah.
 
is just special-cased to not enclose the given argument if it's a primitive, otherwise it easily could
I don't like that 2≡2⊇1 2 3 gives false with the buggy version though.
 
3:02 PM
@dzaima And you're sure you don't want to allow enclosing simple scalars like J?
 
@Adám is there a good reason for not not allowing disallowing it?
.oO(I should have assertions enabled for ./REPL)
 
@dzaima Is there a reason to disallow it?
 
at APL.types.functions.DerivedMop.call(DerivedMop.java:16) can't unsee every operator now being either a Mop or a Derived Mop.
 
@Adám no idea, I'm just bandwagoning :p
 
@dzaima J's model means that things like 'a' 'b' 'c'≢'abc' which is potentially useful.
 
3:06 PM
@Adám what? is 'a' ⊂'a'?
also I've got double-quotes for single-char literals, e.g. "a" "b" "c"≢"abc"
 
@dzaima Only in a strand, just like 'abc' 'def' 'ghi'≡(⊂'abc'),(⊂'def'),(⊂'ghi')
@dzaima Right, but that's ,¨'abc'. Isn't it strange though that there exist A≢⊂A is only true for some A?
 
@Adám yeah it is, but I just assumed there was a good reason do do scalars like that
 
Although I'm really mixed about this. Should 1 2 3≢1,2,3?
 
@Adám that's why I don't really like the 'a' 'b' 'c'≢'abc'
IMO just allowing enclosed scalars & doing nothing else would be fine
 
@dzaima I think the original reason was that APL"1" said 'abc'[2]≡'b'. Now if we didn't special-case on scalars, then 'abc'[2]≡⊂'b'
(Hm, now I want an extension that lets me click on code to execute it in TIO. Right-click to select language.)
 
3:12 PM
@Adám oh i never even thought that 'cd'≢'ab' 'cd' 'ef'[2]
 
@dzaima But now you realise it must be, right?
 
@Adám yeah
oh god i almost pushed the fix, but also making any array with shape throw AssertionError ಠ_ಠ
oh 1 2 3[2] doesn't work in my APL, it requires a variable ._.
 
@dzaima lol a coworker of mine has a post-it stamped to his monitor saying "DO NOT FORGET TO REMOVE TESTS BEFORE PUSHING"
 
@J.Sallé there have been a couple commits with System.out.printlns spammed around in my APL :p
@dzaima (also i really don't support my A[B], it's equal to B⌷A)
disabled being special for primitives. Some stuff is broken (e.g. ⍬⍴0 gives ⊂0), but it seems to be mostly stable
 
 
6 hours later…
9:47 PM
@dzaima I need help
 
@nathanrogers not a helpful message to get help..
:p
 
@nathanrogers ]help?
 
The should apply drag function returns 0's where it shouldn't apply drag, and 1's where it should
but when I try to use it to apply drag, the balls bounce every goddamnwhere
 
@dzaima Your APL doesn't have 0E0 notation, does it?
 
@Adám nope, not yet
 
9:51 PM
d←shouldApplyDrag×∊{¯1 drag ⍵}¨ ↓vecs vel
which should be 0 or 1 × drag applied to velocity
 
@nathanrogers Does ¯1∘drag¨ not work?
 
so if it should have drag then its not 0, but if not its 0
0 added to a velocity is velocity
drag + velocity is just that
so why do they accelerate like nuts
I've been banging my head since last night and it's driving me nuts
 
@dzaima I wish I could get your graphics capability as library for Dyalog APL…
 
@Adám I wish I could too, you know
 
(locations × (≢locations)⍴ 0 1) where locations is a series of x y x y x y x y , so I'm nulling out the x's
so that I can tell only when locations' y is > origin for each pair
 
9:54 PM
having to maintain a whole APL for it is pretty annoying :p
 
@dzaima Can't we just hire you?
 
@Adám school :/
 
@dzaima Internship? We're stil in the EU…
 
d←∊{¯2 drag ⍵}¨↓vecs vel
try just that as d
it works fine and applies drag
so then when I multiply it by 0 or 1, they skyrocket? what's the gives?
`d←shouldApplyDrag×∊{¯1 drag ⍵}¨ ↓vecs vel`
why does this make it schyzo?
 
@nathanrogers professional debugging tip: spam debug prints everywhere
 
9:58 PM
I did
I cleaned them up for the copy pasta
 
@nathanrogers schyzo?
@dzaima Btw, do you know about ⎕TRACE?
 
@Adám not in my APL (though no, haven't used it in Dyalog)
 
i mean, them numbers get real big real quick
 
@dzaima 2 5 7 ⎕TRACE 'fnname' sets "trace bits" for those lines. It means that when the lines are executed, fnname[2] followed by the result of that line is printed to session.
 
@nathanrogers yeah, I see
@Adám oh actually that doesn't sound that hard to implement
 
10:03 PM
@nathanrogers Oh. Schizo means something specific in informal Dyalog APL lingo.
 
Like / and \
 
@Zacharý See? \ is messing with you. ;-)
 
I don't understand how multiplying by 1 makes a number stratosphericly larger
 
LOL
 
@nathanrogers that usually means the problem is not there.
 
10:04 PM
but if the input values to the functions are the same...
 
Though, tbf, dzaima/APL doesn't have schizos.
 
SO it has half-schizo's or something?
 
the result of drag works just fine
 
@nathanrogers vel being >100 is when it's bad, right?
 
if you try it by itself, and if you log the "should apply drag" it is 0 and 1 when it should be
 
10:05 PM
Like x / y is still part of the operator or something?
 
yes that's bad
 
@Zacharý / is just reduce. is just replicate
 
it should hit the blue and slow down
 
@Zacharý Half of someone with dual personality disorder is just normal, no?
 
Ah, so just like RAD is currently (at least with /)
@Adám Schizo=Multiple-personality, but I get the joke :D
 
10:07 PM
so d gets set to 100s from nothing
 
@dzaima But / is last-axis, and only works on vectors‽
 
@Adám is lazily implemented, at some point in the future it should be exactly like Dyalogs A/B or A⌿B
 
@dzaima Probably makes most sense, and then you use [k] for axis (⍨)
 
@Adám I do have /[] for f⌿B, as ugly that might be
 
@dzaima d when just getting the enlist of the drag for each vel works just fine
it's when we multiply by the shouldApplyDrag
which is just a list of 0's and 1's
 
10:12 PM
yeah, understood that
 
@dzaima I just wish there was a better way. Btw, dyadic f/ doesn't seem to be working. Also, have you noticed that you have an available monadic function in ?
 
oh maybe your calculations are wrong & the numbers only explode if they're already somewhat big?
@Adám dyadic / isn't implemented yet (I've been annoyed by that too :| ), and yeah, but what to put there?
 
what's more is I couldn't get the branching version to work either @dzaima
 
@dzaima Btw, you could allow as special of ⍺f/ to mean length of along that dimension or alternatively it could mean don't enclose (or of that sake do enclose). Maybe monadic \ could be the diagonals of .
 
10:22 PM
something like {loc>origin:←¯2 drag vel⋄ 0 0}
 
@nathanrogers that should just work
just maybe don't use globals as the conditions :p
@nathanrogers example
but I'd personally suggest never doing dfn ¨, at least in my APL with its current implementation of dfn parsing (aka a very slow one)
@nathanrogers also I don't see any reason to use ×∘÷ as if there are infinities there, everything's already dead.
 
dead?
also, I'm using it for when vel is 0
because if I start at vel 0 then I get ??????????????????
⎕←ys←(loc ×(≢loc)⍴ 0 1)

⎕←d←∊{l v←↓vecs ⍵⋄ ∨/origin>l:←(¯2 drag v)⋄0 0}¨join ys vel
 
@nathanrogers
VALUE ERROR
 
@nathanrogers ..oh yeah, the inverse of infinity
 
what I meant is that doesn't work
 
10:27 PM
I'm 99% sure the problem's in the drag function
 
not that it doens't return values, but that the expression doesn't ssem to work
I don't see how @dzaima because it works by itself
the drag function works just fine in isolation
why would multiplying its result be broken?
 
@nathanrogers maybe that's just because you've never given it velocity that's bigger than a couple pixels/frame, which is what happens when you've got permadrag
 
⎕←d←∊{(¯2 drag ⍵)}¨↓vecs vel
⍝ ⎕←d←∊{¯2 drag ⍵}¨↓vecs vel
no
I'm applying gravity
vel +← gravity
every frame
 
@nathanrogers but you're also applying drag every frame, cancelling that out
 
loc +← vel +← gravity
try that
they bounce like normal
⎕←d←∊{(¯2 drag ⍵)}¨↓vecs vel

loc +← vel +← gravity+d
 
10:29 PM
@nathanrogers
VALUE ERROR
 
works as intended as well
it's only when conditionally adding drag or 0 that I get an issue
or when cancelling out the drag
 
so drag is multiplying the velocity squared by a positive number?
 
that's why I'm passing a negative number as the coefficient
 
oh.
haven't you've got the arguments to drag the wrong way around?
 
I don't think so
 
10:31 PM
⍝ ⍺ = vel, ⍵ = coeff
 
that comment is wrong
 
ಠ_____________ಠ
 
I updated it but then held ctrl Z
to undo all the ⎕←
I made the arguments uniform to friction so that it stopped giving me the confusion
 
does swapping the arguments give incorrect behavior? it seems to drag just fine for me
 
extremely
 
10:33 PM
What's this for?
 
a simple water simulation. trying to detect when an object hits water
@dzaima let me tio a few combinations to show you that the functions are working as intended
 
does this not function as you want it to?
https://tio.run/##tVRNb9NAEL3vr5hbnOajjksQh6KKDzXigOAvuPa6dXG8kddt1JZwAVUlNKhShSohcamE1EMlLlSVuCA1/2T/SHiz65S2HOBCFDs7OzNvdua9TTjIWvFumPbD2cx8/PTshdk/8kU/XMfvnjn43Fg0k4uFYETmwzvKVdG3@5MLml4SoghL59OyfF5lTX5MTzj0tzNL@2nJPm96Aned3xfmcPwaxohQbsBOTZJyTbmEAQcSc93wctnKNTI82cLPpZmcIbelHXCkcl0WYZpzfn6dl6khbaTrG3bjwm2Yw4McJXl7JIowj5@oTBWcF3Tvm/FXBDZXlszke9DtjoQAclnhhnogIz6@Z96fZiqqI4hH8NePmXyhCofCnNTaJnCoVFRuSNJRIWUuiPYAacanjO8qTU/eAL7ewL4dlO10W2Yw9o/itLg6s4OFe9kl3CpUoMES5WJaU2Wp@lUFm@yG8SeUv4yIf@kik4nDLtVAYEpJkUZlqvKKd5qe0A3mkRgOBtkOzcNEXEAzjMlagN4cY9d@zmOqv
@nathanrogers and do you really intend to square the velocity in drag?
 
the square of the magnitude
 
no idea what I'm doing but this makes it look more natural
https://tio.run/##tVTNTttAEL7vU8wtDgnBMU3VAxXqj0A9VO0rGHtNTB1v5DUgoOmlFaIpqZBQhVSpF6RKHJB6aYTUSyXyJvsi9JtdmwI9tJdGWXtnZ@abv28dDrP5eDdMB@HVlfn46dkLs3/ki0G4jveeOfjcWjCT6VwwIvPhHeWqGNjzyZRmFwQrwtbptCyfV16TH7MTNv2tzNJBWrLOm51A3eTn1ByOX0MYEcINWalJUq4plxCggGOuW14u53MND0/O43VhJmfwndcOOFK5Loswzdk/v/bL1Db10/W@PZi6A3N4kCMkH49EEebxE5Wpgv2C3n0z/grD9vKimXwPer2REEAuK9xQD2XE6Xvm/WmmoiaMuAV//ZnJF6pwKMxJrW0Ah0pFZV@Sjgopc0G0B0gzPmV8F2l28gbwzRbObaNspVsyg7B/FKfF5ZltLNRLzuFWoAIFlggX05oqSzWoIlhn14w/ofwlWPxLFZlMHHaphgJdSoo0KlOVV3On2QndmDwcw@Ew26HaTMQFOMOY
though squaring ¯1 doesn't seem to be that useful either
 
the magnitude of a scalar is the scalar
 
10:39 PM
@nathanrogers yeah, that's what I was just saying
 
magnitude needs a vector
speed = mag of vel
speed*2×coeff ×norm vel
is the formula I'm working off of
which
works just fine in isolation...............
it isn't the drag function
⎕←d←∊{¯2 drag ⍵}¨↓vecs vel


loc +← vel +← d+gravity
 
@nathanrogers
VALUE ERROR
 
this works as expected
loc +← vel +← gravity
this works as expected without d
it isn't the drag function
but when I mutiply the result of the drag function by 0's and 1's relative the position of the object at velocity, it fucks up
 
@nathanrogers is this the intended output of ¯1 drag 10 10?
 
same when trying to do it with branching
 
10:41 PM
@nathanrogers the problem's in drag, stop thinking about the branching
 
I don't know... this is the goddamn formula I was given
 
@nathanrogers well either it's wrong or you forgot a square root somewhere
 
@nathanrogers What do you expect it to do? For me, it is slightly unintuitive
 
@nathanrogers either way if I have speed 10 10 being dragged ¯2000 in any number is wrong one way or another
oh ×∘÷ doesn't actually work
10 ×∘÷ 2 is 10 ಠ_ಠ
..sorry
oh ÷A just doesn't work
 
oh thank god
I was gonna say, looks pretty verbatim to me :(
 
10:49 PM
oh that's a copy-paste mistake, ÷A×A ಠ_ಠ
that's what happens when you try to optimize and don't test things.
 
adding velocity squared (times something, whatever) to velocity every frame still doesn't feel right to me though
 
its the magnitude of the velocity squared
we're multiplying ¯1 × coeff ×speed*2
did you see my last tio?
I copied that code from a p5 js drag definition
 
11:09 PM
@dzaima
this still works
remove the d+ and gravity works as expected. so drag is happening exactly as it should
it's only when I try to branch ⍝ d←∊{l v←↓vecs ⍵⋄ ∨/origin<l:←10 drag v⋄0 0}¨join ys vel
that things fuck up
I just went and re verified my mag, norm, and drag is accurate to P5's version
 
@nathanrogers oh yep even the p5js example goes crazy with high enough gravity set on line 41
 
Oh, just found out that ⎕←a+←b is different in dzaima/apl and Dyalog
 
so the formula is wrong (or maybe it's just not supposed to be applied to things with velocity bigger than ~5)? anyway I should be sleeping right now bye
 
@H.PWiz oh it is? ._.
 
11:16 PM
https://tio.run/##tVTBattAEL3vV8zNduw4slKXUgKBFmJ6KO0vyNI6USqtjFZJSFz30mJSNy6BUAyFQgkUfAj00mDIMf6T/ZH0za6cJu2hvdRY0s7Om5mdN08K@slqdBTEaXBzYz5@evbCjE49kQbbeA7M8ef6mplcrvhDMh/ekcrylPc98/4rLwAjuB9jiQct5pQC5pHn4FoWz8tEk6vFlKMZ7pxJnMYF@6qLKdw1vl@ak/FrGEPCCfrs1CRJaVLSlrhCoNL1qpKrSiOiKlfxmJvJDLGr2iUOM6WLPIgVx6vbuCQ7oJ14e8ed1W2Yk2OFkrw9FHmgoqdZkuUc57cfmvE3ABub62byw2@3h0Igc1HmDXRfhnz8qnl/nmRhDSCm4K8/M/lCZR4KFGXdXeShIqNiR5IOcymVIBogpRmfc35XaTF9g/S1OvYtUbbTfZnAGJ1GcX49s8TCveEC7hXK0WCBchF1s6LI0rKCDXZk/JnK2wDiX7pIZM/lLrK@AEu9PA6LOFPl3GkxpTuTR2DQ7yeHtISJKLcaoQFOBQW6I92uS4nBRlsyurcT2SVCr7@3rIi4VtXiVvwaA3p
that works fine
Something with the drag coefficient being too high?
And I got it working with mass with:
gravity← mass×(≢loc)⍴0 .1
loc +← vel +← (d+gravity)÷mass
and drag coeff of 1
worked exactly as I thought it should... gah what a waste of my life
 

« first day (650 days earlier)      last day (1994 days later) »