Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Excuse me, but in my programming thought flow, there are checksums and limits, not c's and l's, and my code reflects that. Do I not qualify as a coder?


Quick, what does the i stand for in "for (i=0; i<n; i++) {"?

It was a quick prototype written by one APLer, for another APLer, using mutually understood conventions. For example, its dyadic verbs ("V2" functions) use the variable names 'a' and 'w'. For a while, I wondered why (maybe they stood for "Arthur" and "Whitney"?), but after reading Iverson's _A Programming Language_, I realized APL usually uses lowercase alpha (α) and omega (ω), which look like 'a' and 'w' in ASCII. Details like that would need no explanation.

Likewise, in

    typedef struct a{I t,r,d[3],p[2];}*A;
t is type (is it boxed? 0 or 1), r is rank (number of dimensions), d is the dimensions (hardcoded to a max of 3; a 2x3x4 matrix has d={2,3,4}), and p is a variable-length array sized by malloc-ing extra space; that's where the values go, either longs or void pointers). That'll save you some time if you ever try to pick the rest apart. :)

APL code is often terse to the point of seeming cryptic, just math papers are. You get used to it, and it's that way for a reason.


Wow, thanks for that clue. Will have to take a closer look at that source now. I don't feel too bad for not really getting it, given the creator of J saying this about it:

My immediate reaction on seeing the page was recoil and puzzlement: it looked nothing like any C code I had ever seen. (“Is it even C?”) However, Ken counselled that I should reserve judgment. As recounted in An Implementation of J, it then happened that:

I studied this interpreter for about a week for its organization and programming style; and on Sunday, August 27, 1989, at about four o’clock in the afternoon, wrote the first line of code that became the implementation described in this document.

The name “J” was chosen a few minutes later, when it became necessary to save the interpreter source file for the first time.


If it intrigues you, check out Henry Rich's _J for C Programmers_. There's a free PDF on Lulu, and it's included with J (http://www.jsoftware.com/).

Like Emacs, J's internal documentation is excellent, but you have to learn its idiosyncratic terminology before you can actually find things.


I obviously can't speak to Arthur Whitney's state of mind circa some summer afternoon 1990, but I don't believe the code is an attempt to obfuscate or be snobby/elitist at all. He was simply trying to express the basics of an idea in a terse form. It's the APL way.

I, for one, am happy simply finding the code 'of interest'. It's not great code, it's the initial sketch of an idea (I'll bet you AW would admit that readily (plus Roger Hui refers to it as "Incunabulum", which seems a bit tongue in cheek)) -- but, it's certainly not something you see every day, and it is thought provoking.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: