« first day (707 days earlier)      last day (2244 days later) » 

00:54
oh huh that's an unexpected big difference
Now check out ⍵ ⍵⍴1(⍵×⍵)⍴
@H.PWiz oh huh
And then this
ngn
ngn
it makes sense to me
They need to allocate new space, because the shape vector has changed size
01:02
@ngn ah, i guess the array infrastructure doesn't allow pointing to the old data from a new array instance
ngn
ngn
@H.PWiz exactly
Arguably, with a max rank of 15, it could be a constant length array
@H.PWiz lots of wasted space though
Is there public documentation on how Dyalog pockets are structured?
ngn
ngn
01:18
@H.PWiz i expected to find info under "component files" or "auxiliary processors" but i can't find any
 
8 hours later…
09:26
@H.PWiz No, and that's intentional, so we can change it at will. E.g. for 18.0 we are working on a complete pocket restructuring, bumping max-rank, allowing additional types (bigger ints, magic arrays, …), and reserving space for flags (is-sorted, all-unique, …), etc.
ngn
ngn
10:01
@Adám oh nice. just the pocket struct? no buddy system or 0-based refcounts?
@ngn I don't know what those two things are. I can ask Jay to drop in here to chat with you if you want.
ngn
ngn
@Adám this. no need to disturb Jay
in a buddy system you allocate blocks of memory in powers of 2
if you don't find a block of the size you need, you split a larger block
@ngn Ah, instead of dynamically resizing based on exact current size.
ngn
ngn
@Adám yes. dyalog's mm was probably very efficient in the age for which it was designed - when the number of bytes you occupy mattered
but now things are different. with virtual memory you have practically unlimited address space
@ngn That sounds reasonable. I suggest you write to Jay about it.
ngn
ngn
10:11
@Adám we have talked. he knows and understands these things better than me.
i mean memory management with a buddy system
@ngn Ah, OK, maybe they are planning that too then, I just didn't hear/understand it.
ngn
ngn
or maybe they're stuck with the old design because there's too much code
as for 0-based refcounting, i don't think they would embrace it too easily. manipulating objects with refcount 0 is scary :)
@ngn What does it even mean? Keep pockets when not used anymore?
ngn
ngn
@Adám it's a technique for avoiding pairs of increment/decrement operations on the refcount
if a function's argument is refc=0, the function is obliged to "consume" it by either freeing the memory, or returning it, or reffing it
returned objects could also have refc=0, and that's the responsibility of the caller
this gets tricky with multiple arguments or other situations in which 2 or more objects could have refc=0 at the same time
 
1 hour later…
ngn
ngn
12:11
^ project euler 100 in ngn/k. that one problem requires floating point (logarithms) ... :(
99 is actually possible by actually computing the exponents. At least with Haskell (which uses gmp)
ngn
ngn
@H.PWiz the problem mentions millions of digits. gmp must be using fft or something for multiplication
Maybe. Haskell also does powers by repeated squaring which helps
ngn
ngn
@H.PWiz oh, yeah, repeated squaring is clear
mine just segfaults
my bignum multiplication might be a little too wasteful, it uses O(n^2) memory :)
 
1 hour later…
ngn
ngn
13:39
haha! sovled it
represent big numbers as (ndigits; afewleadingdigits). when multiplying: add the first components (with some correction), multiply the second components and keep only the leading digits from the product
 
3 hours later…
16:38
Was talking w a friend about possibilities for the sum of a 2d6 roll and found a super neat way in dyalog apl to generate the table: ∘.+⍨⍳6. (row result of first die and cols the 2nd or vice versa) ⍨ super handy for making 1-liners without any parens.
@Feeds hmm, would a builtin for {⊃ ∘.⍺⍺/ ⍺⍴ ⊂⍵} be useful?
17:12
@dzaima Other than silliness, what does it provide over being explicit?
@Adám simplicity. What does provide over (>∨=) or ~⍺<⍵?
also I'd call ⍴⊂ a silly thing too
@dzaima (⍺⍺\/⍺∘⍴)⍢⊂⍵
@Adám how are those slashes meant to be interpreted
hmm should ⊂⍣¯1 error on non-scalar ?
@dzaima Dyadic `⍺⍺` is outer product.
@dzaima Yes. And it does, no?
@Adám oh i didn't even think about testing in dyalog
is \/ there supposed to be replicate reduce or ⍺⍺ scan replicated?
17:24
@dzaima Neither, it is outer-product reduce
@dzaima Huh?
@Adám yeah, i messed up my lazy ⍺⍴scalar, which made it function like ⍺⍴⊂⍵
> (1 2 3)(1 2 3)≡2⍴ ⊂1 2 3
1
works now
while at it, i'll fix scalar functions so that they work on enclosed objects too, not just primitives :|
oh wow my scalar function handling was badly implemented
 
1 hour later…
19:02
there, now that example does what it's supposed to, along with 1 2 3+⊂10 20 working

« first day (707 days earlier)      last day (2244 days later) »