Earlier quoted context omitted.
I think the problem is, we intuitively estimate the readability of code based on the space it takes up, when we should take into account the information density. That code is extremely readable - if you assume it will take just as long to understand as the entirety of the GCC compiler: https://github.com/gcc-mirror/gcc
Read "A programming language", where APL came from - https://www.amazon.com/Programming-Language-Kenneth-Iverson/... - you might get more understanding why it is the way it is. It is the mathematical notation, put into, as Dijkstra expressed, "technologies of the past", completed (to be Turing-complete) and made executable. At least, I think, this is the basic idea.
Arthur Whitney's 'B' Language
61–70 of 109 posts
Re: Arthur Whitney's 'B' Language
#62Earlier quoted context omitted.
I would love to take a look at your notes. I'm fascinated by this and would greatly appreciate any help approaching it
Here it is for anyone who wants to have a look: https://docs.google.com/document/d/1W83ME5JecI2hd5hAUqQ1BVF3... I recommend you to keep the original files at hand for reference. Once you have understood it the first time, they are a better reference than my many pages document. When AW says he hates scrolling, it is not because he is lazy, it just doesn't go well with this style. I am sure there are mistakes. If you…
Re: Arthur Whitney's 'B' Language
#63I think a good introduction to this style of coding is the first "proof of concept" prototype interpreter for a small subset of J, also written by Whitney: https://code.jsoftware.com/wiki/Essays/Incunabulum Once I realized it was K&R C, I thought it was pretty straightforward.
If you want to see APL expressed as C primitives, something like Nial is pretty good: https://github.com/danlm/QNial7
Re: Arthur Whitney's 'B' Language
#64Whitney’s code is what I expect code to look like post-singularity when hyper intelligent AI program themselves!
You got me thinking how AlphaGo reinvented the style of Go for human players. A real AI taught one of our programming languages would code in a way that would be alien to us.
Whitney’s code is fascinating. I thought that someone might use a good C IDE to rename symbols to longer human readable names, but, that would harm the terseness of the code.
Re: Arthur Whitney's 'B' Language
#65I studied this code for a long time. I have lots of notes, going through everything almost line by line. I would be embarrassed of making them public because I never finished (at some point, I was just rewriting the x64 reference), but if somebody is interested I do not mind sharing. I would recommend everyone doing C to have a very careful look at this. The code is full of nice tricks and you start appreciating the…
Re: Arthur Whitney's 'B' Language
#66Earlier quoted context omitted.
I did, once, when I was at school. It was great - everything was so fast to type, the program (a somewhat complex game) would fit in on two screens. I almost finished it in a week. And the I had exams, and did not touch the computer for two weeks. When I came back, I forgot it all. Cx? Dzy? Those names were meaningless. This was a very importantly lesson - programs must be maintaineable. Unless you want to spend your…
Many people use descriptive variable names to carry semantic information. APLers use extremely consistent, stereotypical naming conventions which also carry semantic information. Think "Hungarian Notation" except it's just the prefix part. With consistently applied terse names, the same idea will result in the same code. Easier to visually pattern-match. It's also worth considering that longer names are not necessari…
To get to your example, the preferred signature would be:
square:{x*x}Re: Arthur Whitney's 'B' Language
#67Earlier quoted context omitted.
I'm so tempted to just respond with "wanker", though I know HN norms don't allow that. Either the code is for human consumption (in which case, fulfil that goal) or you're writing demoscene assembler which displays virtuosity without any positive impact on society.
I think the problem is, we intuitively estimate the readability of code based on the space it takes up, when we should take into account the information density. That code is extremely readable - if you assume it will take just as long to understand as the entirety of the GCC compiler: https://github.com/gcc-mirror/gcc
I guess there should be a niche for people like that, but the APL/post-APL community seems to think that Arthur has special computer science knowledge that can be best (or only) expressed in this form. We all know that's bullshit.
Re: Arthur Whitney's 'B' Language
#68Earlier quoted context omitted.
I did, once, when I was at school. It was great - everything was so fast to type, the program (a somewhat complex game) would fit in on two screens. I almost finished it in a week. And the I had exams, and did not touch the computer for two weeks. When I came back, I forgot it all. Cx? Dzy? Those names were meaningless. This was a very importantly lesson - programs must be maintaineable. Unless you want to spend your…
Many people use descriptive variable names to carry semantic information. APLers use extremely consistent, stereotypical naming conventions which also carry semantic information. Think "Hungarian Notation" except it's just the prefix part. With consistently applied terse names, the same idea will result in the same code. Easier to visually pattern-match. It's also worth considering that longer names are not necessari…
(+/*)\:
is matrix multiplication. The following computes the transitive closure of a binary relation (represented as a boolean square matrix): {x|x(|/&)\:x}
Its core has a similar "shape" as matrix multiplication: (|/&)\:
So in a sense variable names don't matter all that much! To grok this code you have to stop thinking in terms of item at a time operations and start thinking of operations over collection of items. If you know how to write unix shell pipelines you are already somewhat familiar with this paradigm except that a shell doesn't provide most of the more useful features of array languages!Re: Arthur Whitney's 'B' Language
#69Programming is not telling the machine what to do. That's the easy part. What programming is about, and what's hard, is telling the next programmer what the machine does. This makes the easy part a bit easier, and the hard part much harder, than using C. And I already disliked C to begin with, for similar reasons.
Re: Arthur Whitney's 'B' Language
#70Earlier quoted context omitted.
Binaries can now be obtained from Anaconda: https://anaconda.org/shaktidb/shakti Not sure what was on gitlab, I assume not source?
The install for Anaconda is over 500MB. If it is anything like k, the "shakti" binary is probably small, maybe under 260KB. Is there a way to download just the shakti binary? What are the restrictions on the trial version of shakti? Is it time-limited (e.g., 30 days)? Does it need an internet connection to be able to phone home? (I think FD/Kx started doing this with their 64bit trial.) The backstory for all this is…
bin/k is 185K