r/apljk Jun 10 '26

BQN Is there a BQN operator to apply a list of functions to a value?

Upvotes

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 Feb 27 '26

Sudoku Solving in BQN

Thumbnail tony-zorman.com
Upvotes

r/apljk Sep 15 '25

Are APL/BQN Symbols Better than J/K ASCII?

Upvotes

r/apljk Dec 19 '25

BQN question

Upvotes

Is there a reason why function like F⊸/ and F⊸⊏ where F is a non-constant function are not considered to be structural functions, or is it just an oversight? Seems like a useful pattern to support, like G⌾(2⊸|⊸/) to apply G to all odd numbers in a list.

r/apljk Dec 18 '25

Project Euler 0-to-4 BQN Solutions

Thumbnail
gist.github.com
Upvotes

r/apljk Nov 09 '25

BQN in-place modification

Upvotes

One thing I like about J is that it optimizes things like `a =. value index}a` to use in-place modification. I've been experimenting with BQN, and it doesn't seem to be doing that (I was using "under" modifier to test it). Is there some approach I'm missing for handling large arrays which are frequently modified, or do I have to implement something like a wide shallow tree?

r/apljk Oct 15 '25

Writing a JSON Parser in BQN

Thumbnail tony-zorman.com
Upvotes

r/apljk Sep 19 '25

Musical Scales in BQN

Thumbnail mlochbaum.github.io
Upvotes

r/apljk Jun 07 '25

Some BQN fun

Thumbnail
gallery
Upvotes

I guess I was bored and I diceded to give BQN a try, this is the first program that I wrote (or I guess, expression?). I feel like there's still a cool way to use some trains or some other combinations to streamline this, but I'm satisfied enough. I wanted to share this with someone that would appreciate it.

Now, what is it? Just a sine calculator using the Taylor series expansion. The left argument is the number of terms used. There's a bug where an odd number of terms gives the correct answer for the given input and an even number gives the negative sine. I can think of easy solutions but not compact ones. Still, I think this was a cool little exercise.

PD: The O function just generates x odd numbers, i.e. O 5→⟨1,3,5,7,9⟩

r/apljk Oct 11 '24

Calculating day of the week, given date in K and BQN

Upvotes

The task is to calculate the day of the week, given the date by year, month and the day (e.g. 2024 10 11).

Solution in K:

m: 0 31 28 31 30 31 30 31 31 30 31 30 31 ry: 1970 rn: 4 / Thursday leap: {((0=4!x) & (~0=100!x)) | (0=400!x)} leaps: {+/leap (ry+!(1+x-ry))} days: `Monday `Tuesday `Wednesday `Thursday `Friday `Saturday `Sunday day: {Y:1#x; M:1#1_x; D:-1#x; N:(D-1)+(+/M#m)+(365*Y-ry)+(+/leaps Y); `0:$days@7!(7+N)-rn}

Solution in BQN:

md ← 0‿31‿28‿31‿30‿31‿30‿31‿31‿30‿31‿30‿31 ry ← 1970 rn ← 4 # Thursday Leap ← {((0=4|𝕩) ∧ 0≠100|𝕩) ∨ 0=400|𝕩} Leaps ← {+´Leap ry+↕1+𝕩-ry} days ← "Monday"‿"Tuesday"‿"Wednesday"‿"Thursday"‿"Friday"‿"Saturday"‿"Sunday" Day ⇐ {y‿m‿d←𝕩 ⋄ n←(d-1)+(+´m↑md)+(365×y-ry)+(Leaps y) ⋄ (7|rn-˜7+n)⊏days}

Any feedback is welcome, but keep in mind I'm not very experienced in either of these languages.

One question I would have is about the K version. For some reason I need +/ in +/leaps Y in day definition, but I don't understand why. It shouldn't be needed, because leaps already has it.

Note that I know about Zeller's congruence, but I wanted to implement something I can understand.

r/apljk Jun 26 '25

Blazing matrix products in BQN

Thumbnail panadestein.github.io
Upvotes

I explored some ideas here to make matrix products faster in BQN.

r/apljk May 31 '25

Five-year review of BQN design

Thumbnail mlochbaum.github.io
Upvotes

r/apljk May 26 '25

Sieving primes at the speed of C in BQN

Thumbnail panadestein.github.io
Upvotes

A blog post about having fun optimizing BQN code.

r/apljk Nov 02 '24

Tacit Talk: Implementer Panel #1 (APL, BQN, Kap, Uiua)

Thumbnail
tacittalk.com
Upvotes

r/apljk Aug 25 '22

Does anyone else find the BQN symbols kind of ... ugly?

Upvotes

Don't get me wrong, this has nothing to do with the language itself, but merely the typography. I mean there are tall and wide blackboard characters contrasting with tiny dots and dashes, the superscript style modifiers are getting lost in their own voids, while the "encircled" combinators look cramped and busy. Some primitives are curved and flowing, some are sharp and angular.

Overall it just creates this mishmash of shapes and styles and aesthetics. It kind of puts me off learning the language.

r/apljk Apr 07 '24

Help with BQN function

Upvotes

Hi, I'm trying to write a function in BQN and I'm almost there, but there is something I'm missing.

I have two arrays declared:

crit ← [
  100‿200‿100‿200‿250,
  7‿8‿4‿6‿9,
  1800‿1600‿1200‿2500‿3000
]
pref ← [⟨⟩‿⟨2⟩‿⟨1000, 500⟩]

From that I create this array and declare three functions:

step1 ← -⌜˘˜ crit

Linear ← >⟜0
P ← 0⌈1⌊÷⟜2
PQ ← 0⌈1⌊(1000-500)÷˜(-⟜500)

For every sub-matrix in step1 (or actually, every sub-array in crit), there is a correspondent item in pref.

If a pref sub-list length is 0, I want to apply the Linear function to the correspondent step1 item, if the length is 1 I want to apply the P function, and if it is of 2 I want to use the PQ function.

To exemplify: the first sub-list in pref is of length 0 (⟨⟩), so I want to apply to Linear function to the first matrix inside of step1; the second sub-list (⟨2⟩) is of length 1, so I want to apply the P function to the second matrix inside step1. And so on.

I wrote this function:

(≠ pref)◶⟨Linear, P, PQ⟩¨ step1

The problem is that it is always using the P function, since ≠ pref returns 1, and I can't write ≠¨ pref as the right side of .

Does anyone know if is there something that I can change to make this work or if there is a better approach for this problem?

r/apljk Dec 09 '23

A Game Framework in BQN on this episode of the ArrayCast

Upvotes

Brian Ellingsgaard tells us about developing a games framework on BQN and we all discuss the challenges of Advent of Code.

Host: Conor Hoekstra

Panel: Marshall Lochbaum, Adám Brudzewsky and Bob Therriault.

https://www.arraycast.com/episodes/episode68-brian-ellingsgaard

r/apljk Dec 23 '23

On the ArrayCast David Zwitser and the art of making games with BQN.

Upvotes

David Zwitser is an artist who is using the BQN array language to create games. We explore his views on Art, Games and exploring computing as a non-computer scientist.

Host: Conor Hoekstra

Panel: Marshall Lochbaum, Adám Brudzewsky, Stephen Taylor and Bob Therriault.

https://www.arraycast.com/episodes/episode69-david-zwitser

r/apljk Sep 21 '22

BQN practice

Upvotes

I know about websites like leetcode.com, exercism.org, or project Euler, to get some programming exercises for various languages. However, I would like a dedicated track to an array programing language. What I DON'T mean is that somebody has to put the work to get one of the languaes there. What I search for is just a list of exercises on some of the platforms and the list of exercises is sorted by difficulty (or concepts to learn). I am asking, because some beginner exercises are hard in an array programing lanugage and vice versa.

Does something like this exist?

If something like this doesn't exist, is there some resource to obtain a solution for some of the problems? (I really like the exercism way: Find a soultion. THEN we will show you how other people implemented it.)

r/apljk Nov 21 '23

Exploring Z-order in BQN

Thumbnail razetime.github.io
Upvotes

r/apljk Mar 20 '22

BQNPAD — a BQN REPL with syntax highlighting and live evaluation preview

Thumbnail bqnpad.mechanize.systems
Upvotes

r/apljk Dec 19 '22

Having trouble installing bqn into arch

Upvotes

Hello, I'm new to arch linux and tried to install bqn without much success, I've trying decompressing the binaries with tar and installing them with both makepkg, make and trying to run randomly the files that were in there, can you help me?

Also I've installed dyalog and to my surprise it doesn't have an interface like in windows, it seems to be a terminal app, I'm new to this style of programming and it'd be very helpful to have the symbols in an ide.

Thank you in advance.

r/apljk Feb 26 '23

From Julia to BQN

Thumbnail miguelraz.github.io
Upvotes

r/apljk Dec 21 '22

Having trouble translating APL indexing and array modification to BQN.

Upvotes

I'm currently working through Mastering Dyalog APL (translating to BQN) to try and become comfy with the array paradigm. Some of my translations aren't entirely semantically correct. I'm also having some trouble with nested arrays vs rectangular arrays (and if that sentence isn't correct it stands to illustrate my current level of understanding). However I'm really struggling with replicating the indexing and index replacement examples. I can get simple cases to work, but the more complex examples I'm struggling with.

These examples work: v[1 3 6] is 1‿3‿6 ⊏ v, v[2] ← 0 is v 0⌾(2⊸⊑). However the following I can't get to work.

  • Array update with multiple indices v[1 3 6] ←0. I feel like some use of and is appropriate here, but it seems like doesn't have an inverse.

  • More intricate indexing: v[0 4 5; 0 2], v[0 2 4 5;0], and v[(1 2)(4 0)(0 1)]. Also things like v[6;] ← 6 7 8 or v[4;;2].

Most of these examples come from section 6 of the introduction, or chapter B 5.3 to B 5.4 of Mastering Dyalog APL if anyone needs more context for these examples.

r/apljk Aug 16 '20

BQN: finally, an APL for your flying saucer

Thumbnail mlochbaum.github.io
Upvotes