5:19 AM
@RGS Thanks for mentioning me :-)
The swedish letter in my name makes it difficult to type of course, so please go ahead and use whatever variation is convenient :-)

<klg> nonsense! it's a␈°! ;)

Common Lisp has the most complete numeric tower of any language (with the possible exception of Maxima, which builds on CL).

5:43 AM
good morning gamers

@EliasMårtenson and phantomics: NARS2000 is pretty advanced too (doesn't do symbolic manipulation, though), including rationals, various forms of complex numbers (including quaternions and octonions), multi-, arbitrary and infinite precision, and ball arithmetic. E.g.:
```      3±4j9±5×⍳4
3±4j9±5 6±8j18±10 9±12j27±15 12±16j36±20
3r4J9r5×⍳4
3r4J9r5 3r2J18r5 9r4J27r5 3J36r5```

I've been playing with Factor recently, and it supports rationals/complex/complex rationals and implicit best-effort conversions too.

@Adám That's interesting. I didn't know that.

(Maybe it could be interesting to implement an APL in a concatenative language?)

It's rare to see in languages which are not squarely focused on maths.

6:03 AM
<phantomics> Elias Mårtenson: CL also has native support for all the array types you need for implementing APL, and so I can easily pass data into and out of April invocations within a CL program
<phantomics> The main difference between CL arrays and APL arrays is that in an APL array, all elements must be scalar so any nested array must be enclosed in a 0-rank array.

KAP needs a page on APL Wiki.
phantomics: Sounds like CL and BQN match well.

<phantomics> You can have an n-dimensional array directly inside another array in CL, in April I just enforce the enclosure of all nested arrays
<phantomics> Yeah, similar array models
<phantomics> In languages without native n-dimensional arrays, you couldn't use an APL implementation inside of the main language as easily
<moon-child> why not? Assuming you can implement them in-userspace and have easy conversions from native arrays
<moon-child> e.g. numpy, mir ndslice

@Adám Yeah, my intention was to write one once I have created a web site I can link to.
I have two primary personal projects, with KAP being one of them. For the last week I've been doing work on the other one (Climaxima), and I'll return to finishing the core functions in KAP once I'm done with the current task.
Having two projects to alternate between helps with dealing with the tedious parts.

@EliasMårtenson There's no reason to wait for that. ngn/apl, dzaima/APL, and April don't have websites either.

Fair enough.
Is the wiki editable by all?
I have to leave the office for a little while, need to go down for a late lunch. I'm starving :-)

6:23 AM
@EliasMårtenson Yes it is.

6:42 AM
There. Back.

7:22 AM
@Adám When going to the pain aplwiki page and clicking on "running", you're being sent to aplwiki.com/wiki/Running_APL
There doesn't seem to be a link to the other page that contains derivatives.

@EliasMårtenson You mean the template?

Yeah, that one.
I mean, a visitor that comes to the wiki should be able to get to a page mentioning BQN with a single click, no?

The template is included on the page linked from the main page as Language overview.
Hm, glyphs should be on that ensemble page too…
Is KAP an APL proper or only a derivative?

7:49 AM
@Adám From the web version and graphics demo, yes it functions like APL proper

@Adám I'd place it in the same category as dzaima/APL, so proper i guess

That's what I thought too. So I've rolled back APL Wiki to only place KAP there.

8:29 AM
@Razetime Well, it's intentionally not "an implementation of APL". In other words, if something APL does is incompatible with the KAP goals, then it will not be compatible with APL.
For example, the evaluation order for the \ operator is intentionally opposite that of APL.
But yeah, when compatibility is possible, it is compatible. So I guess @Adám has to decide whether that makes it a derivative or not. :-)

@EliasMårtenson dzaima/APL does that too, but I also explicitly don't go for compatibility where it makes sense, so if anything, KAP is a more "proper" APL than mine

@dzaima I guess at the end of the day it's not a binary thing. It's a multi-dimensional scale, so it's always going to be a matter of opinion.

4 hours later…
12:41 PM
@Adám Just realized that tryapl.org has changed a bit compared to the last time I visited it. Easier for me to select APL symbols. Cool, I am going to use it tomorrow to mention and show APL a few minutes in a talk for non-engineering students when I will discuss computational thinking and the fun of recreational programming. APL is great to learn but hardly known here in TW universities especially in non-CS / non-MATHS departments.

12:59 PM
@EliasMårtenson I don't think KAP is using the based array model because it has `5≡⊂5`. To me it just looks like the nested/floating model, although there's some strange behavior like `⍬⍴,5` giving an enclosed 5 and `5≢(,5)[0]` (but `5≡⊂(,5)[0]`!).

@Marshall I don't think he ever claimed that.
@brgal Great to hear. If there are things we can do to improve it further, just let us know.

Oh.

1:30 PM
@EliasMårtenson I knew you had a glyph on top of the first vowel after the M, but I thought it was Mo- and not Ma-, sorry for that. "Martenson" is a reasonable variant, no? "Mortensen" is just butchering your name, I apologise for that.

@RGS Yeah, either that or "Maartenson" since that is a historical/etymological spelling. However, it is actually pronounced "Mortensen" :-)

2:24 PM
What's the difference between dfns.nats and dfns.big

Wild guess here, but "nats" looks like it stands for "naturals", which are the positive whole numbers.
"big" is just an adjective for size, so negative and fractional numbers might be involved, whereas I wouldn't expect them to be for dfns.nats

```[nats] is similar to operator →big← except that it:

- deals only in non-negative numbers,
- accepts only dyadic operand functions,
- is quicker for large numbers.```

dfns.big is just integers too
Ah thanks
It has * which big doesn't

Note that now there's also Roger Hui's "Q"

I'm appalled that dfns.nats deals with 0 as well :P

2:32 PM
```big:    +-<=> |×÷  ≠≤≥
nats:  *+-<=> |×÷∧∨≠≤≥ ⌈⌊
Q:    !*+-<=>?|×÷∧∨≠≤≥⊤⌈⌊⌹⍕```

Looking back through old code, found this `(⌈/⍳⍨⊢)`, ouch

You'll have to enlighten me... `(⌈/⍳⍨⊢) v` is looking for the position of the maximum of `v` in `v`, right? What would you write now?

(⊃⍒)

Nice :D

@rak1507 and even if not that, `(⊢⍳⌈/)`

2:37 PM
Is it faster, though?

I should've looked in aplcart
@dzaima yeah
@RGS it's an idiom so yeah I think so

Ah if it is an idiom, then sure.
@dzaima There's that as well aha

I don't think it is an idiom, but the atop (only!) is optimised.

↑ yep, comparison

Hm, `⊃∘⍒` might actually be worth optimising. What if I want the second-largest?

3:15 PM

@RGS Sure, but that's slow.

Also, is it O(n log n)? And for a generic "give me the kth largest", what would you expect?

@RGS Oh, no I was saying that `⊃∘⍒` would be the one to optimise for that.
@RGS It should be O(n) for floats and arbitrary arrays (simply traverse and remember the value and index of the greatest so far) but less than that for integers, because if we hit the maximum value that can be held by the type, we're done.

The generic unoptimised ⊃⍒I expect to be O(n log n) and the best case for "find the index of the largest" to be O(n).
But I wonder what to expect for the best solution to "find the index of the kth largest"

@RGS Traverse and remember the k largest so far.

3:28 PM
@Adám sure, but what is the cost of "remember the kth so far"?

The remembering is basically nothing. Problem is having to compare every value to the current k largest as we traverse. So I guess it is whatever complexity ⍒ has, but based on k instead of on n.

@RGS i think it should be O(n log k) but of course big O is useless in practice

@ngn of course, the O(log k) to use binary search to insert in the smaller vector and the O(n) to traverse the list, makes sense

3:46 PM
@RGS Yes, @Adám is right. That said, the o isn't quite pronounced as English e. Swedish has a lot more vowels than English, so no need to worry about it :-)

2 hours later…
5:25 PM
@RGS Quickselect with median-of-medians pivot selection is O(n). There's a lot of more recent research on improving the constant factor as well.

Thanks for the reference @Marshall, I didn't know about quickselect