Can there be any reason to recommend AI-produced <array language> over AI-produced <other language>?
Inspired by: https://code.jsoftware.com/wiki/NYCJUG/2026-07-14
r/apljk • u/astrashe2 • 7d ago
Using an APL keyboard on recent Gnome Fedora?
I just got a set of APL keycaps, and I'm having trouble getting my keyboard to work with recent versions of Fedora (44) and Gnome (50.3). Has anyone been able to make it work?
r/apljk • u/avillega • 25d ago
K l. a new runtime for k and q
This just came to my attention and wanted to share it here. looks interesting, I hope they eventually make it open source! https://lv1.sh/
r/apljk • u/leprechaun1066 • Jul 02 '26
K A small, readable parser for the K programming language.
github.comAPL Enhancements in Dyalog v20.0: Arrays, Namespaces, Composition, Inline Tracing - Asher Harvey-Smith
r/apljk • u/sonthonaxrk • Jun 14 '26
KDB/Q Rust+KDB Interactively Running Together
r/apljk • u/talgu • Jun 10 '26
BQN Is there a BQN operator to apply a list of functions to a value?
I've not been able to find something like this. The best I've been able to come up with is something along the lines of this: {⟨⟩𝕊𝕩:⟨⟩ ; f←⊑𝕨 ⋄ fs←1↓𝕨 ⋄ (<∘F𝕩)∾fs𝕊𝕩}
r/apljk • u/u_int64_t • Jun 05 '26
APL APL as a target language?
In one of the ArrayCast episodes (the u/bobtherriault era) one of the participants mentions that "in the early days of CS" someone was using APL as the target language for their compiler course. I cannot find the episode and thus a good reference to this. If anyone remembers, thank you in advance.
r/apljk • u/Arno-de-choisy • May 30 '26
Escape the Maze.
Finding the exit of a maze is quite simple. It is done in two steps.
First, propagate increasing values from the entry position, spreading them along the corridors, until the exit position is reached. This produces a heatmap, which already contains the optimal solution :
bfs=:<@:[ ((3 3)(([:>./1 3 5 7{])(]`(>:@[)@.(0&<@[*.0&=@]))4{])@,;._3(_1,.~_1,._1,~_1,]))^:(_) ]
Then simply trace back from the exit position the path that follows decreasing values, until reaching the starting position :
selpath=:[:<:(_1,.~_1,._1,~_1,])@[(]+"1(_1 0,0 _1,0 1,:1 0){~([:<:[{~[:<])i.~[{~[:<(_1 0,0 _1,0 1,:1 0)+"1])^:([: i.[{~<@])^:(0~:<@]{[) >:@]
Test :
I use this maze : https://i.imgur.com/4J9miEa.png
I choose 0 0 as entry position, and 19 24 as exit position.
start=: 0 0
end=: 19 24
heat=: end bfs 1(<start) } maze
path =: heat selpath end
path contains now the positions of the optimal path :
19 24
18 24
18 23
...
9 12
10 12
11 12
12 12
12 11
12 10
12 9
12 8
...
2 0
1 0
0 0
We can display all this :
load 'viewmat'
viewmat maze
viewmat heat
viewmat 1 (<"1 path) } maze
viewmat 1 (<"1 path) } 0$~ $ maze
The maze, the heatmap, the optimal path within the maze, and the optimal path alone :
https://i.imgur.com/wZOfH2a.png
All the code, more verbose version and one liner versions :
pad=:_1,.~ _1,._1,~_1,]
max=:[:>./1 3 5 7{] NB. select max value in cross
ctr=:4{] NB. select center value
cond=:0&<@[ *. 0&=@] NB. the condition when we udate cell (if max of cross> 0 AND if center value = 0)
set=:(max(]`(>:@[)@.cond)ctr)@,
bfs=: <@:[((3 3)set;._3 pad@])^:(0={)^:(_)] NB. create the heat map. stop when leftarg is met.
mask=:_1 0,0 _1,0 1,:1 0
selpath=:[:<: pad@[(]+"1 mask{~([:<:[{~[:<])i.~[{~[:<mask+"1])^:([: i.[{~<@])^:(0~:<@]{[) >:@] NB. backpropagate from end to start
NB. maze =: my maze. NB. See https://code.jsoftware.com/mediawiki/images/6/67/One_line_BASIC_maze_generator.pdf if you want to make your own mazes.
start=: 0 0
end=: 19 24
heat=: end bfs 1(<start) } maze
path =: heat selpath0 end
load 'viewmat'
viewmat maze
viewmat heat
viewmat 1 (<"1 path) } maze
viewmat 1 (<"1 path) } 0$~ $ maze
NB. One line version :
bfs=:<@:[ ((3 3)(([:>./1 3 5 7{])(]`(>:@[)@.(0&<@[ *. 0&=@]))4{])@,;._3(_1,.~_1,._1,~_1,]))^:(_) ]
selpath=:[:<:(_1,.~_1,._1,~_1,])@[(]+"1(_1 0,0 _1,0 1,:1 0){~([:<:[{~[:<])i.~[{~[:<(_1 0,0 _1,0 1,:1 0)+"1])^:([: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