4 ms·
APL designers also work to keep symbols to a minimum, and any given APL program introduces zero new symbols. They're not context-dependent (why did you think th
by mlochbaum 4y ago
APL designers also work to keep symbols to a minimum, and any given APL program introduces zero new symbols. They're not context-dependent (why did you think this?), and very few are domain-specific. Various languages differ a bit on this: J has more primitives, and several for number theory or other specific branches of math, while K has very few, and all are general.
From Alan Perlis in APL's early days: "The large number of primitive functions, at first mind-numbing in their capabilities, quickly turn out to be easily mastered, soon almost all are used naturally in every program — the primitive functions form a harmonious and useful set."
https://www.jsoftware.com/papers/perlis77.htm https://www.jsoftware.com/papers/perlis77.htm
- gjulianm 4y ago> They're not context-dependent (why did you think this?), They are, ρ5 is not the same as 2ρ5. A lot of symbols mean different things depending on whether they're being applied as monadic or dyadic operators. The circle operator is specially fun: A○B will apply a certain trigonometric operation depending to B depending on the value of A. That, to me, is very context-dependent. > and any given APL program introduces zero new symbols. Yes, but APL itself introduces a ton of new symbols. In fact, far more symbols than I've ever seen in my math degree. > From Alan Perlis in APL's early days: "The large number of primitive functions, at first mind-numbing in their capabilities, quickly turn out to be easily mastered, soon almost all are used naturally in every program — the primitive functions form a harmonious and useful set." This is a tautology to me, "once you master things you use them naturally". Of course. But the fact that APL and similar languages are very obscure would point to "once you master things" not being that easy and natural.
- mlochbaum 4y agoIs that so? Compare all Dyalog primitives to some math ones: - https://aplwiki.com/wiki/Dyalog_APL#Primitives https://aplwiki.com/wiki/Dyalog_APL#Primitives - https://en.wikipedia.org/wiki/List_of_mathematical_symbols_by_subject https://en.wikipedia.org/wiki/List_of_mathematical_symbols_b... APL shows 74 symbols. I count at least 50 math symbols that seem very likely to show up in an undergraduate degree; notably, 26 symbols +-×÷|⌊⌈!~∧∨⍲⍱<≤=≥>≠∊∩∪≡≢∘ in APL are taken from math with similar meanings. The arguments to a primitive are not context! You may as well call addition context-dependent because 1+n increments n while 2+n increments it twice. You're describing overloading, and I do really dislike the way ○ handles things (in BQN trig just goes in the •math namespace). However, I don't think it's right to put the blame on symbols, as a trig(code, argument) function could be defined to do the same thing. That is, maybe symbols encourage this design choice, but in themselves they aren't the problem. Note "quickly" and "easily" in Perlis's quote. A language with 500 symbols would seem to me to match your description before, and I would find it hard to believe it would be quickly or easily mastered. A language with 74 symbols, many of which are related, is what makes it possible to teach APL quickly: Perlis's month would be a few a day. APL was near-mainstream in the 1980s, and I think there are better explanations for its decline since.
- gjulianm 4y ago> APL shows 74 symbols. I count at least 50 math symbols that seem very likely to show up in an undergraduate degree; notably, 26 symbols +-×÷|⌊⌈!~∧∨⍲⍱<≤=≥>≠∊∩∪≡≢∘ in APL are taken from math with similar meanings. I have counted at least 30 symbols that I haven’t seen in an undergraduate degree + master degree, not counting symbols that I know but haven’t seen used directly as symbols (eg , or ?) but as punctuation. Of course I might have forgotten some of them but I think it’s undeniable that APL introduces a lot of new symbols. > The arguments to a primitive are not context! You may as well call addition context-dependent because 1+n increments n while 2+n increments it twice. You're describing overloading Not the arguments themselves but the amount of arguments. Operator overloading is also context dependency. Maybe we’re getting lost in the words: what I mean is that you can’t say for sure what a certain symbol means unless you have the symbols around it. For example, in C / always means “divide what’s on the left by what’s on the left”, but * is context dependent because it can either be multiplication or pointer dereference. > That is, maybe symbols encourage this design choice, but in themselves they aren't the problem. If some part of a language encourages things that we consider bad decisions, then that part is a problem. Again returning to C, one could say that the memory allocation system isn’t a problem despite the fact that it makes it really easy to cause leaks and bad memory accesses. > A language with 74 symbols, many of which are related, is what makes it possible to teach APL quickly Quickly… compared to what? Because I honestly don’t think an average person is going to learn APL faster than any mainstream language. > APL was near-mainstream in the 1980s, and I think there are better explanations for its decline since. It’s not just that APL has declined but in general the array programming paradigm that it pioneered hasn’t really taken off. For example, LISP declined quite a lot but new similar, functional languages have appeared and attracted interest.
- avmich 4y agoJ uses ASCII. Built-in symbols use dot (.) and colon (:) as part of a symbol. In J vocabulary, https://www.jsoftware.com/help/dictionary/vocabul.htm https://www.jsoftware.com/help/dictionary/vocabul.htm , I counted less than 150 built-in symbols. Even if you double it as monadic/dyadic variations, that's less than 300. I definitely don't know many of them, and still able to write some programs, like a parser generator; I think those symbols are closer to a standard library - i.e. with C we need to get familiar with printf, getc or strcpy. As with mathematics in elementary school, you start with few simpler ones, then gradually add some more useful ones, then the rest is optional for cases when you want or need them. In practice a lot of J symbols are either already known or rather obvious.
- eggy 4y ago>They are, ρ5 is not the same as 2ρ5. And +5 is not the same as 2+5. One is a sign and the other addition...
- gjulianm 4y agoYes, so therefore + is context dependent. Some context dependency is unavoidable, but having everything be context dependent is bad design IMHO.
- avmich 4y agoYou're really making up and bending rules here. Did you learn an array language to see things both ways?
- gjulianm 4y agoWhat rules? I am only saying that symbols add cognitive load, even more if they're context dependent. I don't think that's controversial at all, and APL and other array languages do have context-dependent symbols. And yes, I tried learning an array language but I didn't get far for two reasons: one, I didn't really see where could I apply it; two, it's really hard to discover things and learn incrementally when you can't really use autocomplete or even Google (punctuation and symbols are not well supported in search engines) to help with the large set of symbols/operations with multiple meanings each.
- eggy 4y agoMy point was that mathematical symbols are also context dependent and yet they work and are useful, so I don't get your argument of context dependency against APL's symbols.