Author here if you have any questions. The main reason to write this document is people used to APL wondering why BQN leaves out certain primitives (answer: I don't think they're really primitives), but probably more HNers would wonder why it has so many that ASCII isn't even fit to keep them all (the full list is at https://mlochbaum.github.io/BQN/doc/primitive.html ). Just as well; hopefully I've addressed both con…
What is a primitive?
11–19 of 19 posts
Re: What is a primitive?
#12Author here if you have any questions. The main reason to write this document is people used to APL wondering why BQN leaves out certain primitives (answer: I don't think they're really primitives), but probably more HNers would wonder why it has so many that ASCII isn't even fit to keep them all (the full list is at https://mlochbaum.github.io/BQN/doc/primitive.html ). Just as well; hopefully I've addressed both con…
I think that you're after the universal morphisms in a computational category. Curien called them "categorical combinators" and gave a listing in https://core.ac.uk/download/pdf/82017242.pdf
Although, if you're here... there's a more focused question that's been bothering me because I feel it should appear in category theory but can't locate it. There's an operation I call Under that I partially introduce at [1] and define at [2]. The idea is that given functions F and G, where G manipulates things in some overall framework like arrays, F⌾G is a function so that F⌾G x is as similar as possible to x while satisfying (G F⌾G x) = G x. Maybe it's a sort of pullback along a functor G. Does that look familiar?
[0] https://mlochbaum.github.io/BQN/doc/replicate.html
[1] https://mlochbaum.github.io/BQN/tutorial/variable.html#modif...
[2] https://mlochbaum.github.io/BQN/spec/inferred.html#under
Re: What is a primitive?
#13Earlier quoted context omitted.
Are you saying that you consider strings in Haskell to be a primitive?
No, Haskell is weird since a string is [Char]. If it was it’s own value, yes. The languages i’ve written are pretty basic. e.g. the data types might be - Number - String - True, false, null - Array of values - Record of fields (key + value) - Variant of options (key + value) So the distinction is clearer.
I can think of various langages where string is not a built-in, but i can’t think of a langage where string is not some sort of sequence, not just in its implementation but in its interface.
The definition also breaks down quickly e.g. is a complex a primitive? If not because they have real and imaginary parts, why are floats which have a mantissa and an exponent? And what about functions? What even is a child? Are value-less sum types primitives but valued ones not?
More importantly, how does it matter? What does the distinction you draw provide that is useful?
Re: What is a primitive?
#14Earlier quoted context omitted.
I think that you're after the universal morphisms in a computational category. Curien called them "categorical combinators" and gave a listing in https://core.ac.uk/download/pdf/82017242.pdf
I doubt it? Universal constructions give a nice definition for a few operations but I doubt they have the power to pull out all primitives, that is, select out of all the well-defined things you could do the ones that are natural or useful. Can Indices[0] be constructed as a universal morphism? Is defining it in this way simpler than an algorithmic definition, which can be quite short? One of the properties of primit…
But I could very well be totally off.
Re: What is a primitive?
#15Is it pronounced "bacon"?
Re: What is a primitive?
#16Is BQN a near-incrementing of the letters in APL? Is it pronounced "bacon"?
Like APL versus "apple", the normal pronunciation is to spell it out B-Q-N, but it may be pronounced "bacon" if one wishes to establish a double-entendre. So a BQN user is a BQNator, pronounced like https://en.wikipedia.org/wiki/Baconator.
Re: What is a primitive?
#17Earlier quoted context omitted.
I doubt it? Universal constructions give a nice definition for a few operations but I doubt they have the power to pull out all primitives, that is, select out of all the well-defined things you could do the ones that are natural or useful. Can Indices[0] be constructed as a universal morphism? Is defining it in this way simpler than an algorithmic definition, which can be quite short? One of the properties of primit…
While I haven’t (yet?) taken the time to understand the notation you are using to define this “under” operation, it sounds a little like an adjoint of a functor? But I could very well be totally off.
Most of my problem seems to be that the definition of Under really depends on applying functions to particular arguments. So it's hard to see how to set up categories to capture the necessary properties. But I don't know if it's actually hard to do or just confusing.
Re: What is a primitive?
#18Along vaguely related lines is https://gist.github.com/chrispsn/b1020918a83a28ab8b4442d8aff...
The relationship is interesting. Chris is trying to find a minimal set of functions good enough to derive the rest (a worthwhile goal, and it mentions at the bottom that I did something similar in BQN). Part of my current thinking about primitives is that it's not important how many there are, more that each represents a coherent simple concept. But primitives that are too similar can cause problems for memory and ma…
Re: What is a primitive?
#19Earlier quoted context omitted.
The relationship is interesting. Chris is trying to find a minimal set of functions good enough to derive the rest (a worthwhile goal, and it mentions at the bottom that I did something similar in BQN). Part of my current thinking about primitives is that it's not important how many there are, more that each represents a coherent simple concept. But primitives that are too similar can cause problems for memory and ma…
What is your opinion of the j. primitive in j?