You know that feeling where you feel like you have a good handle on things- maybe it's foundational mathematics, or the fundamentals of computer software.
And you start reading something so incomprehensible that you start to wonder if there's just this universe hiding in plain sight directly under the universe you've always known.
That is the precise feeling I get when I trying to understand this post.
Don't get me wrong, I appreciate the exposure, but damn if I'm not sweating trying to understand why this all matters.
Yeah, array language syntax just breaks my brain. I'm sure given enough time I could get the hang of it, but I'm also pretty sure I'll never put in the time
As far as I can tell, it seems to be something halfway between TempleOS and MUMPS but its a programming language instead of an OS. I don't think you are missing some deep meaning. Its more that this is written in an esoteric language which seems to be more overloaded than Perl by someone who maybe isn't so great at clear communications. He's just looking at ways to make more efficient code in K (the language). But it does look sort of like he is talking about math theorems (he isn't).
> by someone who maybe isn't so great at clear communications
I don't think that's fair. If you're familiar with the programming language, his writing is fairly clear. If you're not, maybe you're just not in his target audience.
IOW, optimizing his text for people familiar with the language is probably a better choice than teaching the language, which would distract him from his goal.
> more overloaded than Perl by someone who maybe isn't so great at clear communications.
I have the same feeling. The root of K is APL, but to avoid special characters (I assume), the same symbol has multiple meanings (overloaded), depending on eg. the position, the data type, and the context. The idea is that "programs should be short enough to fit in your head." The challenge is, similar to Perl and Regex syntax, it's very hard and often cryptic to read.
I do think a concise syntax is useful, for a programming language. But at the same time, the syntax should be readable, and that probably means that each symbol or operator must only have one meaning, and that meaning should be (more or less) obvious.
K is an array language. Even an integer is actually an array of one element. I think that makes sense for a tiny language: This is the simplest possible type system. You can even support strings, when using eg. metadata or using a heuristic like "a string is always zero terminated" (which is what I used for my tiny language).
It's clear that the symbols want to have one meaning each, for monadic and dyadic use, but that might mean quite different execution and types.
For example, & is monadic 'where' and dyadic 'min' (a logical extension of it being AND on bit-booleans), but this means you get different semantics, even if they all capture the 'where'-ness:
1 3 ~ &0 1 0 1 / when applied to a list, gives the indices of true elements
`b`d ~ &`a`b`c`d!0 1 0 1 / when applied to a dict, gives their keys
In both cases, you get that `x@&x` works, as `&x` will yield appropriate indices for `x`, but what that actually does has changed. In other languages, these would be spelled very differently, and so do seem like an overload, but sometimes it is just a point of view.
As for why it's obvious- it's not, really, but it's no less obvious than the word `where`, and you have already learnt it, as it is (as it seems to me at least) to be punned on the C syntax (same as `*`, which gives `first`).
And you start reading something so incomprehensible that you start to wonder if there's just this universe hiding in plain sight directly under the universe you've always known.
That is the precise feeling I get when I trying to understand this post.
Don't get me wrong, I appreciate the exposure, but damn if I'm not sweating trying to understand why this all matters.
Ah of course, of course. Trivially, even. Who are we to question the shallow odometers, really?
I don't know array based languages well but I want to read the next one.
As far as I can tell, it seems to be something halfway between TempleOS and MUMPS but its a programming language instead of an OS. I don't think you are missing some deep meaning. Its more that this is written in an esoteric language which seems to be more overloaded than Perl by someone who maybe isn't so great at clear communications. He's just looking at ways to make more efficient code in K (the language). But it does look sort of like he is talking about math theorems (he isn't).
I don't think that's fair. If you're familiar with the programming language, his writing is fairly clear. If you're not, maybe you're just not in his target audience.
IOW, optimizing his text for people familiar with the language is probably a better choice than teaching the language, which would distract him from his goal.
I have the same feeling. The root of K is APL, but to avoid special characters (I assume), the same symbol has multiple meanings (overloaded), depending on eg. the position, the data type, and the context. The idea is that "programs should be short enough to fit in your head." The challenge is, similar to Perl and Regex syntax, it's very hard and often cryptic to read.
I do think a concise syntax is useful, for a programming language. But at the same time, the syntax should be readable, and that probably means that each symbol or operator must only have one meaning, and that meaning should be (more or less) obvious.
K is an array language. Even an integer is actually an array of one element. I think that makes sense for a tiny language: This is the simplest possible type system. You can even support strings, when using eg. metadata or using a heuristic like "a string is always zero terminated" (which is what I used for my tiny language).
For example, & is monadic 'where' and dyadic 'min' (a logical extension of it being AND on bit-booleans), but this means you get different semantics, even if they all capture the 'where'-ness:
In both cases, you get that `x@&x` works, as `&x` will yield appropriate indices for `x`, but what that actually does has changed. In other languages, these would be spelled very differently, and so do seem like an overload, but sometimes it is just a point of view.As for why it's obvious- it's not, really, but it's no less obvious than the word `where`, and you have already learnt it, as it is (as it seems to me at least) to be punned on the C syntax (same as `*`, which gives `first`).
Reading that certainly requires more than symbol shunting.