@Bubbler I think it is a bit too granular to the infobox. But I like the categorisation otherwise.
@Bubbler I like "Identity, Structural, Selective, Computational" (though materialise should be under Identity, I think) but the subcategories are too much for an overview. However, I wouldn't be opposed to adding MediaWiki categories like that, nor would I be against adding separate infoboxes with the finer classification.
@Bubbler Maybe even the scalar/non-scalar distinction doesn't make sense here. Like if I'm looking for random number generation, how would I know that Roll is is scalar and Deal isn't?
@Bubbler True, which APL doesn't have or need (other than single-letter quad names) but these two do uniquely deal with text, either evaluating or converting to.
@FredrikNiemelä We may have another user that sees the same problem. Can you tell me exactly what CPU, motherboard, and OS you experience the crash on?
@Adám hello I didn't see your message! Yeah I am interested in APL, I've been looking at the conversations you have bookmarked here because they make for very informative lessons :)
I've been messing with APL for about a year i think. i find the symbolic primitives and conciseness quite appealing and i've used it a couple times for golfing challenges :)
How can I "partition" or tile a matrix into equal-sized sub-matrices? Similar to what stencil produces, but no overlaps. So a 4 4 ⍴⍳16 would give the four 2x2 quadrants, starting with 2 2⍴1 2 5 6 (for ⎕io←1).
@xpqz The reasoning required to arrive at this solution is pretty much identical to yesterday's problem, only complicated by one additional axis, and finalising through enclose (do you actually need to?).
(i would personally prefer monadic ≡ erroring on non-consistent depth if negative depth is thrown out, but i also realize that's pretty much by definition less useful ¯\_(ツ)_/¯)
@Marshall It also works in current dzaima/BQN just by using ≠ instead of <.
@dzaima Currently I definitely can't have Depth error, because 0<≡ is how you figure out something's an array. Usually if you want to know the depth you just want to know if it's above some number and don't necessarily care yet if it's homogeneous.
@Marshall Although I guess you could also use something like ≢⊸⥊⊸≡.
yay https://dzaima.github.io/paste/#0xZTLattAFIbX1VMMwQuJgCLJckDBm9axacB2Q0O3hRPp2J5oNCNGI7dpKWRZB7osZFN6gUL7FIFu@xZ6gj5CR7Jc1NbpxU2JQNJI5z/nm/nn0iL2zv3@4dAghHjbnuGXjadfXr08//ShePHadIrFm2Lx1up@vig/3W75/fyiWLyztOjjM9Mrzi694v15d9Vwq/fZZVvfvqUftWQZ9ao/3TLoNsWWcZCkDBPkChQVvC@lkHvkBOZgM@BT@0hBGN@bo5ww8aiO8pwx40Y6q016SDa@ynSj1XD@RsbQfxxiWnpNKCdqJhEispUA5VsN28eixyDL9nEyEDmPauN7ImcR4ULpVKooMPoESVgKG6mUz0WMeuIk5dOe4CGoAYRKyFPjFqil8Bgy3DmJYi1WKDkwO6FZaD/gGUzQRp7lEqsOHHzjRI451ktkjmSEaiYi69@qmXW0LLDnur7zU70fB7RPJYZqCb8LPGJoZ7PSkDvYrLtGVjHafrAJIpWYgsRoCMlxBAMhkysJbtD@zwTP3cimBGK8utdO57c1m1lZayhEnKf2FFWz…
@dzaima Obviously 2 ←→ ><2 feels best. But also consider >1‿2 (same structure as (<'a')≡⎉0"ab"). If it's 1‿2, then the depth of >'s result depends on the argument shape, which is not good.
@matt I obtained "BQN" by moving each letter in "APL" forward by one in the alphabet. I'd come up with the backronym "Big Questions Notation" by the time I realized N doesn't come after L.
@dzaima I think turning a non-array into an array when one is expected is generally fine. I guess it means ⥊ can change depth, but the transformation is just 1⊸⌈, which is very regular.
@dzaima It's a mild form of permissive/soft typing. I think the one-way nature does tend to avoid the typical problems with soft typing. The problem is you could end up with a boxed scalar where a non-array is expected, but with things like pervasion that could probably happen anyway.
Not the extension used in Dyalog Extended, but I think it makes a fair bit of sense. Don't know how useful it is though. Anyway, for BQN/future Dyalog/dzaima/ngn/other it occurred to me that a really natural extension of × for Bv × Cv would be: 1 0 0 1 1 × 'ABCDE' → 'A DE'. Taking advantage of the fact that often multiplying by boolean arrays is used to mask numeric vectors, of any rank, eg. 1 0 0 1 1 × 1 2 3 4 5 → 1 0 0 4 5. So it'd be that behavior which was extended
Makes good sense to me, but curious if it'd be of any use. Also, one would have to figure out the equivalent of 0 for letters. Probably space, but maybe something like a dash for 'A––DE'. Or maybe that would be set with a quad command as there might eventually be other functions that would require a set default for null characters?
(Also, sorry re: ridiculousness! Nearing 24 hours that I haven't been able to get shuteye...)
Versus the extension that you use, which also makes a lot of sense given that ¯1 1 ¯1 × 1 2 3 is used to make elems neg/pos, which is homologous to making them lower/upper
@Adám But what about which extension is more useful/practical? I don't imagine the other one is very difficult to self-define either, esp. with new quad casing
Whoops! Sorry to interrupt! Will put on hold for later
Yes, View is usually for development. Once you're happy with the chart, you can output it to file by doing `sp.SaveSvg '/tmp/chart.svg' Causeway.SvgMove.FixedAspect
You can also grab the svg source directly in APL (without writing to file) by doing sp.RenderSvg Causeway.SvgMode.FixedAspect
{sp}←OwidCovidData;Causeway;Drawing;InitCauseway;System;View;cdata;cfields;codes;countries;countries_to_plot;csv;data;date;dates;emptyrow;fdata;field;fields;fields_to_plot;location;locations;miss;numfields;row;sp;txtfields;values miss←¯1E300 ⍝ missing value
In a proper application, there would be two functions : one to build the data from source, one to plot it. But I thought it would be simpler to have a single big function here
from the docs, "five common vector formats (SVG, PDF, EPS, XAML, EMF, VML)" but the list in () has 6 formats. Are any 2 of those basically the same or is this an error?
@Adám Do you mean the fact that some ticks don't have labels ? That's to avoid label collision. The easy fix is to use angled labels ( sharpplot.com/AngledLabels.htm )
@Nic No, I mean if I have a bunch of dates or even date-times in vector format (Y M D or Y M D h m s f) as my X values, what do I need to do to make them position correctly on the axis.
@Nic Actually one thing comes to mind but it isn't really charting... Can one "hack" the sharpplot to make "drawings"? e.g. is there a plot type that allows me to specify the colour of 2d (square/rectangular) regions?
@RGS you can add a Y-zone in Adam's graph by doing sp.SetYZones ⎕NEW Causeway.Zone(2 3 System.Drawing.Color.Orange Causeway.FillStyle.GradientTop) before the sp.DrawLineGraph
You can't do these kind of things with OO charting packages - unless they have a much more complex API - which is then probably largely undocumented - e.g. Syncfusion
Also hasn't been anything on 'how to think' with ⍤/⍥, which would fit in nicely with that tacit bit. Seems to me knowing what they mean vs. seeing enough examples with them and having exercises to think/write with them the first time around is something that might deserve some attention
@Adám Ah! Alright. I thought so, but wanted to make sure!
Would be interesting to know more about what it looks like like when the leading array model is properly implemented, and where it's inconsistent in Dyalog. And also about the bunches of other models, of which BQN is using a different one
(And more about the other little implementation niche-y things, like the null prototypes and such.)
@Adám APLWiki is very hard to follow on the array models for someone who is not well versed in them already, as discussed in the first Zoomy thing. Perhaps it's still the proper medium for it though, and one just has to wait for it to be improved?
And given that loads of stuff has been done like System Functions: behaviour, session, Stack & workspace info, misc, Array programming techniques, Array coding style in depth, Complex numbers in depth, etc. It doesn't seem that different to me
@Adám Ah okay, that works too!
Just trying very hard to be helpful -- unsuccessfully -- but I can stop now, haha
@AviF.S. there's really not that much about it - flat array theory: no arrays in arrays (other than simple scalars); nested array theory: not flat array theory; floating array model: enclosing/disclosing simple scalars is a no-op, and all the nice and not-so-nice consequences of that; based array model (what BQN has): 1≢⊂1 and all the nice and not-so-nice consequences of that
@Adám I see! I thought this was all mainly how stuff works, esp. re: complex numbers, and I'd thought this might count too, since it directly influences the way one codes in this APL vs others
@Adám the aplcart categories are Array Properties | Boolean/Logical | Comparison | Data Conversion | Expression | Function Application | Index Generation | Mathematical | Selection | Sets | Structural | System | Text , according to the issue template
BQN is the same as every non-array language with multidimensional arrays. An array is a data structure you can put things in. But you can also have things that aren't in arrays.
J only operates on arrays, which are always homogeneous containing numbers, characters, or boxes. The only way to have a mixed or nested array is to use boxes. So it's different because it has no "unboxed" arrays and it forces arrays to be homogeneous.
@Marshall But isn't that just a terminology difference. If J stopped calling simple scalars arrays, only considering <42 an array, would there still be a difference?
Or put differently, is "based" like a merger of the nested model (where you can't encapsulate simple scalars) and the boxed model (where you can't have a mixed-type flat array)?
@Adám I don't think so. I would say the nested model is like the based model plus an equivalence rule, and the flat array model is only similar to the other two in that it uses arrays.
@Adám First is a very strange way to say it: there is no obvious way to "add" enclosed scalars to the nested model. The second is wrong, because nothing like a non-array exists in the flat model.
@Marshall What do you mean? The way to add enclosed scalars to the nested model is simply by not having the interpreter disclose whenever a nested simple scalar is encountered. Regarding the flat model, that's only terminology, afaict.
@Adám That would be removing the enclosed-simple-scalar rule from the nested model. If you start with the nested model as a black box, you can't make the based array model from it without some weird workaround.
@dzaima I would say 1 is a number, and J doesn't let the programmer use numbers, only numeric arrays. That's what the flat array model is in my opinion. You place an array layer over everything so you can always use array techniques.
@Adám a property of the floating array model is that 1≡⊂1. You just cannot keep that if you want to switch to a based array model, and so you would be removing behavior
Another way to put it: Any nested array can trivially be converted to based and back without any ambiguity or loss of structure. Any boxed array can trivially be converted to based and back without any ambiguity or loss of structure.
@Adám Yes, that's true. In the case of J versus BQN, either BQN's non-arrays are data J can't represent or J's non-scalar unboxed arrays are data BQN can't represent (though the first correspondence preserves functions somewhat better). In the case of NARS versus BQN, there is a single obvious correspondence but many BQN arrays correspond to the same NARS array.
@Marshall I would however say that 1 is a number, and J allows you to use it as if it were a scalar. Neither BQN nor j error on 2+2 (or return <4) either.
@Marshall If I was to try (since you say it can't be done) to represent BQN's 1 in J, I'd choose 1 as its representation. It might not be the same under the covers, but it still provides a 1:1 mapping, no?
@Marshall Can you give me an example of a J non-scalar unboxed array that BQN can't represent?
@Adám The element operation is an example of additional structure that makes arrays more than sets. But the nature of an element varies across models. J users usually consider an element of an array to be a 0-cell, but I would say it's actually a plain value that's outside the array model. In NARS an element of an array is always an array. In BQN an element of an array is always some value in the language, but maybe not an array.
Hm, slowly dawning on me here, I think. BQN doesn't have J/APL's 1 2 so it'd have to represent it as (<1),(<2) but that'd mean that 1 should be represented as <1.
From BQN's perspective, J and APL never let you remove the final enclosure. It is as if J and APL check all the time and if you ever remove the last layer, they immediately re-enclose the value. Much like APL checks all the time, and if you ever enclose a simple scalar, it immediately discloses the value.
I can now create a new "atomic array theory" of my CRP (suggested logo: 💩︎) language that looks upon BQN in a similar fashion. BQN never quite lets you access the real actual value. See, CRP doesn't even let you laminate real actual values. You have to narry (a special CRP term) them first to make them narrays, and only then can you laminate them (or catenate their boxes).
@dzaima Yes, so BQN would be "missing" non-boxed non-scalar arrays. But I don't think this correspondence is as close. For example, Shape returns a vector of numbers in BQN, but this would correspond to a boxed vector in J (and the result of J's shape, a numeric vector, couldn't be represented in BQN).
@Adám Sure. BQN also doesn't let you access actual integers either, just real numbers that have integer values. I don't think BQN's system is better because it has "more" values under the most accurate correspondence, but because it is easier to describe mathematically and leads to fewer programming errors.
@Marshall i suppose the reason J doesn't allow heterogeneous arrays is way deeper than just it not wanting to. In my mind though, i could easily make a J that just changes L., allows heterogeneous arrays and keeps all other J behavior as-is, and has the same array model as BQN
@dzaima Yes, I think there are very good reasons to adopt a flat array model. And of course all implementations are going to continue using this model under the hood, at least most of the time. However, I don't think it works so well with array nesting.
@dzaima What exactly would be the change to L. though? 1 should have the same depth as 1 2; they are the same kind of thing. Would you just have it start at 1?
@Marshall 0=L.1 and 1=L.1 2, just as in APL/BQN. The point of my message was that making them not "the same kind of thing" doesn't require any visible changes other than L.