Live data from Hacker News

Origins of J

github.com

21–30 of 76 posts

Re: Origins of J

#21

The code in C that suppose to be written like this is usually never written first like that, its like pretending writing minified js by hand from scratch. Usually the code is contracted and "minified" from large program to fit entire program into 1-3 screens, the person who manually "minified" it to that state will know its expansion but other people will dismiss it as obfuscated C, its an old technique to fit lots o…

> Not surprising since J is optimized for code density per screen.

I don't think that's the whole story. J is dense like traditional mathematical notation, but can be executed by machine. Experienced J programmers use it to convey mathematical ideas. See for instance:

https://www.jsoftware.com/jwiki/Puzzles/Unit_Fraction_Sum

Although I can't read the notation, I appreciate the role it can play. Plain C (or whatever) code isn't an efficient vehicle for ideas like that. Numpy/matlab comes closer but J is a stronger approximation of traditional maths notation.

Re: Origins of J

#22
post #10

Obligatory posting of Bryan Cantrill's interview with Arthur Whitney https://queue.acm.org/detail.cfm?id=1531242

The full audio of that was recorded but was never released -- this is reminding me that I should loop back with ACM to see if they still have it and can release it. In particular, I want to see how long the pause when Arthur responded to my question "What do you think the analog for software is?": I won't give away his answer, but it more or less detonated my brain -- and it took me what felt like minutes (but was surely only seconds?) to put myself back together and ask a follow-up.

Re: Origins of J

#23
post #16

Earlier quoted context omitted.

This kind of story is what I enjoy so much about HN. I wish Kdb+ or Shakti had dramatically lower costs for those industries that don't have access to banking cash. I know open source versions exist, but I understand them to mostly be toys and not really production worthy.

K is at the end of the day a fancy calculator, I think for most workloads you can use the open source version called ngn/k

Sure, a fancy calculator that supports rather efficient execution on ridiculously large machine farms. What some people might call the implementation language for a database engine.

Re: Origins of J

#24

The code in C that suppose to be written like this is usually never written first like that, its like pretending writing minified js by hand from scratch. Usually the code is contracted and "minified" from large program to fit entire program into 1-3 screens, the person who manually "minified" it to that state will know its expansion but other people will dismiss it as obfuscated C, its an old technique to fit lots o…

While there are people that do this, I do not think that Whitney is one of them. This code is not obfuscated; it uses macros and strategically defined functions to allow writing code in a style similar to APL that appears natural (-ish?) to someone fluent in that programming style.

Re: Origins of J

#25

Arthur Whitney is a mad genius. We were an early customer of KX systems and I programmed with KDB for a few years. Arthur Whitney once sat at my desk and helped me debug my code. Very nice guy. Super smart and hilariously knowledgeable about the low level performance of chips, caches, etc. Ask him how many nanoseconds it takes to divide an array of doubles by an array of ints, and he knows. He just knows.

(author of the modern port here)

> Arthur Whitney is a mad genius

atw is atw :) our old man is awesome. a bit grumpy at times, but then who isn’t :)

Re: Origins of J

#26
post #16

Earlier quoted context omitted.

This kind of story is what I enjoy so much about HN. I wish Kdb+ or Shakti had dramatically lower costs for those industries that don't have access to banking cash. I know open source versions exist, but I understand them to mostly be toys and not really production worthy.

K is at the end of the day a fancy calculator, I think for most workloads you can use the open source version called ngn/k

> k is a fancy calculator

[put your favorite Java here] is also a fancy calculator by the virtue of Turing completeness. what’s your point?

Re: Origins of J

#27

The code in C that suppose to be written like this is usually never written first like that, its like pretending writing minified js by hand from scratch. Usually the code is contracted and "minified" from large program to fit entire program into 1-3 screens, the person who manually "minified" it to that state will know its expansion but other people will dismiss it as obfuscated C, its an old technique to fit lots o…

> The code in C that suppose to be written like this is usually never written first like that

usually not. but we prefer to write it first this exact way, and there are good reasons for rhat.

> obfuscated c

it is not. this style is extremely regular, very readable and writable, and escapes a whole galaxy of typical C blunders. i can expand on that if you wish.

Re: Origins of J

#28

The code in C that suppose to be written like this is usually never written first like that, its like pretending writing minified js by hand from scratch. Usually the code is contracted and "minified" from large program to fit entire program into 1-3 screens, the person who manually "minified" it to that state will know its expansion but other people will dismiss it as obfuscated C, its an old technique to fit lots o…

While there are people that do this, I do not think that Whitney is one of them. This code is not obfuscated; it uses macros and strategically defined functions to allow writing code in a style similar to APL that appears natural (-ish?) to someone fluent in that programming style.

> not obfuscated

absolutely not. porting it to ISO C was a very fun and smooth ride, also added two adverbs atw forgot to add in 1989 (see over/scan) and a header file with some handy accesssors (atw usually does that, but he was lazy that day)

> to someone fluent in that programming style

what people often don’t realize is just how fast one can pick up atwc style, and how hard it is to ever go back :)

Re: Origins of J

#29
post #5

“…and that’s why we have code formatters.” That’s neat and impressive. I’m glad I’m not required to read or understand it.

It really doesn't help that it's written in ancient K&R C, but if you spend ten or so minutes just staring at it, familiar shapes and patterns start to appear. (Give it a try!) Incidentally, it's in line with how APL code looks like an alien artifact at first, but you get used to it fast if you have spatial reasoning to wrap your head around reshaping and transposing.

porting from k&r to iso is super easy. fun, too.

Re: Origins of J

#30
post #10

Obligatory posting of Bryan Cantrill's interview with Arthur Whitney https://queue.acm.org/detail.cfm?id=1531242

The full audio of that was recorded but was never released -- this is reminding me that I should loop back with ACM to see if they still have it and can release it. In particular, I want to see how long the pause when Arthur responded to my question "What do you think the analog for software is?": I won't give away his answer, but it more or less detonated my brain -- and it took me what felt like minutes (but was su…

I agree with Arthur's answer, but unfortunately it runs afoul of Conway's Law: auteurs have a voice* and are capable of producing software in that style, but large organisations? By necessity, they must produce something qualitatively different, that anyone can slot anything into anywhere, optimised for superficial comprehensibility over elegance.

* sometimes small groups? Doug McIlroy said he was lucky to have managed a software group whose members would sit around in the lunch room and brainstorm (reminiscent of the Little Prince?) not what they could add, but what they could remove.

« Par ma foi, il y a plus de quarante ans que je dis de la prose sans que j'en susse rien, et je vous suis le plus obligé du monde de m'avoir appris cela. » —JBP

Post reply on HN