Hacker News new | ask | show | jobs
by jampekka 434 days ago
Lots to like here but I'm not so sure about this:

> In DumPy, every time you index an array or assign to a dp.Slot, it checks that all indices have been included.

Not having to specify all indices makes for more generic implementations. Sure, the broadcasting rules could be simpler and more consistent, but in the meantime (implicit) broadcasting is what makes NumPy so powerful and flexible.

Also I think straight up vmap would be cleaner IF Python did not intentionally make lambdas/FP so restricted and cumbersome apparently due to some emotional reasons.

2 comments

For solo works, the terseness might work, but usually only in short term. Code I wrote 6 months ago looks like someone else's code. For team work, I'd prefer to be explicit if possible. It saves both my teammates' time and my time (when I eventually forget my own code 6 months from now).
It's not (only) about terseness. It's about generality.
Implicir means write once easy, debug, extend, read hard.
It also means that you don't have to reimplement the same things all over again when your dimensions change.
assuming you understand how the inconsist broadcast works, which is part of the problem.