« first day (751 days earlier)   

9:21 AM
@dzaima @H.PWiz Not always true, some operators do look into what their operands are. E.g. and are highly optimised for certain dfns. Try it online!
 
9:52 AM
@Adám I'd call {+/,⍵}⌺ an idiom, as it is a special-case because is very ¨y. I find APLs tendency to work around ¨ being slow strange. If tried to generally optimize & inline complexer dfns though, it'd be another story.
 
@dzaima We are thinking of various strategies. Memoisation could speed up similar to how hashlife works. Another method would be a way to the programmer to declare (or a way for the system to detect) that a function is free of side effects and outside influences, and so can run in processor parallel. If you have good ideas, maybe we should hire you?
 
10:08 AM
@Adám making the system detect whether a function is side-effect-less shouldn't be that hard, just a tedious amount of edge cases. I was more thinking "replace occurences of +/,⍵ with cumulative sums or whatever" though, so this wouldn't be that big of a difference. Extracting the ⍵[2;2] shouldn't be impossible either.
I do feel however that if such everything-changing optimizations are implemented, there should be a way to see 100%-surely whether a thing is optimized or not - adding 1+ might seem harmless but could easily break optimizing strategies.
 
 
2 hours later…
12:10 PM
Roger Hui brings some order to grade up and grade down in his latest blog post #Dyalog #APL https://www.dyalog.com/blog/2019/02/ascending-and-descending/
 
ngn
12:38 PM
@Adám 999
 
@ngn segfault :O
 
ngn
@J.Sallé it happens
 
maybe when you're a wizard it does >.>
 
ngn
1:03 PM
@PaulMansour in the v15 interpreter i have, a few simple tricks improved the performance almost twice:
      ⎕cy'dfns' ⋄ ⎕io←1
      C←1000000⍴'A1' 'XX101' 'ABC1000'
      cmpx '26⊥⍉{⍵{(+/⍵)⌽⍵×⍺}⍵≠27}⎕A⍳↑C' '{⎕io←0 ⋄ +⌿(0,26*⍳≢b)[+⍀27≠b]×b←(''.'',⎕a)⍳⊖(⌈/+⌿a∊⎕a)↑a←⍉↑⍵}C'
  26⊥⍉{⍵{(+/⍵)⌽⍵×⍺}⍵≠27}⎕A⍳↑C				       → 8.4E¯2	|   0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
  {⎕io←0 ⋄ +⌿(0,26*⍳≢b)[+⍀27≠b]×b←('.',⎕a)⍳⊖(⌈/+⌿a∊⎕a)↑a←⍉↑⍵}C → 3.8E¯2	| -55% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
first, mix and transpose as early as possible - it's better to work on chars than on larger types, and it's better to work along the leading axis for reverse, take, drop, sum, etc
remove unnecessary columns (or later: rows) from the mixed matrix to improve cache locality. in the example we need only 3, not the full 7 (ABC1000 has the most letters)
use ⎕io←0
avoid 26⊥ and by manually building a vandermonde matrix (a matrix of powers of 26), then multiply and +⌿
 
1:28 PM
@ngn That's taking it up a notch! Very interesting, thanks!
 
 
3 hours later…
4:07 PM
Don't forget you can see information on scheduled events as well as find materials/videos for past presentations at https://www.dyalog.com/dates-for-your-diary.htm
 

« first day (751 days earlier)