Live data from Hacker News

Notation as a Tool of Thought

jsoftware.com

41–44 of 44 posts

Re: Notation as a Tool of Thought

#41
post #35

Earlier quoted context omitted.

> Admittedly the J implementation at least of deriving a generalized inverse for an arbitrary function f is a somewhat ill-defined hack Have you seen the version used by dzaima/apl[1]? The equivalent of '(-&.:{:) i.5' works and results in 0 1 2 3 _4. > APL has some really dumb but cherished-by-the-community ideas that make the language less expressive and much more awkward to learn, e.g. the idea of replicating the t…

Is there an argument for ambivalent function definitions other than "keyword" recycling (possibly in a mnemonic fashion)? I hadn't seen Dzaima's APL, thanks! I like that he made a processing binding; APL always seemed like it would be such an obvious choice for doing dweet style graphics code golfing that I wondered why no one seemed to be doing it. A web-based APL would be a better choice though.

Keyboard space is another somewhat important factor. My layout for dzaima/APL already uses all altgr keys, so I could definitely not afford multiplying the number of needed characters by 2. Not having ambivalently callable operators would also mean needing 2 versions of most of them.

dzaima/APL being written in Java means getting it to run in a browser would be a bit hard, and ngn has given up on ngn/apl, but BQN[0] could definitely get a web canvas based graphics interface.

Somewhat interesting to add to the conversation about Under is that, in my impl, calling a function, calling its inverse, or doing something under it (i.e. structural under) are all equally valid ways to "use" a function, it's just a "coincidence" that there's direct syntax for invoking only one. (Dyalog does not yet have under, but it definitely is planned.)

0. https://mlochbaum.github.io/BQN/

Re: Notation as a Tool of Thought

#42
post #39
post #38

Earlier quoted context omitted.

APL was amazing for the time, but array-oriented programming is mainstream now, while the notation never really caught on. A lot of the mystique of APL is because it's illegible, but at the end of the day it's nothing more than a DSL for 'numpy-like' code. You can code the same demo, in the same amount of time, using Julia, and the result is (in my opinion) much more legible: The opaque one-liner: using IterTools,Ima…

I would argue that numpy is a dsl for apl-like code. APL and J are based on arrays at the fundamental level. J inspired Pandas per Pandas' creator. I still think learning mathematical symbols is better than spelling out mathematical formulas and likewise APL and J to me allow the same power of abstraction; it just takes some effort to learn them. A lot of friction is learning something new.

I only mentioned Numpy as an example of a ubiquitous array paradigm, that most HNers are likely to know. It's a bolt-on to Python, yes, and it's ugly, and it's clearly inspired by APL which came first. All this is true.

But the power of abstraction of APL is available to any other language, with the right functions. Most scientific languages come with those functions out of the box, as demonstrated by my 11 translation of 'Life in APL' into Julia above. And APL doesn't give you a bunch of other really useful general-purpose stuff; that's why I term it a 'DSL'. It's a one-trick pony. It's a great trick, but it's ultimately not quite enough. That's why NumPy hasn't replaced pure Python - you still need to get your hands dirty outside the array paradigm from time to time, and APL is very primitive at that. In fact there's nothing to stop anyone from aliasing array-functions to their APL equivalents in any Unicode-aware language, like Julia (oddly, nobody does). What you're left with is a rather basic parser, some odd syntax quirks like arrow assignment, and some ugly imperative flow control.

Are the fancy symbols really worth it?

Re: Notation as a Tool of Thought

#43

I feel like this ties back to making general abstractions that anyone can make for any field. Software engineering is littered with abstractions to the point where 2 similar functioning applications can look wildly different when looking at their respective code bases. Even the abstractions we build into programming languages invites a certain way of thinking which is why there’s so many different paradigms like func…

Turing machines all the way down... for every Turing machine there are an infinite number of alternative descriptions that provide the same result.

Re: Notation as a Tool of Thought

#44
post #15
post #4

Earlier quoted context omitted.

There's a certain mathematical elegance to APL, I think. When the language is terse enough it helps you visualize and work with the language as a tool of thought--Matlab attempts to map actual mathematics to ASCII which is not that successful for me at least, since it meets a middle ground where it's too difficult for me to think quickly purely in Matlab and it's too high level for it to be useful as a practical lang…

“Engineers love it for prototyping, though” Makes perfect sense. Matlab is for engineers, not for mathematicians. They use computer algebra systems, proof assistants, etc. Difference is that engineers (and physicists) want answers and don’t care about how they are obtained, while its the reverse for mathematicians. I think APL, although it, too, is a language for computing numbers, spiritually is a bit closer to math…

I'm a bit of both, so I guess I take the radical approach--straight from mathematics to C++/ASM/FPGA/ASIC. Ultimately programming languages are just an alternate notative system for mathematics--formal language theory actually formalizes and generalizes this, it's what us Computer Scientist's specialize in generally.

Since the computer is just a glorified calculator with memory (sorry Apple), we can fit the whole thing into a formal mathematical framework.

Post reply on HN