My Ideal Array Language

73 bobajeff 24 8/4/2025, 1:05:08 PM ashermancinelli.com ↗

Comments (24)

hinkley · 4m ago
You explain the evolution of CPUs but then don’t explain Rank Polymorphism.
adregan · 2h ago
The author of this post was the guest on the most recent episode of the podcast The Array Cast

https://www.arraycast.com/episodes/episode111-ideal-array-la...

goldenCeasar · 13m ago
Funny, on another totally unrelated domain (business logic/rules engines) I was building something very very related - array broadcasting with semantic preservation through arbitrary nesting levels
abcd_f · 3h ago
> User-Extensible Rank Polymorphism

> IMO this is what makes something an array language.

Great to hear. So what is it?

hinkley · 3m ago
You’re gonna mansplain the past 40 years of CPU evolution and then leave out the math that nobody has heard of? Party foul.
preommr · 3h ago
Not op, but I assume it means that there's rank polymorphism (i.e. data can be of arbitrary dimensions, and there's support for things like functions working on both N-dimensions, without having to specify n, or maybe setting constraints on n), and that the polymorphism can be used on the programmer side (so it's not limited to just a handful of language builtins) through the oop equivalent of subclasses and interfaces.
djoldman · 1h ago
The programmer can define functions that operate on matrices without having to be explicit about the number of dimensions and possibly (types of data, size of data, or length).

Example 1: A function that can take as input a 4x2x8 matrix or a 3x7 matrix.

Example 2: A function that can take as input a 4x2x8 matrix and a 3x7 matrix and output a third matrix.

almostgotcaught · 1h ago
> A function that can take as input a 4x2x8 matrix and a 3x7 matrix and output a third matrix.

which shows that this feature request is complete jibberish

CapsAdmin · 1h ago
game math libraries often have this (and glsl gpu shader language), like "2 * vec3(1,2,3)" results in "vec3(2,4,6)"

There are other cases like adding vectors to matrices and so on, but in the end this logic is defined in some custom add operator overload on a class or object in the language.

(I had no idea what it meant either until i searched for examples..)

nromiun · 2h ago

  ⊢×0≠∧˝˘∧⌜∧˝           # Marshall & Dzaima (tacit!)
  (≠⥊∧´)˘{×(⌾⍉∧)0≠} # Dzaima & Rampoina
  {×(∧˝˘∧≢⥊∧˝)0≠}     # Dzaima
Call me old fashioned and stuck in C style syntax but I can't imagine anyone describing this as beautiful art.
mlochbaum · 1h ago
Well, do you know how it works? Don't judge a book by its cover and all. Although none of these are entirely aiming for elegance. The first is code golf and the other two have some performance hacks that I doubt are even good any more, but replacing ∧≢⥊ with ∧⌜ in the last gets you something decent (personally I'm more in the "utilitarian code is never art" camp, but I'd have no reason to direct that at any specific language).

The double-struck characters have disappeared from the second and third lines creating a fun puzzle. Original post https://www.ashermancinelli.com/csblog/2022-5-2-BQN-reflecti... has the answers.

badlibrarian · 2h ago
When the junior programmers start saying "Turing complete" or the academics build a DSL in Julia that uses RegEx to parse Logic Symbols and stuffs the result in variables that use ancient characters that don't appear on your keyboard, it's a sure sign of imminent progress. Bonus if the PhD with nine years of schooling and five months of PHP experience at Facebook starts using emoji in commit messages.
skydhash · 43m ago
Array Programming is an acquired taste, but once you do, solutions can be extremely simple, both to write and to explain.

Think about using matrix to describe geometric transformations instead of using standard functions.

ashleyn · 2h ago
icen · 1h ago
It is BQN, a descendant language
pavlov · 1h ago
Why is it BQN instead of BQM? Clearly the idea was to increment every letter from APL, but then they had to go one further on the third letter.
mlochbaum · 1h ago
It's just. So gross. Say it. Sudden interruption of slime coming up your throat. Like walking out the door into a spiderweb. Alphabetically I was mistaken but in every way that matters I was right.
pavlov · 53m ago
Hmm. I guess it if was BQM, it would be pronounced “bequem” which means comfortable in German.

And a comfortable APL is clearly an oxymoron.

mlochbaum · 48m ago
Ordinarily I'd make fun of the Germans for giving such an ugly name to a nice concept, but I've always found "comfortable" to be rather unpleasant too (the root "comfort" is fine).
hyperbrainer · 2h ago
I see it as beautiful the same way Galadriel would be beautiful as the Dark Queen. Utterly captivating and powerful, and yet something that should never be.
KineticLensman · 1h ago
"All shall love me and despair"
rramadass · 1h ago
A previous relevant discussion since there is so little on Array Languages - https://news.ycombinator.com/item?id=38981639
teleforce · 2h ago
Dlang does not has rank polymorphism and it handle array just fine with crazy speed in both compilation and execution.

It can be faster than Fortran based library that is still being used by Matlab, Rust and Julia [1].

It will be interesting to compare Mojo moblas BLAS library with GLAS library performance in D.

[1] Numeric age for D: Mir GLAS is faster than OpenBLAS and Eigen (2016):

http://blog.mir.dlang.io/glas/benchmark/openblas/2016/09/23/...

cdavid · 2h ago
If I understand correctly what is meant by rank polymorphism, it is not just about speed, but about ergonomics.

Taking examples I am familiar w/, it is key that you can add a scalar 1 to a rank 2 array in numpy/matllab without having to explicitly create a rank 2 array of 1s, and numpy somehow generalizes that (broadcasting). I understand other array programming languages have more advanced/generic versions of broadcasting, but I am not super familiar w/ them