4 ms·
And another: types. They seem to be under emphasised in APL. In my bilinear example the original code had lots of "(pixel >> 8) & 0xff" kinds of things to acces
by abainbridge 5y ago
And another: types. They seem to be under emphasised in APL. In my bilinear example the original code had lots of "(pixel >> 8) & 0xff" kinds of things to access the colour components. I created a type to allow those to become "pixel.g". That immediately made the code feel easier to understand. (Pleasingly it made the code run faster too).
- rscho 5y agoProminent APLers think it doesn't need one. I agree, because APL tries to be close to math, and you don't write types when doing math. You use alternate and overloaded operators. A video on the topic https://youtu.be/z8MVKianh54 https://youtu.be/z8MVKianh54
- stenl 5y agoThe single-letter variable names and the lack of types (beyond some duck-typing using bold and uppercase) is what makes math so difficult to read (for me). There must be tons of errors in math papers that go undetected just because there’s no type checking.
- rscho 5y agoOk, but let's not forget that math is written by and for mathematicians and not software developers...
- Jtsummers 5y agoAlso, any halfway decent math writers (including those writing for domains that use math, but are not strictly done by mathematicians) also define their terms or provide a context. If you're doing physics, the following is perfectly comprehensible (and is useless if you haven't studied at least a bit of physics): x(t) = x_0 + v_0 * t + 1/2 * a * t^2 In a physics book, all of those terms would have been defined prior to that statement, but you wouldn't exclude that equation because it's so useful later on (to actually do calculations with, or to solve for the other elements). If you take any arbitrary APL program or mathematical statement out of context, it's going to be mostly meaningless. I mean, I can tell you what that does above if I've taken algebra but haven't taken the first couple weeks of Physics 101, but I don't know what it means so it's not useful. That's not the fault of the equation and it shouldn't be discarded just because it needs context to fully understand (either context fully stated with it, or an expectation that you've already studied the topic and so a minimal context can be provided and you can fill in the gaps).
- hoosieree 5y agoNon-executable, untyped, unverifiable notation is a feature, not a bug, because it makes it harder for a peer reviewer to reject your paper. Imagine if peer reviewer's pdf viewer put red squiggly lines under invalid formulas and equations...
- threatofrain 5y agoIn math, not only are you dealing with an expectation of a multi year commitment among participants in an academic conversation, but people also either define the terms they use or rely on established culture.
- marcosdumay 5y agoTry writting a Math paper with thousands of expressions and you will see how ergonomic it is for the kind of work we do while programing.