Comment

Comment by jph00

"Rank" means the number of dimensions of an array.

So "rank polymorphism" means being able to write expressions that work correctly regardless of how many dims the arrays involved have.

For example, in numpy you can write a function that handles both lists and matrices automatically, by taking advantage of broadcasting. (The J language takes this idea a lot further -- numpy is a fairly minimal implementation of the idea.)

parent jph00 1 year ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton