Rather than "numpy but sane" I think a better approach is "APL but familiar". Q is an example of an APL-like language deliberately aimed at mainstream programmers. It keeps the fundamentals but syntactically uses words instead of single-character symbols.
One fundamental design choice where I feel numpy went wrong is broadcasting rules instead of the "leading axis model". Numpy applies operations to the innermost dimensions first by default (with replication and extending according to arcane broadcasting rules) whereas APL (and others like J and BQN) apply operations to the outermost axes first, but allow you to override this with a user-defined "function rank". So if you write a function for one shape of data it's trivial to reuse the same function for differently-shaped data.
I've spent a little time getting familiar with APL-type languages. I'm OK with the crazy symbols, but I still find it requires a lot of thinking. Maybe after I propose my "better numpy", you can tell me if you think APL/J/K/Q would do it equally well...
Rather than "numpy but sane" I think a better approach is "APL but familiar". Q is an example of an APL-like language deliberately aimed at mainstream programmers. It keeps the fundamentals but syntactically uses words instead of single-character symbols.
One fundamental design choice where I feel numpy went wrong is broadcasting rules instead of the "leading axis model". Numpy applies operations to the innermost dimensions first by default (with replication and extending according to arcane broadcasting rules) whereas APL (and others like J and BQN) apply operations to the outermost axes first, but allow you to override this with a user-defined "function rank". So if you write a function for one shape of data it's trivial to reuse the same function for differently-shaped data.
I've spent a little time getting familiar with APL-type languages. I'm OK with the crazy symbols, but I still find it requires a lot of thinking. Maybe after I propose my "better numpy", you can tell me if you think APL/J/K/Q would do it equally well...