Live data from Hacker News

Why APL Is Still Cool

infoq.com

21–30 of 37 posts

Re: Why APL Is Still Cool

#21
post #7

I learned APL in college and used it professionally for about eight years. I really enjoyed the language. Once you know it well enough it creates a very interesting flow condition. You are able to focus on the problem rather than the mechanics of solving it. It's hard to describe but you definitely feel the difference when going from APL to something like C, Forth or Lisp. One of the huge problems with APL back then…

Morgan Stanley used a variant of APL called A+. It was used quite extensively in parts of the firm. They open-sourced it a while back. http://www.aplusdev.org/

I don't remember details, but my colleagues at Merrill Lynch used to say you could look at somebody's APL code and tell if they came from Sharp (Toronto), IBM (Yorktown Heights or San Jose CA), STSC or Morgan Stanley.

In APL2, the equivalent to a lisp map was "each", it was a colon rotated to be horizontal and superscript. We used to have "each" contests, I always got destroyed.

And one of my (distant) friends got a summer job in high school, working for Iverson in Yorktown Heights, writing APL.

Re: Why APL Is Still Cool

#22
post #14

I learned APL in college and used it professionally for about eight years. I really enjoyed the language. Once you know it well enough it creates a very interesting flow condition. You are able to focus on the problem rather than the mechanics of solving it. It's hard to describe but you definitely feel the difference when going from APL to something like C, Forth or Lisp. One of the huge problems with APL back then…

What about J? J was developed Ken Iverson (the creator of APL) as a successor to APL that replaced unicode characters with two character equivalents. It's not greatly publicized, but the latest J was released under the GPLv3 ( http://www.jsoftware.com/source.htm ).

With all due respect to Mr. Iverson, whom I had the pleasure of meeting at an international APL conference many moons ago, I think J went in the wrong direction.

Part of the power of APL is in the symbolic representation of concepts. The symbols are important. They form a language in more than one sense. Replacing them with ASCII/unicode equivalents rips the guts out of the language.

Here's a thought experiment: Take mathematic expressions and replace every symbol with two or three character ASCII (or whatever) equivalents. The integral symbol might become "integ"; the root symbol become "root"; first, second and third derivative periods become "der1", "der2" and "der3"; and so on. What have you accomplished? Well, at the very least you've ruined the superbly expressive nature of mathematics through agreed upon special symbols.

One could do the same with music and the results would be exactly the same.

In general terms, I believe that we don't need to go in that direction. We need to search for and find the programming equivalent of music and math notation.

If you've ever looked at some VHDL code you have seen an example of just how ugly this can get. Whenever I do FPGA work I use Verilog, which feels very much like C.

Defining a register in Verilog looks something like this:

  reg [0:7] my_register;
In VHDL:

  my_register: std_logic_vector(7 downto 0);
It's been a while since I touched VHDL so this example could be off. I don't remember if you have to add IN, OUT or INOUT to the declaration.

The point though is that one (Verilog) is compact and to the point whereas the other (VHDL) beats the crap out of you with unnecessary verbosity. My definition of "unnecessary" is that, if the exact same result can be had without the extra stuff then there is absolutely no reason for it to exist. The entire VHDL language is like that, this is just one example. If I remember correctly, there was one thing that was nice about VHDL way-back-when which had to do with parametric generation of code. Later Verilog implementations added these capabilities without making you feel that you were typing a novel.

The long post is to say that notation is important. It is a tool for thought as much as it provides expressive power. J, in my humble opinion, went the wrong way.

Re: Why APL Is Still Cool

#23
post #15

Earlier quoted context omitted.

kona I use it as my shell.

By which they mean Kona ( https://github.com/kevinlawler/kona ), an open-source implementation of a K-like language. Any commands in its repl that are prefixed with "\ " are sent as-is to system(3).

[deleted]

Re: Why APL Is Still Cool

#24
post #14

Earlier quoted context omitted.

What about J? J was developed Ken Iverson (the creator of APL) as a successor to APL that replaced unicode characters with two character equivalents. It's not greatly publicized, but the latest J was released under the GPLv3 ( http://www.jsoftware.com/source.htm ).

With all due respect to Mr. Iverson, whom I had the pleasure of meeting at an international APL conference many moons ago, I think J went in the wrong direction. Part of the power of APL is in the symbolic representation of concepts. The symbols are important. They form a language in more than one sense. Replacing them with ASCII/unicode equivalents rips the guts out of the language. Here's a thought experiment: Take…

To me your comment makes a lot of sense. But you have a visceral feel (that comes from practice) for how useful such notation can be. For people who don't, the cultural stretch is probably just too far to consider.

No doubt even a visionary like Iverson found it difficult to withstand decades of almost-universal criticism about the APL symbol set.

The APL guy in the video remarks wryly at one point that Unicode has made their lives much easier. I'll bet it has!

The analogy to music notation is suggestive. Imagine if people insisted on writing music textually with names like "High C Sharp" or whatever - on the grounds that this was more "readable"!

Re: Why APL Is Still Cool

#25
post #23

Earlier quoted context omitted.

By which they mean Kona ( https://github.com/kevinlawler/kona ), an open-source implementation of a K-like language. Any commands in its repl that are prefixed with "\ " are sent as-is to system(3).

[deleted]

"\ command" (e.g. "\ ls") works, you don't need to type exec. It passes the rest of the string to system: https://github.com/silentbicycle/kona/blob/master/c.c#L423

I'm one of the kona developers.

Re: Why APL Is Still Cool

#26
post #23

Earlier quoted context omitted.

[deleted]

"\ command" (e.g. "\ ls") works, you don't need to type exec. It passes the rest of the string to system: https://github.com/silentbicycle/kona/blob/master/c.c#L423 I'm one of the kona developers.

How to avoid forking?

Re: Why APL Is Still Cool

#27
post #26

Earlier quoted context omitted.

"\ command" (e.g. "\ ls") works, you don't need to type exec. It passes the rest of the string to system: https://github.com/silentbicycle/kona/blob/master/c.c#L423 I'm one of the kona developers.

How to avoid forking?

I have a fork because I sent several pull requests back, before I got commit rights to the main repo (kevinlawler's).

Re: Why APL Is Still Cool

#29
post #14

Earlier quoted context omitted.

What about J? J was developed Ken Iverson (the creator of APL) as a successor to APL that replaced unicode characters with two character equivalents. It's not greatly publicized, but the latest J was released under the GPLv3 ( http://www.jsoftware.com/source.htm ).

With all due respect to Mr. Iverson, whom I had the pleasure of meeting at an international APL conference many moons ago, I think J went in the wrong direction. Part of the power of APL is in the symbolic representation of concepts. The symbols are important. They form a language in more than one sense. Replacing them with ASCII/unicode equivalents rips the guts out of the language. Here's a thought experiment: Take…

Replacing them with ASCII/unicode equivalents rips the guts out of the language. … What have you accomplished? Well, at the very least you've ruined the superbly expressive nature of mathematics through agreed upon special symbols.

I really don't think the small number of keystrokes is what makes this sort of language expressive. Cryptic notation is a cost, not a bonus. Moving from, say, J to C, having to write

  log(…)
instead of

  ^. …
(or ⍟) does not make me feel like I've lost anything. The things that do make me feel constrained are having to explicitly write out loops if I want to apply that operation to an array of numbers instead of just one and not having a convenient way to use that operation in function composition.

Re: Why APL Is Still Cool

#30
I may be being a bit stupid here, but how do you advance the slides on that link? I've never been able to figure out how to use InfoQ presentations. I must be doing something wrong...
Post reply on HN