Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I’ve practiced array languages extensively myself, including for code golfing, and I fully understand the intellectual joy they can provide. But as I’ve gotten older, I’ve come to see a deep mismatch between what these languages present as “elegant” and what I find truly elegant from a computer science perspective.

Sure, realizing that the foobar of x is nothing more than the transpose of the 15th foo of x, combined via an inner product with the 7th bar of x raised to the power of baz, can be an ineffable intellectual delight. But actually computing that, rather than writing a “boring” loop, feels horrible to me. To my eyes, a “boring” piece of code written by Dijkstra in some Algol-like language contains more beauty than all these dazzling sleights of hand that hide zillions of loops under the rug while pretending that the actual computation doesn’t matter.





On the other hand, whenever I see Python code that does calculations over arrays of data with nested loops instead of using numpy, it always takes me a distressing amount of time to see what the code is actually doing and that the bug is because of a typo buried deep in that 100 lines of code that caused one of the inner products to be incorrect.

It's not like array languages don't do any optimizations... Denying the programmer the ability to be clever by manually writing loops makes some things easier and simpler for the compiler as well.

Array languages are more conceptually simple. What do you concretely mean to mock with:

> realizing that the foobar of x is nothing more than the transpose of the 15th foo of x, combined via an inner product with the 7th bar of x raised to the power of baz




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: