4 ms·
You are walking into a classic argument about concise notation for experts versus self-explanatory names for generalist programmers. See https://news.ycombinat
by btilly 9y ago
You are walking into a classic argument about concise notation for experts versus self-explanatory names for generalist programmers. See https://news.ycombinator.com/item?id=14239228 https://news.ycombinator.com/item?id=14239228 for a previous iteration of this argument on this site.
Suffice it to say that anyone with sufficient mathematical expertise to actually make sense of this stuff, who is going to do anything interesting will want to use concise names. And yes, this will be the first thing that a programmer who doesn't know it will complain about, but it is far from the largest problem that you have to face in using this stuff. And if you work through the actually important barriers to doing useful stuff with this knowledge, you'll probably appreciate concise notation.
- marmaduke 9y agoIt's still an interesting idea to try to expose an unknown domain in terms of a well thought out API which takes care of some of those dirty details. An ORM would be an example. Should linear algebra API be the raw numerical algorithms (Fortran like) or something dressed up which throw exceptions on failed convergence? (This is probably orthogonal to your comment btw )
- btilly 9y agoAny abstraction layer built on top of linear algebra intended for non-mathematicians should be given mnemonic names that are domain specific for what that abstraction layer is aimed at. Any abstraction layer built with the purpose of making it easy to do linear algebra in software should use names that are domain specific to linear algebra. Which will be the short concise names that make sense to those with mathematical expertise, no matter what generalist programmers think of said names.
- neutronicus 9y agoI think most programmers probably either need control of the nitty-gritty of the numerical algorithms or would be better-served by a library explicitly modeling their domain (with library authors minding the p's and q's of the numerical algorithm).
- neutronicus 9y agoConcise notation really lets you see the AST of your code. I'm more than willing to memorize some inscrutable names in exchange for this capability.
- jacobolus 9y agoThese are not names designed for people who understand linear algebra from an undergraduate mathematics course, they’re just names taken from BLAS, which were chosen based on the conventions of Fortran code. There’s no particularly good reason to shorten `norm` to `nrm` except to be cryptic. Knowing that `mv` means “function that takes two arguments and multiplies the matrix in the first argument by the vector in the second argument” and that `axpb` means “takes three arguments, and multiplies a scalar by a vector and then adds it to another vector” and that `scal` means “takes two arguments and multiplies the scalar first argument by every element of the vector or matrix in the second argument” requires familiarity with BLAS. In general the names are fairly un-systematic. Once you’ve learned them reading code is reasonably straight-forward (albeit much less clear than code written using more explicit syntax like you’d find in Matlab or similar), but writing code is going to require either frequent trips to the docs or some time spent on memorization.
- conistonwater 9y agoI want to point out that axpy is an abbreviation of a * x + y, pronounced "a x plus y", hence axpy. So I disagree with "un-systematic".
- jacobolus 9y ago“Systematic” would be e.g. `ab`, `ax`, `axpy`, `kx`, instead of `mm`, `mv`, `axpy`, `scal`. (Or whatever other preferred system, hopefully something carefully thought through rather than slapped together.) The names are obviously meaningful, they’re just fairly ad-hoc and not guessable a priori.
- dragandj 9y agoI may offer you an angle here: xpy uses x and y because x and y could be vectors, but can also be matrices mm can not be used for vectors, only for matrices. Of course, the main reason is that these are names used for the last 40+ years in the standard for this type of software, BLAS.
- 9y ago