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

If APL actually followed mathematical notation it would be extremely verbose. Most math books, articles and explanations use quite a lot of words, far more than symbols, precisely to allow them to be “read by humans”. Those are mostly used for computations and symbolic manipulations.


Nobody holds you from adding as much comments to APL code as you wish. I once wanted to write a parser generator in J, a very incomplete version is here - https://code.jsoftware.com/wiki/User:Alex_Mikhailov/Parsing . This is practically text, as you'd expect from a math article, with embedded code which allows computer execution to have those ideas working.


But there is a difference between “verbose code” and “adding comments”, isn’t it? There’s always the issue with comment-code disagreement. But mainly the point is about the language itself and the prioritization of terseness over unambiguity and intuition. Good mathematical notation strives for the latter, not the former.


> There’s always the issue with comment-code disagreement.

You just mentioned mathematical articles where the math expressions are a minority of the text, right?

> But mainly the point is about the language itself and the prioritization of terseness over unambiguity and intuition.

Math notation had - and keeps having - reason to be terser than plain text. Same for APL - which started life as "Iverson notation".

> Good mathematical notation strives for the latter, not the former.

Don't you think APL is a pretty good mathematical notation? If not, why?


No, I don’t think APL is a good mathematical notation. For starters, symbols having different meanings depending on whether they are dyadic or monadic is fairly confusing. That’s made worse by the lack of clear delimitations of arguments of functions. The use of prefix notation is also a bad choice because it doesn’t match the way we talk about a lot of operators. Symbols are overused even more than in mathematics (for example, why use a symbol instead of “log”?). There’s also a lot of symbols that are very similar, differing in small ways even though their meaning is fairly different.

Yes, mathematical notation is terse (mostly to make manipulations and computations easier to type) but people take special care to avoid ambiguity or too much context dependency, and also don’t try to introduce symbols for everything.




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

Search: