« first day (1252 days earlier)      last day (1621 days later) » 

 
2 hours later…
03:50
@RGS #2. While some entries can't easily get example runs, most certainly can, but only 21% have.
 
2 hours later…
05:22
@Adám What do you think about re-classifying APL built-ins page on the wiki?
05:36
@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.
Right, I also thought it might be too much for a single infobox, but multiple separate infoboxes would work.
I also have some ideas for renaming categories. Like "Structural>Query" to "Structural>Array Properties"
Some sub-categories can be combined, like "Computational>Range+Random" to "Computational>Generation"
@Bubbler I mostly like the operator classifications. I'm make a few changes, but I like the idea.
05:56
Can you add your ideas/thoughts on the page?
Sure. Maybe I can just copy yours to a separate section and make my suggested changes so we can compare?
Good idea.
06:12
@Bubbler I begin to wonder if the monadic/dyadic distinction even makes sense.
What happened to Signum?
@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?
@Adám Totally true.
06:34
@Bubbler Have a look. I'll be back in a bit.
07:03
@Adám Mostly looks good, except for naming the category for Format/Execute as "Text".
07:29
@Bubbler "String" better?
Not really. Text/String sounds like a category for something like Search/Replace to me.
@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.
Well, yeah. Format and Execute feel so close, yet the only characteristic in common (that we can say concisely) is that they deal with text...
07:45
@Bubbler 2) They are (partial) inverses. 3) They both crash the interpreter when inverted on strange args.
2) I once thought " and are somewhat like and , then should I call them 'general conversion' or something?" 3) ...*sigh*
08:02
@Bubbler Good point. I've now combined the two categories.
@Bubbler What do you think about adding a == Related Primitives == section to each primitive's page?
@Adám How about == See also == \n === Related Primitives ===?
@Bubbler Sure, but are there other see-also's than primitives? I'd be fine with just == See also ==. That's what WP uses.
@FredrikNiemelä What sort of CPU are you experiencing the crashes on?
Some primitives are strongly tied with certain concepts and such, but probably there's no problem just listing them out.
Ah, you're right, and yes, just listing them would be enough.
08:25
Announcement: Today's APL Cultivation is Simple plotting continued (with Nicolas Delcros)
(No exclamation marks only because then it doesn't fit on one line)
(Don't know that I can make it, but in case anyone else was wondering what the subject is today!)
08:40
@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?
09:20
@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 :)
@akhmorn Cool. What level of familiarity with APL are you up to?
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 :)
@akhmorn Great. You're always welcome to hang out here. You may also want to check out aplwiki.com and aplcart.info
09:54
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 Stencil allows you to choose a step size.
@Adám But not start location. (And trying to adjust that makes the code funky.)
I couldn't get that to do the right thing.
Right, but if you're using 2-by-2, it isn't an issue:
      ⊂⍤⊢⌺(2 2⍴2 2)⊢4 4⍴⍳16
┌─────┬─────┐
│1 2  │3 4  │
│5 6  │7 8  │
├─────┼─────┤
│ 9 10│11 12│
│13 14│15 16│
└─────┴─────┘
oh
Didn't try that :)
Will it do 3x3?
09:57
Yes, but it'll be offset, so you'll have to pad and chop:
      1 1↓⊂⍤⊢⌺(2 2⍴3 3)⊢0⍪0⍪0,0,6 6⍴⍳36
┌────────┬────────┐
│ 1  2  3│ 4  5  6│
│ 7  8  9│10 11 12│
│13 14 15│16 17 18│
├────────┼────────┤
│19 20 21│22 23 24│
│25 26 27│28 29 30│
│31 32 33│34 35 36│
└────────┴────────┘
Wow. Is that 18.0?
Yes, for .
I should really upgrade.
@xpqz Sure, but with pre-18.0 you simply replace ⊂⍤⊢ with ⊢∘⊂
If you don't mind using 4D intermediate array, you can adapt this code golf answer of mine.
Using axis enclose ⊂[2 4] in place of double reduction, you can achieve the partitioning itself.
10:01
      SubMat←{↑(⊢/⊆⍺)⊂¨(⊃⊆⍺)⊂[1]⍵}
      Mask←⊢∘≢⍴1↑⍨⊣
      3(Mask SubMat⊢)6 6⍴⍳36
┌────────┬────────┐
│ 1  2  3│ 4  5  6│
│ 7  8  9│10 11 12│
│13 14 15│16 17 18│
├────────┼────────┤
│19 20 21│22 23 24│
│25 26 27│28 29 30│
│31 32 33│34 35 36│
└────────┴────────┘
Lots to think about. Thank you both.
10:19
Kind-of general solution - works with (≢⍺)=≢⍴⍵ or 1=≢⍺
10:29
@xpqz Remember this?
4
A: How do I convert a vector of triplets to a 3xnx3 matrix in Dyalog APL?

ab5tract Solution 1 0 2 ⍉ (9÷⍨≢data) 3 3 ⍴ data Explanation By using ⍳45 as placeholder data, we can see what is intended: data ← ⍳45 a←m[;0 1 2] b←m[;3 4 5] c←m[;6 7 8] d←↑a b c d 0 1 2 9 10 11 18 19 20 27 28 29 36 37 38 3 4 5 12 13 14 21 22 23 30 31 32 39 40...

      ⊂⍤2⊢1 3 2 4⍉2 3 2 3⍴6 6⍴⍳36
┌────────┬────────┐
│ 1  2  3│ 4  5  6│
│ 7  8  9│10 11 12│
│13 14 15│16 17 18│
├────────┼────────┤
│19 20 21│22 23 24│
│25 26 27│28 29 30│
│31 32 33│34 35 36│
└────────┴────────┘
10:44
I did wonder if there was such a way...
@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?).
For my actual problem I don't need the enclose (I think).
Right, I figured, and then you save yourself from the cursed nested arrays.
Intriguing how many diverse ways of achieving this there is.
11:16
@Adám Thanks!
11:42
BQN has a good way to partition matrices as well.
12:32
CMC: Given an array, split all high-rank parts until the maximum rank anywhere is 1.
E.g. (2 2⍴⊂2 2⍴1 2 3 4) (2 2 2⍴2) (3 1⍴1 2 3)
becomes (2⍴⊂2⍴⊂(1 2) (3 4)) (2⍴⊂2⍴⊂2 2) ((,1) (,2) (,3))
@Adám what should it do with ⊂⊂,1?
@dzaima Good question. Don't worry about that. The rank of a non-simple enclosure is 0, but you can assume there won't be any.
(so don't have to worry about this ಠ_ಠ)
can't think of much other than the 22 bytes recursively, Dyalog
BQN (header conditionals only), 45
..oor actually 27 due to me still counting as chars in UTF-16
BQN ( conditionals), 21
13:07
@dzaima Care to show?
@dzaima 26
@Adám Dyalog, 22
@dzaima Can I use in webinar?
@Adám sure?
(something about ⎕JSON?)
Yeah. Next week.
@dzaima also 21 in dzaima+reference (with positive depth).
13:23
(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
Nic
Nic
@Marshall github.com/mlochbaum/BQN/tree/master/doc : is that all there is about BQN ? No reference ?
(it's orig.getClass().getName()+": "+orig.getMessage() failing when wrapping the StackOverflowError in an ImplementationError)
13:35
@Nic there are other useful files/folders in the repo, but not much outside of it
Nic
Nic
lovely thanks
@Nic /spec has most of a specification, but it tends to assume you already know BQN.
Another question I found while working with the reference implementation: what should ><2 be? Think very carefully...
Nic
Nic
What's the mnemonics for W being left argument and X being right argument ?
@Nic x is the normal right argument like in f(x), and w is the letter to the immediate left of x in the alphabet.
@Marshall that's the kind of issue floating arrays solve
(should >2 (or ⊑2) error or give 2?)
13:39
Suggested BQN logo: 🥓︎
/me snickers
YES THATS PERFECT
@Adám with whatever fonts i have + emoji killer that's pretty much unrecognizable :p
@dzaima How does it look by you?
Most platforms show that as two parallel strips, each one having stripes, which is symbolises the highrank+nested nature of BQN.
13:43
@dzaima With >2 it doesn't really matter. I say ⊑2 should error. But I also claim ><2 is the more interesting question.
@dzaima Nah, looks fine to me.
@Adám ... Or, it looks like a couple of strips of bacon...
@Marshall well, without floating arrays you already lose many cool identities, so imo going with whatever feels best is acceptable
🥓︎>🍏︎?
@Adám - Not a fan of Apple's walled garden...
13:47
@JeffZeitlin Apple's logo is missing a bite.
@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.
@Marshall yeah, was about to post this
easy solution: error :P
@dzaima Meaning Match with rank is banned, unless you want Rank to do something other than Unbox with its results.
@Adám - Also true...
@dzaima (might be the most sane thing to do, but again, not the most useful..)
(also, should even 2‿2⥊2 be allowed?)
Nic
Nic
13:55
@Marshall why BQN and not BQM ?
Jun 25 at 0:35, by Marshall
@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.
@Marshall kind of one-way floating arrays
@Nic I would like to raise the point that come on, the character with one hump should obviously come before the one with two of them.
@Marshall Heh, when I was very little, it also bothered me that N didn't come before M. KLNMOP makes much more sense than KLMNOP.
14:02
what would the alphabet be if sorted by stroke length? :p
Not by number of hard corners? I L N M
@Adám that would have a lot of collisions
@dzaima vtc as unclear.
@Adám agreed
@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.
@dzaima Isn't that how Chinese is sorted?
14:05
@Marshall huh.
@Marshall No, number of strokes, iirc.
@Adám Yes, stroke Length ().
(Okay I did misread what dzaima wrote)
14:23
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...)
@AviF.S. Like this:
      1 0 0 1 1 ⊃⍤⍴¨ 'ABCDE'
A  DE
@Adám Of course. That's why I'm not sure it's very useful
Although a fair few primitives can be implemented trivially, which is why it seems more an issue of how often it'd come up
The classic method is:
      1 0 0 1 1{⍺\⍺/⍵}'ABCDE'
A  DE
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 That one's nice!
@AviF.S. With dashes:
      1 0 0 1 1 (⊃⍴,'-'⍨)¨ 'ABCDE'
A--DE
@Nic Ready to begin?
Nic
Nic
14:31
Yup
Well, welcome to APL Cultivation.
Nic is going to continue the previous lesson on simple plotting.
@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
Nic
Nic
So to set up your environment for charting, do:
'InitCauseway' 'View' ⎕CY 'sharpplot' ⋄ InitCauseway ⍬
Then you can start plotting by doing something along the lines of :
sp←⎕NEW Causeway.SharpPlot
sp.DrawLineGraph ⊂1 3 2 5 4
View sp
Don't forget backticks or Ctrl+K for monospace.
Nic
Nic
you should get something along the lines of
https://i.imgur.com/Blo0VAS.png
14:40
Yup. Works for me.
RGS
RGS
@Nic VALUE ERROR: Undefined name: Causeway? is this something that was troubleshot during last time? Can I use 18.0 for this?
Nic
Nic
@RGS Yes, there is a bug on Windows that we discovered last time =(
You have to de-localise ⎕USING in the InitCauseway function that you brought in
Unfortunately the bug was discovered after the 18.0 release
RGS
RGS
works now, thanks
Nic
Nic
Now's the time to ask questions.
I guess the interesting bit is how to embed charts in <whatever you're trying to do>
We might also discuss which chart type is appropriate for which data (if you have data to submit)
RGS
RGS
@Nic is this sharpplot-specific? or is it the general principles of data visualization you are talking about? or what do you mean?
Nic
Nic
14:48
This is more general, hence less appropriate for this chat room. But if there are no other questions, let's do it !
RGS
RGS
I have one question
is there a nice utility function to save my graph without having to View it first?
Nic
Nic
SharpPlot is greatly influenced by Tufte's recommendations ( en.wikipedia.org/wiki/Edward_Tufte )
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
RGS
RGS
afaiac you can move on to discussing other things, not sure if you were waiting for me @Nic ..? The functions you mentioned worked, ofc
Nic
Nic
I don't have a story to tell. If I wanted to provide general guidelines about chart that would be a webinar.
Do you have no questions ?
I can also show a little function I wrote to plot the Covid data from a live data feed
RGS
RGS
@Nic I guess that'd be nice
Nic
Nic
15:04
{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

⎕SE.SALT.Load'HttpCommand'
csv←(HttpCommand.Get'https://covid.ourworldindata.org/data/owid-covid-data.csv').Data
csv←⎕CSV csv'S'
fields←csv[1;] ⋄ csv←1↓csv
txtfields←'iso_code' 'continent' 'location' 'date' 'tests_units'
date←csv[;fields⍳⊂'date']
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
You should get something like that :
Nic
Nic
15:25
I you want an overview of SharpPlot and of the available chart types, you can also look at :
https://dyalog.tv/Dyalog13/?v=Xo3vRQMaPxo
And for the documentation : sharpplot.com
RGS
RGS
@Nic Thanks for the links ○/
Nic
Nic
The amount of questions makes me think that we're done with charting aren't we ?
@Nic Or people are just busy. How about some simple examples of combining options?
Nic
Nic
Simple examples for each chart type : sharpplot.com/Charts.htm
If you don't have "real" questions, you might as well the browse the doc
RGS
RGS
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?
Nic
Nic
15:29
It's a typo =)
Actually it's only half a typo because VML has been abandoned by Microsoft decades ago and now has no support whatsoever
I'm a little confused about the date handling. Do we have to convert to a serial number to get proper spacing?
Nic
Nic
@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 )
RGS
RGS
(@Nic I wish I had a/some good question/s but nothing other than "how do I configure ___" comes to mind :/ )
Nic
Nic
@RGS Sure. All the suffering in the charting industry comes from the vast world of possible configurations.
@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.
RGS
RGS
15:36
@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?
Nic
Nic
@Adám I don't get it. Can you show me a repro ?
@Nic How do I plot a line graph of:
  dates←(2020 1 1)(2020 1 31)(2020 2 1)
  values←3 1 4
Nic
Nic
Adam;Causeway;System;dates;sp;values
dates←(2020 1 1)(2020 1 31)(2020 2 1)
values←3 1 4

dates←1+{2 ⎕NQ'.' 'DateToIDN'⍵}¨dates ⍝ 1+ because microsoft invented 1900-02-29

'InitCauseway' 'View'⎕CY'sharpplot'
InitCauseway ⍬
sp←⎕NEW Causeway.SharpPlot
sp.XAxisStyle←Causeway.XAxisStyles.Date
sp.XDateFormat←'dd-MMM-yy'
sp.DrawLineGraph values dates

View sp
RGS
RGS
@Nic thanks!
Nic
Nic
@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
15:43
@Nic OK, then the answer is "Yes", we do need to convert to a serial number. However dates←33 ⎕DT dates is much easier now :-)
Or golf it: dates⎕DT⍨←33
Nic
Nic
@Adám Ah I get it now. it's "serial number" that I didn't undersrtand.
in .Net you can also use System.DateTime.ToOADate
https://docs.microsoft.com/en-us/dotnet/api/system.datetime.tooadate?view=netcore-3.1
RGS
RGS
@Nic interesting
Nic
Nic
which, again, is 1+International Day Number
RGS
RGS
Why doesn't it work after the DrawLineGraph?
Nic
Nic
@RGS That's because SharpPlot is fundamentally a state machine. Its philosophy is that of PostScript. 1. Set up paramaters 2. draw 3. back to step 1
It's not possible to "undo" something
It may appear old-fashioned in the days of OO API, but it's in fact VERY powerful.
15:47
@Nic Yeah, that's what 33 means.
Nic
Nic
Have a look at sharpplot.com/Multiplots.htm to see how powerful state machines can be.
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
Shall we call it a day ?
Yeah, I think so. Thank you so much, Nic!
Any ideas for the next lesson?
Nic
Nic
You're welcome. If you need any more help with charting, don't hesitate to ask : nicolas at dyalog dot com
Maybe there should be some kind of vote system for people to chose topics that matter to them ?
I don't have a good idea. When I look at the list of previous lessons it sounds pretty complete
There are usually not so many ideas that voting even makes sense.
Nic
Nic
ok
15:56
@Nic Yeah, well, maybe we have indeed covered most of the language. We're talking almost 70 hours of action!
Nic
Nic
Yup. Congratulations for keeping it alive !
I have to run now.
Cheers !
○/
RGS
RGS
16:11
Thanks for your time @Nic
@Adám are there any suggestions for future APL Cultivations or is the whiteboard empty?
Thought this might be of interest to the community -- AVX style matrix processing will arrive in Intel chips soon: fuse.wikichip.org/news/3600/…
Wish it were an announcement from AMD, but still..
 
2 hours later…
17:51
@RGS @Adám I think we'd mentioned something on thinking tacitly. But it was between this and a webinar/s. Did we decide on a medium?
@AviF.S. I think we decided webinar is better, so one can do a voice-over while typing.
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!
@AviF.S. Yeah, that'd come in whenever it fits in such a setting.
@Adám 'Course! It'd fit esp. well with the tacit, methinks
@Adám Ah, also what about the different array models?
@AviF.S. Not really an interactive lesson, is it? APL Wiki?
18:02
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?
Or just try harder to understand it? :p
@AviF.S. Maybe if you explain on the talk page what's difficult to understand, others can see what needs embellishment.
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. All of those are how to do stuff. The array theory is just… theory.
@AviF.S. Brainstorming for subjects is fine. I appreciate that.
@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
@dzaima Based≠boxed, no?
18:10
@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 Marshalls BQN page says based array model/theory
@dzaima Thanks! After I get some sleep, will give it all another go
RGS
RGS
@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
isn't there a nice category here to be explored?
@RGS Which one?
@RGS Ah, sets?!
18:23
@RGS Suggestions?
@Marshall Is the BQN array model the same as J's?
@Adám No, J is flat with boxes.
@Marshall (I did know that, btw.) Care to explain the difference?
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 Then a numeric array like 42 43 has no equivalent in BQN. And catenate can return such an array, so it's very different.
18:33
@Marshall APL can't represent J's (<<1),(<1) and J cannot represent APL's 'a'1 but BQN can represent both?
@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.
@Marshall I'm pretty sure that's the same thing using other words.
@Marshall how about this: is there any significant difference between BQN's and J's models that'd warrant ><1 behaving differently between the two?
"Based" is like "nested" plus enclosed scalars. "Based" is like boxed plus heterogeneous arrays.
@dzaima Yes, 1 cannot be accessed directly in J.
@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.
18:39
@Marshall what does "cannot be accessed" mean? i'd understand it with floating arrays, but in J 1 is not equal to <1 so there is a concrete 1
@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.
@dzaima You can access a scalar array containing 1. You can't access 1 itself in the same sense as BQN.
@Marshall I still fail to understand how that's not just what you call it.
@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.
@Marshall is 1 always secretly and unnoticeably exactly one level of enclosed or something?
18:42
@Marshall Oh, of course you can't model "based" in "nested" or "boxed", but boxed can model both of the others. It is the superset of the two.
@Marshall afaict "nested" in Adám's message doesn't imply "floating"
@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.
@Marshall That's why I started by stating in the negative.
Let me try again…
@dzaima That's what I meant, though.
@Adám ah. floating arrays definitely cannot be converted (as in upgraded with backwards compatibility) to BQNs/Js models
"Based" is "nested" without auto-disclosing enclosed simple scalars. "Based" is "boxed" without prohibiting heterogeneous arrays.
@dzaima Backwards compatibility?
18:45
@dzaima Well, you could simulate it by adding a length-1 axis to the end of every array.
@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
@dzaima That statement makes no sense to me.
@Adám do you consider the based array model as a superset of the floating array model?
@Adám But calling them "simple scalars" when they're no longer arrays is a bit silly.
@Marshall I prefer calling them ronkonorongonöfs. Same difference.
@dzaima That's my current mental model. Maybe mistaken, though.
18:49
@Adám any superset of the floating array model must keep the property 1≡⊂1, otherwise it is not a superset. A based array model has 1≢⊂1
@dzaima I disagree.
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 ah, the arrays themselves may be supersets. The whole model, though, is not
@dzaima I don't even see how one can speak of an array model as a set other than as a set of all the arrays it can represent.
@Adám i didn't bother to think of what word to better use instead of "superset"
@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.
18:56
@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?
how about this: is there any J array that cannot be converted to BQN in the sane, obvious way losslessly?
@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.
@Marshall Again, just what you say. There's no observable difference.
@dzaima I don't think so, assuming the "sane, obvious way" is the one that maps depth-0 (numeric or character) J arrays to depth-1 BQN arrays.
18:59
@Marshall I'm not sure what you mean by "The element operation".
@Marshall What? Why not map depth-0 (numeric or character) J arrays to BQN non-arrays?
@Marshall my sane, obvious way would convert a depth 0 1 to a 1 in BQN
@dzaima +←1
RGS
RGS
@Adám there's an "advanced use of ⍤"; would it make sense to have an advanced use of ⍥ (and perhaps ⍨ as the constant op)?
@dzaima In that case, the array 1 2, which has J depth (L.) 0, can't be converted to BQN. BQN's 1‿2 would correspond to 1;2.
@RGS The "advanced use of " is Rank, not Atop. doesn't have the Depth meaning in Dyalog APL (yet).
RGS
RGS
19:03
@Adám Data conversion, index generation, sets, structural... isn't there anything nice to explore here?
@Adám ah ok -.-
@Marshall ah. so the depth of 1 and 1 2 is the same?
@RGS oh, hey, we now have new built-ins in 18.0. I never gave lessons on those!
@dzaima In J, yes.
RGS
RGS
@RGS maybe exploring the speed ups you get by fixing the arguments to functions like ⍳ and ∊
@Adám true, you mean things like ⎕C and ⎕DT?
@dzaima Yes, in the flat array model a numeric scalar is just a kind of numeric array.
@Marshall But that's just a definition of L.. If J had APL's then the array could be converted‽
@Marshall Oh, maybe I understand now. BQN doesn't allow concatenation of simple scalars non-arrays? You have to box them first?
19:07
@Adám Yes, then J 1 would correspond to BQN <1 and BQN 1 doesn't correspond to any J value.
@Adám i suppose it's the same kind of ideological difference here that's between floating and based array theories
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.
@Adám I don't know what happens first, but the result of catenate is an array, so if the arguments aren't arrays, somehow they become elements.
Incidentally, you can't actually catenate scalars, only laminate them.
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.
@Adám i like to think about it in terms of fds
@Adám related: depth is a stupid, meaningless thing with floating arrays
19:15
@dzaima Darn useful, though.
@Adám that's unfortunately not good enough for a thing to make sense
@Marshall that would be if L. was 1+≡, no?
@dzaima That's right.
if L. was exactly , couldn't a J 1 equal to a BQN 1, <1 equal <1, 1‿2 equal 1 2 etc?
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).
(alternate question: is there any other way than L. that J exposes that <1 is more like <1 2 than 1 2?)
19:20
Just watch out for my upcoming DSR language…
@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).
@Marshall Please forgive me if you're offended.
teleports an apple into my hand
@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
19:28
@Adám 'A'(⊣+26|((↕26)×⌜1‿1‿2)+⎉1-˜)⌾•UCS"APL"
PEP is taken, more or less. LAH sounds like fun.
@dzaima (keeps J behavior is the keyword; the idea behind it would definitely be wildly different)
@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.
@dzaima What's the depth of <1? Is (<1),(<2) the same as 1 2?
@Marshall ah, (<1),(<2) answers this; didn't know that
19:39
In J, 1 matches ($0)$1 2, but in BQN, ⟨⟩⥊1‿2 is <1 instead. So that's a pretty big difference.
@Marshall okay yep J's model is significantly different from BQN's
(that said, i like BQNs model much more)

« first day (1252 days earlier)      last day (1621 days later) »