Earlier quoted context omitted.
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 :)
Origins of J
31–40 of 76 posts
Re: Origins of J
#32The 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
#33The 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.
Please do! I'd like to learn. If you can expand on this in the README section as well that would be great.
Re: Origins of J
#34Arthur 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.
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.
1. The other technologies are evolving to take parts of kdb+ that made it special quicker than kdb+ is evolving. See arrow / parquet / numpy / kafka, they each solve parts but kdb+ had them all 10 years ago in 2. The ratio of learners to advanced programmers has increased every year for the last 20 years. The languages that have gained popularity in that time range are those with the easiest learning curve. Most beginners no longer want to sit with a book frustrated on 2 characters for half a day.
Re: Origins of J
#35Earlier quoted context omitted.
> 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 :)
How do we pick up that writing style.
Re: Origins of J
#36Earlier quoted context omitted.
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 :)
For my own amusement I tried this a couple months ago and I 100% agree. I found my code to be more engaging to develop and understand (function names encoded into 3 chars, structure names encoded into 4 chars, primitive types are a capital letter, etc).
It is like a game you play with your brain to recall how your code works. And, it reminded me about studying 6809 assembly in college, where it was easy to memorize every instruction mnemonic and what it meant.
I just don’t know if I would show it to someone at work, but for my own prototypes and experiments, I like it.
Re: Origins of J
#37Earlier quoted context omitted.
> 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.
> 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. Please do! I'd like to learn. If you can expand on this in the README section as well that would be great.
good idea, why not
for a more throw-me-in-the-water introduction, here are my notes on another famous public domain release from atw. some remarks are specific to the codebase, but essentially it is a general introduction to atwc:
https://github.com/kparc/bcc/blob/master/d/sidenotes.md
and here’s a less involved way to get lit:
Re: Origins of J
#38Earlier quoted context omitted.
> 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 :)
How do we pick up that writing style.
Re: Origins of J
#39Earlier quoted context omitted.
> 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.
Please do. Although I'll probably never write C in that style, most of us here will probably learn a few things that will eventually prove useful. (And it probably will also serve as a historical document of a "skill"(?) that is apparently soon to be lost to obscurity...)
now that i think of it, i already did just that once, only forgot. getting old sucks, and also forgetting things is a great skill i learned from atw. as he likes to say, “kelas, ignorance is bliss”. Here you go - all you ever need to know about how to read and write atwc:
https://github.com/kparc/bcc/blob/master/d/sidenotes.md#styl...
Re: Origins of J
#40https://code.jsoftware.com/wiki/Guides/GettingStarted
For what it's worth, I've also studied this code a bit. This repo has an annotated and (somewhat) reformatted version of the code: