home.social

#arrayprogramming — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #arrayprogramming, aggregated by home.social.

  1. I implemented org-babel support for 3 array languages I like a lot: Goal¹, BQN² and growler/k³. These languages are great for data munging so I find it very handy to use them in #OrgMode to process data stored in org tables. You can grab my implementations from my Emacs configuration at:

    github.com/oantolin/emacs-conf
    github.com/oantolin/emacs-conf
    github.com/oantolin/emacs-conf

    ¹ codeberg.org/anaseto/goal
    ² mlochbaum.github.io/BQN/
    ³ codeberg.org/growler/k, forked from codeberg.org/ngn/k

    #Emacs #ArrayProgramming

  2. I implemented org-babel support for 3 array languages I like a lot: Goal¹, BQN² and growler/k³. These languages are great for data munging so I find it very handy to use them in #OrgMode to process data stored in org tables. You can grab my implementations from my Emacs configuration at:

    github.com/oantolin/emacs-conf
    github.com/oantolin/emacs-conf
    github.com/oantolin/emacs-conf

    ¹ codeberg.org/anaseto/goal
    ² mlochbaum.github.io/BQN/
    ³ codeberg.org/growler/k, forked from codeberg.org/ngn/k

    #Emacs #ArrayProgramming

  3. I implemented org-babel support for 3 array languages I like a lot: Goal¹, BQN² and growler/k³. These languages are great for data munging so I find it very handy to use them in #OrgMode to process data stored in org tables. You can grab my implementations from my Emacs configuration at:

    github.com/oantolin/emacs-conf
    github.com/oantolin/emacs-conf
    github.com/oantolin/emacs-conf

    ¹ codeberg.org/anaseto/goal
    ² mlochbaum.github.io/BQN/
    ³ codeberg.org/growler/k, forked from codeberg.org/ngn/k

    #Emacs #ArrayProgramming

  4. I implemented org-babel support for 3 array languages I like a lot: Goal¹, BQN² and growler/k³. These languages are great for data munging so I find it very handy to use them in #OrgMode to process data stored in org tables. You can grab my implementations from my Emacs configuration at:

    github.com/oantolin/emacs-conf
    github.com/oantolin/emacs-conf
    github.com/oantolin/emacs-conf

    ¹ codeberg.org/anaseto/goal
    ² mlochbaum.github.io/BQN/
    ³ codeberg.org/growler/k, forked from codeberg.org/ngn/k

    #Emacs #ArrayProgramming

  5. I implemented org-babel support for 3 array languages I like a lot: Goal¹, BQN² and growler/k³. These languages are great for data munging so I find it very handy to use them in #OrgMode to process data stored in org tables. You can grab my implementations from my Emacs configuration at:

    github.com/oantolin/emacs-conf
    github.com/oantolin/emacs-conf
    github.com/oantolin/emacs-conf

    ¹ codeberg.org/anaseto/goal
    ² mlochbaum.github.io/BQN/
    ³ codeberg.org/growler/k, forked from codeberg.org/ngn/k

    #Emacs #ArrayProgramming

  6. CW: Advent of Code 2025, day 8 in K

    init:1+!n:#:d:`I$","\'0:"08.in"
    ds:1_'ds@<ds:{(+/t*t:d[x]-d[y]),x,y}.'p@&</'p:+!n,n
    conn:{(x*~f)+x[y[0]]*f:x=x[y[1]]}
    steps:1000#
    :one:*/t 3#>t:.#'=init conn/steps ds
    :two:*/*+d {:[&/g=*g:conn[x;*y];*y;o[g;1_y]]}[init;ds]

    Part 2 takes a metric eternity to converge. There must be a better solution, but this will have to do for now.

    #AdventOfCode #AoC2025 #APLJK #ArrayProgramming

  7. CW: Advent of Code 2025, day 8 in K

    init:1+!n:#:d:`I$","\'0:"08.in"
    ds:1_'ds@<ds:{(+/t*t:d[x]-d[y]),x,y}.'p@&</'p:+!n,n
    conn:{(x*~f)+x[y[0]]*f:x=x[y[1]]}
    steps:1000#
    :one:*/t 3#>t:.#'=init conn/steps ds
    :two:*/*+d {:[&/g=*g:conn[x;*y];*y;o[g;1_y]]}[init;ds]

    Part 2 takes a metric eternity to converge. There must be a better solution, but this will have to do for now.

    #AdventOfCode #AoC2025 #APLJK #ArrayProgramming

  8. CW: Advent of Code 2025, day 8 in K

    init:1+!n:#:d:`I$","\'0:"08.in"
    ds:1_'ds@<ds:{(+/t*t:d[x]-d[y]),x,y}.'p@&</'p:+!n,n
    conn:{(x*~f)+x[y[0]]*f:x=x[y[1]]}
    steps:1000#
    :one:*/t 3#>t:.#'=init conn/steps ds
    :two:*/*+d {:[&/g=*g:conn[x;*y];*y;o[g;1_y]]}[init;ds]

    Part 2 takes a metric eternity to converge. There must be a better solution, but this will have to do for now.

    #AdventOfCode #AoC2025 #APLJK #ArrayProgramming

  9. CW: Advent of Code 2025, day 8 in K

    init:1+!n:#:d:`I$","\'0:"08.in"
    ds:1_'ds@<ds:{(+/t*t:d[x]-d[y]),x,y}.'p@&</'p:+!n,n
    conn:{(x*~f)+x[y[0]]*f:x=x[y[1]]}
    steps:1000#
    :one:*/t 3#>t:.#'=init conn/steps ds
    :two:*/*+d {:[&/g=*g:conn[x;*y];*y;o[g;1_y]]}[init;ds]

    Part 2 takes a metric eternity to converge. There must be a better solution, but this will have to do for now.

    #AdventOfCode #AoC2025 #APLJK #ArrayProgramming

  10. CW: Advent of Code 2025, day 8 in K

    init:1+!n:#:d:`I$","\'0:"08.in"
    ds:1_'ds@<ds:{(+/t*t:d[x]-d[y]),x,y}.'p@&</'p:+!n,n
    conn:{(x*~f)+x[y[0]]*f:x=x[y[1]]}
    steps:1000#
    :one:*/t 3#>t:.#'=init conn/steps ds
    :two:*/*+d {:[&/g=*g:conn[x;*y];*y;o[g;1_y]]}[init;ds]

    Part 2 takes a metric eternity to converge. There must be a better solution, but this will have to do for now.

    #AdventOfCode #AoC2025 #APLJK #ArrayProgramming

  11. CW: Advent of Code 2025, day 7 in K

    rng:!#*data:0:"07.in"
    spls:l@&0<#'l:&'"^"=1_data
    msks:(+/rng=/:(-1;1)+)@/:/:spls
    f:{spl:+/(n@&0<n)*msks[y]@&0<n:|/+t:(1_x)*/:rng=/:spls[y]
    str:(1_x)*~|/t
    ((+/0<n)+*x),str+spl}
    :(one;two):(*:;+/1_)@\:(0,"S"=*data) f/!# spls

    It was a pleasant surprise that a single fold could solve both parts.

    #AdventOfCode #AoC2025 #ArrayProgramming #APLJK

  12. CW: Advent of Code 2025, day 7 in K

    rng:!#*data:0:"07.in"
    spls:l@&0<#'l:&'"^"=1_data
    msks:(+/rng=/:(-1;1)+)@/:/:spls
    f:{spl:+/(n@&0<n)*msks[y]@&0<n:|/+t:(1_x)*/:rng=/:spls[y]
    str:(1_x)*~|/t
    ((+/0<n)+*x),str+spl}
    :(one;two):(*:;+/1_)@\:(0,"S"=*data) f/!# spls

    It was a pleasant surprise that a single fold could solve both parts.

    #AdventOfCode #AoC2025 #ArrayProgramming #APLJK

  13. CW: Advent of Code 2025, day 7 in K

    rng:!#*data:0:"07.in"
    spls:l@&0<#'l:&'"^"=1_data
    msks:(+/rng=/:(-1;1)+)@/:/:spls
    f:{spl:+/(n@&0<n)*msks[y]@&0<n:|/+t:(1_x)*/:rng=/:spls[y]
    str:(1_x)*~|/t
    ((+/0<n)+*x),str+spl}
    :(one;two):(*:;+/1_)@\:(0,"S"=*data) f/!# spls

    It was a pleasant surprise that a single fold could solve both parts.

    #AdventOfCode #AoC2025 #ArrayProgramming #APLJK

  14. CW: Advent of Code 2025, day 7 in K

    rng:!#*data:0:"07.in"
    spls:l@&0<#'l:&'"^"=1_data
    msks:(+/rng=/:(-1;1)+)@/:/:spls
    f:{spl:+/(n@&0<n)*msks[y]@&0<n:|/+t:(1_x)*/:rng=/:spls[y]
    str:(1_x)*~|/t
    ((+/0<n)+*x),str+spl}
    :(one;two):(*:;+/1_)@\:(0,"S"=*data) f/!# spls

    It was a pleasant surprise that a single fold could solve both parts.

    #AdventOfCode #AoC2025 #ArrayProgramming #APLJK

  15. CW: Advent of Code 2025, day 7 in K

    rng:!#*data:0:"07.in"
    spls:l@&0<#'l:&'"^"=1_data
    msks:(+/rng=/:(-1;1)+)@/:/:spls
    f:{spl:+/(n@&0<n)*msks[y]@&0<n:|/+t:(1_x)*/:rng=/:spls[y]
    str:(1_x)*~|/t
    ((+/0<n)+*x),str+spl}
    :(one;two):(*:;+/1_)@\:(0,"S"=*data) f/!# spls

    It was a pleasant surprise that a single fold could solve both parts.

    #AdventOfCode #AoC2025 #ArrayProgramming #APLJK

  16. CW: Advent of Code 2025, day 6 in K

    d:0:"06.in"
    op:(+/;*/)@"*"=op@&~" "=op:*|d
    :one:+/op@'+.'1_|d
    :two:+/op@'n 1_'.=+\~n:0,.'+|1_|d

    The fact that the input file was nearly valid K was helpful.

    #AdventOfCode #APLJK #AoC2025 #ArrayProgramming

  17. CW: Advent of Code 2025, day 6 in K

    d:0:"06.in"
    op:(+/;*/)@"*"=op@&~" "=op:*|d
    :one:+/op@'+.'1_|d
    :two:+/op@'n 1_'.=+\~n:0,.'+|1_|d

    The fact that the input file was nearly valid K was helpful.

    #AdventOfCode #APLJK #AoC2025 #ArrayProgramming

  18. CW: Advent of Code 2025, day 6 in K

    d:0:"06.in"
    op:(+/;*/)@"*"=op@&~" "=op:*|d
    :one:+/op@'+.'1_|d
    :two:+/op@'n 1_'.=+\~n:0,.'+|1_|d

    The fact that the input file was nearly valid K was helpful.

    #AdventOfCode #APLJK #AoC2025 #ArrayProgramming

  19. CW: Advent of Code 2025, day 6 in K

    d:0:"06.in"
    op:(+/;*/)@"*"=op@&~" "=op:*|d
    :one:+/op@'+.'1_|d
    :two:+/op@'n 1_'.=+\~n:0,.'+|1_|d

    The fact that the input file was nearly valid K was helpful.

    #AdventOfCode #APLJK #AoC2025 #ArrayProgramming

  20. CW: Advent of Code 2025, day 6 in K

    d:0:"06.in"
    op:(+/;*/)@"*"=op@&~" "=op:*|d
    :one:+/op@'+.'1_|d
    :two:+/op@'n 1_'.=+\~n:0,.'+|1_|d

    The fact that the input file was nearly valid K was helpful.

    #AdventOfCode #APLJK #AoC2025 #ArrayProgramming

  21. I really want to do more with but there's no Libre flavor I know that runs on the .

    comes close, but not quite APL syntax and loading data into it is a pain.

    Anyone?

  22. I really want to do more with #APL but there's no Libre flavor I know that runs on the #GPU .

    #Futhark comes close, but not quite APL syntax and loading data into it is a pain.

    Anyone?

    #freesoftware #arrayprogramming #askfedi

  23. I really want to do more with #APL but there's no Libre flavor I know that runs on the #GPU .

    #Futhark comes close, but not quite APL syntax and loading data into it is a pain.

    Anyone?

    #freesoftware #arrayprogramming #askfedi

  24. I really want to do more with #APL but there's no Libre flavor I know that runs on the #GPU .

    #Futhark comes close, but not quite APL syntax and loading data into it is a pain.

    Anyone?

    #freesoftware #arrayprogramming #askfedi

  25. I discovered the ArrayCast this week and have enjoyed it tremendously.

    arraycast.com/

    Fun content for nerds; positive and constructive perspectives; and soothingly orderly conversations where folks don’t interrupt each other 😌

  26. CW: AoC Day 10 Part 1 in Uiua

    Map ← ⍥(⍉≡(⊂⊂⊙:.@.))2 ⊜∘≠@\n.&fras"10.in"
    Inf ← 9999 # applied infinity
    F ← +×Inf=0./+⊞=:Map
    D ← F"|LJ"
    U ← F"|7F"
    R ← F"-J7"
    L ← F"-FL"
    M ← ↧+1×
    TD ← M D ↻¯1.
    TU ← M U ↻ 1.
    TR ← M R≡↻¯1.
    TL ← M L≡↻ 1.
    T ← TU TL TD TR
    -1/↥/↥×≠Inf⍢(T.⊙;)(¬≍)⊃∘(×0) F"S"

    #AdventOfCode #Uiua #ArrayProgramming #APLJK

  27. CW: Advent of Code · Day 15

    f:"15.txt"
    n:2000000
    c:"-",,/$!10
    i:{2 2#.`c$(" "*~i)+x*i:+/c=\:x}'0:f
    a:{x|-x}
    d:{+/a x-y}
    m:{$[~~#:i:&x[0;1]>-2+1_x[;0]
    (,x[0;0],|/x[0,1+*i;1]),x[(!#:x)^0,(1+*i)]
    x]}
    r:{cl:i@&{d[1_x;x[1],y]<1+*x}[;x]'(d.'i),'*+i;
    r@<*+r:{x[1]+(-s)+0,2*s:x[0]-a y-x[2]}[;x]'(d.'cl),'*+cl}

    --/*m/r[n]

    x+4000000*1+*|*m/r[x:*&1<#'(m/r@)'!n*2]

    / Takes five minutes using
    / codeberg.org/ngn/k

    / There must be a better way

    / #k #apljk #apl #adventofcode #arrayprogramming

  28. CW: Advent of Code · Day 11

    / read & parse
    v:!#:i:0N 7#(,""),0:"11.txt"
    s:(.18_)'i[;2]
    n:19_'i[;3]
    a:$*/.'d:(*|" "\)'i[;4]
    t:|'(.*|)''i[;5 6]

    / simians → functions
    sf:{."{[old](,w),,t[",($x),"]@~",(d x),"!w:",a,"!_(",n[x],")%rf}"}'v

    / turn, round, play
    tr:{@[y;x;0#],'*'(t[0]@&)''(!#:y)=\:1_t:sf[x;y[x]]}
    rn:{x{tr[y;x]}\!#:x}
    pl:{*/t 2#>t:+/(m# v){y*x=v}'(m:(#:i)*x)##''h,,/(h:,s){y; rn@*|x}\!x}

    / relief factor and round no.
    rf:3
    pl 20

    rf:1
    pl 10000

    / #k #apljk #apl #adventofcode #arrayprogramming

  29. CW: Advent of Code · Day 10

    / The screen size
    (h;w):s:6 40

    / The cycles that matter
    c:20+w*!h

    / This parses our input
    p:{$[x[3]="x";(`I$5_x),0;,0]}

    / Parts one and two
    +/c*(r:+\1,,/p'0:"10.txt")c-2
    (`0:" #"(!w){3>d*d:y-x}')'s# 1,r;

    / How about another live solving stream this Monday?
    / twitch.tv/janstepien

    / #k #apljk #apl #adventofcode #arrayprogramming #programming

  30. CW: Advent of Code · Day 9

    / establish our coordinates
    U:-D:|L:-R:1 0

    / unpack the input into an array of moves,
    / each taking just one step
    m:,/({y#,x}..'" "\)'0:"9.txt"

    / drag a short tail
    s:{(,h),,t+{(x>0)-x<0}v*1<|/v*v:-(t:*|x)-h:y+*x}

    / move a chunk of a long tail
    c:{(t;m):2 2# y; *|s[(x;t);m]}

    / drag a long tail
    t:{(,h+y),(h:*x)c\(1_x),'(,y),(-2+#:x)#,0 0}

    / part one and two
    p:{#=*|+x y\m}
    p[2 2# 0;s]
    p[10 2# 0;t]

    / #k #apljk #apl #adventofcode #arrayprogramming

  31. CW: Advent of Code · Day 8

    i:`I$''0:"8.txt"

    / external view from left side
    v:{1_|1_|+1_|2_|+(x,\:0)>(|\0,)'x}

    / count trees on the edges
    e:4*-1+#:i

    / count trees visible from the left side
    m:|~0=!-1+#:i
    l:{1+(*&)'~((m&1_)'(*'x)>x)}

    / count trees visible to the right in the
    / entire forest
    f:{+(|!#:x)&{l@(y_(y+s:#:x)#)'x}[x]'!#:x}

    / invoke x with all four rotations of y
    a:{(4-y)(+|:)/ x y(+|:)/i}

    e++//|/a[v;]'!4
    |//*/a[f;]'!4

    / #k #apljk #apl #adventofcode #arrayprogramming #programming

  32. CW: Advent of Code · Day 7

    e:{(" "\x) y}
    a:{(,x,(,"/"),*y),y}
    c:{n:e[y;2];@[x;0;$[n~,"/";{,,"/"};n~"..";1_;a[n]]]}
    d:l:{y; x}
    s:{.e[y;0]; @[x;1;((`$'*x)!(#*x)#.e[y;0])+]}
    f:{."clds"@*&("clr"=x[2]),1}
    d:(!0;`!!0){(f y)[x;y]}/i:0:"7.real"
    +/v@&~100000<v:.*|d
    g:40000000
    t@*<t:-:g-r+t@&0<t:(.m)+g-r:(m:*|d)@`"/"

    / Fold the input lines using a dynamic dispatch
    / and keeping the directory sizes in a dictionary.

    / The language is growing on me.

    / #k #apljk #apl #adventofcode #arrayprogramming #programming

  33. CW: AoC Day 10 Part 1 in Uiua

    Map ← ⍥(⍉≡(⊂⊂⊙:.@.))2 ⊜∘≠@\n.&fras"10.in"
    Inf ← 9999 # applied infinity
    F ← +×Inf=0./+⊞=:Map
    D ← F"|LJ"
    U ← F"|7F"
    R ← F"-J7"
    L ← F"-FL"
    M ← ↧+1×
    TD ← M D ↻¯1.
    TU ← M U ↻ 1.
    TR ← M R≡↻¯1.
    TL ← M L≡↻ 1.
    T ← TU TL TD TR
    -1/↥/↥×≠Inf⍢(T.⊙;)(¬≍)⊃∘(×0) F"S"

    #AdventOfCode #Uiua #ArrayProgramming #APLJK

  34. CW: AoC Day 10 Part 1 in Uiua

    Map ← ⍥(⍉≡(⊂⊂⊙:.@.))2 ⊜∘≠@\n.&fras"10.in"
    Inf ← 9999 # applied infinity
    F ← +×Inf=0./+⊞=:Map
    D ← F"|LJ"
    U ← F"|7F"
    R ← F"-J7"
    L ← F"-FL"
    M ← ↧+1×
    TD ← M D ↻¯1.
    TU ← M U ↻ 1.
    TR ← M R≡↻¯1.
    TL ← M L≡↻ 1.
    T ← TU TL TD TR
    -1/↥/↥×≠Inf⍢(T.⊙;)(¬≍)⊃∘(×0) F"S"

    #AdventOfCode #Uiua #ArrayProgramming #APLJK

  35. CW: AoC Day 10 Part 1 in Uiua

    Map ← ⍥(⍉≡(⊂⊂⊙:.@.))2 ⊜∘≠@\n.&fras"10.in"
    Inf ← 9999 # applied infinity
    F ← +×Inf=0./+⊞=:Map
    D ← F"|LJ"
    U ← F"|7F"
    R ← F"-J7"
    L ← F"-FL"
    M ← ↧+1×
    TD ← M D ↻¯1.
    TU ← M U ↻ 1.
    TR ← M R≡↻¯1.
    TL ← M L≡↻ 1.
    T ← TU TL TD TR
    -1/↥/↥×≠Inf⍢(T.⊙;)(¬≍)⊃∘(×0) F"S"

    #AdventOfCode #Uiua #ArrayProgramming #APLJK

  36. CW: AoC Day 10 Part 1 in Uiua

    Map ← ⍥(⍉≡(⊂⊂⊙:.@.))2 ⊜∘≠@\n.&fras"10.in"
    Inf ← 9999 # applied infinity
    F ← +×Inf=0./+⊞=:Map
    D ← F"|LJ"
    U ← F"|7F"
    R ← F"-J7"
    L ← F"-FL"
    M ← ↧+1×
    TD ← M D ↻¯1.
    TU ← M U ↻ 1.
    TR ← M R≡↻¯1.
    TL ← M L≡↻ 1.
    T ← TU TL TD TR
    -1/↥/↥×≠Inf⍢(T.⊙;)(¬≍)⊃∘(×0) F"S"

    #AdventOfCode #Uiua #ArrayProgramming #APLJK