« first day (1407 days earlier)      last day (1248 days later) » 
01:00 - 16:0016:00 - 23:00

4:01 PM
@dzaima im thinking i need to store the value map separately from the list of functions
in the js case S.map(([...]) => e => {...} would become S.map(([...]) => (v,e) => {}
 
@cannadayr what's the "list of functions"?
 
@TessellatingHeckler Ha, mine was very similar to yours: gist.github.com/xpqz/6627d893ecfadb8511826718e80d1083
Didn't think to use power though.
 
@cannadayr the variable map definitely needs to be a new copy for each evaluation of a function
 
neat, basically identical part 1.
I happened to have asked about outer-product-power here fairly recently for some other code, so it was in memory.
something like generating all combinations of numbers with ∘., I think
 
4:06 PM
@dzaima what is the "schema" of the environment?
 
ngn
@xpqz i would even make it a parameterized dfn and call it twice, with 2 and 3 as the number of items in the sum/product
 
How do you mean, something like {∘.⍺⍺⍣⍺⊢⍨⍵}?
 
ngn
@xpqz yes, something like that, though you probably don't need to parameterize ⍺⍺ there
 
@dzaima ty. erlang has a make_ref/0 which returns a temporally unique reference. might be helpful need to look into it.
yea this is helpful
 
ngn
4:19 PM
@xpqz 1 2{×/⍵[⊃⍸2020=∘.+⍣⍺⍨⍵]}¨⊂⍎⍕⊃⎕nget'1'1
 
(i have no clue how mutability/immutability works in erlang)
 
@ngn Interesting, but the parens are necessary and breaks the rule that parenthesising something doesn't change it's meaning. Also, arguments are un-APLy, even if practical. You'd be able to do I←[]? Also [] is very confusable with since context doesn't help.
 
ngn
@Adám i haven't thought it through. maybe a dedicated squiggle would make more sense.
@Adám trains already break that rule about parenthesising
 
@ngn No, they group stuff, just like stranding and order of execution.
 
@ngn for trains, at least, there's no way to make them work without some overhead. But there definitely are ways to not require a primitive function to be 4 chars long
 
ngn
4:29 PM
@Adám (f g h)a is different from f g h a. a train is a group of terms ending with a function only when in isolation.
 
@ngn I've long been advocating as "sane indexing". I think ⌷⍨∘⊃⍨⍤0 99 is the best definition.
could work too, but it is quite ugly. At least it indicates which argument has the indices.
if we wanted the indices on the right. (Practical, but un-APLy.)
 
@dzaima yea im still figuring it out. usually you can just act like everything is immutable and pattern match which makes it nice for writing networked-services. this level of manipulation seems to be mostly reserved for BEAM vm hackers.
 
has the benefit of an obvious keyboard location.
 
i miight have a path fwd using make_ref/0 and storing a datastructure of key-value pairs where the key is a unique reference and the value is the variable
 
@cannadayr that has a side-effect that you'd need to make a custom gc if you wanted to not leak memory
 
4:36 PM
@dzaima good point, yea im asking around diff erlang chat groups to see if i can use the native garbage collection.
 
5:25 PM
Would just like to report that the new TryAPL.org needs some more testing. Half the time when I am using it, it just completely breaks. Shift key no longer works, Alt + up/down and history no longer works. It seems very fragile
Is there a way to get to the old tryapl.org?
also, seems like execute doesn't work
> VALUE ERROR: Undefined name: ß
 
5:58 PM
@code_report Very strange. We had it running online for months, as we were testing all kinds of things. Can you reproduce issues from a clean slate?
@code_report No. It had security holes.
@code_report What expression?
 
6:41 PM
it seems like this isn't unheard of to reimplement a heap & gc in erlang for a vm
https://github.com/rvirding/luerl/blob/develop/src/luerl_heap.erl#L517
might just write initial version w/o gc and manually kill/restart the entire process
i am avoiding having to dip into a NIF or port (either an in-process C API or a separate process that communicates over a socket)
 
@cannadayr Looks like it would be pretty easy to copy that garbage collector too. The BQN version should be smaller since scopes/environments are the only kind of dynamically allocated mutable data, and it looks like the Lua VM has four different things to track.
And the possible types of reference are array elements, block variables, block parents, and compound functions. So the mark() functions should be simpler as well, but you do have to make sure to expose the components of compound functions (trains and derived funtions) somehow if you don't want them to leak.
I guess it's more rewriting than copying.
 
7:12 PM
this has def been one of the more challenging prjs ive self-assigned. theres likely something wrong w/ me.
but its still making progress
 
7:29 PM
found a video on youtube about luerl and skimmed thru it
"the main difficulty of luerl implementation was the need to implement Lua's mutable global data with erlang's immutable local data"
🤔
 
 
2 hours later…
9:37 PM
@Adám
⍎¨' '(≠⊆⊢)'1 2 3'
VALUE ERROR: Undefined name: ß
 
@dzaima dzaima.github.io/paste is brilliant thank you for making it
 
:D
stupid pro-tip in TryAPL: alt-tab out of it and back to it for permanent up/down arrows being moving in history :P
@RikedyP also when moving through history it seems to append 6 indentation spaces after the code
 
Oh so that's what caused that
Tbh I much prefer that, I think for beginners they will be used to up + down, and it is more intuitive anyway
 
ty btw, starting to make more sense

so, if I have an array of variable references:
[Ref1,Ref2,undefined]

and a list of {reference,value} tuples
[{Ref1,[1,2,3]},{Ref2,[3,4,5]}]
i can change a variable by updating the reference
[Ref1,Ref2,undefined] becomes [Ref1,Ref1,undefined]
the value the reference is pointing to doesnt change, I just mutate to a new reference
 
∊1-⍨ ⎕D∘⍳¨ bit of a hack but this seems to work instead of format @code_report
 
9:47 PM
@rak1507 Execute.
 
scroll up
oh right
it's called execute not format, oops
 
@dzaima Probably because that makes the JS code think Alt is being held, since it never registers Alt being let go, and then Up/Down are treated like Alt+Up/Down.
 
@Adám definitely. I've encountered similar issues in many places (most probably in my code :p)
 
@code_report OK, I can see that. Will have a look. It is all very complicated because TryAPL uses a cover function for to keep the server safe.
 
@Adám my testing shows that for some reason it just doesn't like more than one invocation of
 
9:55 PM
@dzaima I can see that. Oddly, it does work with nested ones (which was the main thing I was worried about and had to test extensively).
 
Interestingly ⍎'⍎''⍎''''1''''''' gives a rank error
 
@rak1507 ⍎'1' alone doesn't work
 
Oh yeah
 
OK, I think I see that issue. But there are obviously more.
 
quine is a good test example :D
 
01:00 - 16:0016:00 - 23:00

« first day (1407 days earlier)      last day (1248 days later) »