« first day (1499 days earlier)      last day (1156 days later) » 

8:14 AM
@Bubbler Let's compromise at 0.5J0.5
 
Lol
 
@EliasMårtenson Well, the reasonable non-NaN choices are 0, 1, and ∞, so shouldn't it be an average of those three?
 
@Adám Which is obviously ⌊/⍬ :P
 
@Adám I mean, clearly we now need to implement support for Hyperreals in APL
Then the correct value is obviously somewhere between ε and ω.
Or how about ε+i×ω. That'll make everybody happy.
Complex hyperreals. That's the first time I've mentioned those in actual conversation.
 
Imagine suddenly all the s are interpreted as ordinal and ⍵⍵s are interpreted as ⍵*⍵
 
8:25 AM
@Bubbler To be fair, is there a system (a CAS, probably, as numerical methods won't work) that support hyperreals?
 
Idk. WolframAlpha seems to interpret \omega as complex numbers by default
 
I like hyperreals. They make my intuition around derivatives and limits feel more natural than the handwavy explanation you get without them.
 
9:04 AM
Regarding the question of whether important users rely on dyadic grade: Yes they do, but typically in ONE cover-function - not littered throughout the code, so I don't think this would be a seriously breaking change.
IMHO dyadic grade is a nasty wart on the language, the functionality belongs in a library function (system function), not in a primitive. There are so many different ways to do "real" collation and it only supports a few of them.
@Razetime Undefined in APL: DOMAIN error if a final decision has been made, NONCE error if we're still arguing about it.
 
9:28 AM
@MortenKromberg I'd remove the word "final" in that explanation. If a decision has been made (e.g. to not support complex numbers), sure, but such a decision may be reconsidered later (e.g. adding complex number support).
 
9:44 AM
@Adám If you like. Never use words like final (or never) :-). Replacing DOMAIN ERROR with new behaviour is a time-honoured tradition.
John Scholes was on a mission to also replace all SYNTAX ERRORs with behaviour :D
 
And then we went ahead and removed a b∘.←3 4 !!!
 
@Adám What does that do?
 
10:00 AM
@EliasMårtenson You mean, what did it do? 2 2⍴⌽(b←4)(b←3)(a←4)(a←3) (but shyly)
 
Multiple assignments to a and b? I guess that would be useful in the case of assignment to ⎕, but is that form really useful?
 
@Adám what in the world
 
@Adám Also what do you mean by shyly?
 
it means it won't return a value unless it has to
 
@Razetime You mean it won't print it? Like what monadic ⊢ does in GNU APL?
 
10:07 AM
it won't print it yeah
but it can still be used as a value in an expression
 
@EliasMårtenson No, that it doesn't print by default, but if you use the value in further computation, it is there.
Like 1+a←3 prints 4 even though a←3 prints nothing.
 
@Adám Right. GNU APL uses monadic ⊢ for this purpose. Quite useful, and I thought Dyalog did too. Apparently it doesn't.
 
you mean like ⊢a←3?
 
@Razetime No. Assignment is always shy.
 
@EliasMårtenson No, GNU APL has return a shy 0.
APLX has return a non-shy 0 0⍴0
 
10:10 AM
@Adám I don't have GNU APL on this machine (need to reinstall it), but I'm pretty sure that ⊢foo returns foo but doesn't print it.
At least it used to.
 
I understand APLX's design, as 0 0⍴0 traditionally doesn't show up, and then they avoid the concept of shy functions (other than assignments), but GNU APL's shy function that returns something else is just odd.
@EliasMårtenson Surely not as that is just identity. And returns 0 shyly as can be seen if you enter ⊣10 ⋄ 0≡⊣10 into try-GNU-APL.
 
OK, ⊣. But I'm sure it at least used to behave that way.
 
It would be vary strange to change the behaviour from shying to returning a shy 0.
 
Yes. If it changed, it must have been discussed on the mailing list.
 
> In earlier GNU APL versions, ⊣B and ⊢B would both return B; with ⊣ as committed value and with ⊢ as non-committed value. But since the only real-life purpose of ⊣ is to suppress the printing of B, the implementation of ⊣ was changed to returning an committed integer scalar 0 instead of committed B. That reduced the run-time of ⊣B from O(,B) to O(1). Also, ⊢B is marginally faster than ⎕←B.
"committed"=shy
 
10:19 AM
Ah, so it was changed.
 
I think it was a bad decision.
When debugging, it is often helpful to temporarily insert ⎕←s into the code.
Say you have a line that reads ⊣some code and you want to temporarily inspect the value. ⎕←⊣some code now prints 0!
Sure, you can temporarily remove but one of the nice things about using ⎕← instead of implicit printing (optionally coerced with ) is that it is easy to search for, and thus easier to prevent leaving in production code by mistake.
 
Yeah, you'd have to remember to do ⊣⎕←somecode
 
@EliasMårtenson Yes, but then you can't regex for ^\s+⎕←
Also, I don't understand why returning B would be O(≢,B). Does that mean that is O(≢,B) too‽
Wouldn't it just point at B's memory location?
 
@Adám GNU APL is quite simplistic in that it always copies the arrays when calling a function.
 
Ugh.
 
10:27 AM
I implemented a proof-of-concept CoW implementation for GNU APL that kinda worked and gave a significant speedup in many cases.
However, it failed in others, and fixing it was hard.
 
CMC: Given an array, print it to STDERR () twice.
 
@EliasMårtenson I assume it also copies on assignment & reading of variables, so it doesn't need to refcount?
 
@dzaima Yes.
Wait no... Hang on.
There is a refcount. I can't remember. Let me check.
It's been years since I last worked on the code. And I see things have changed.
OK, now I think I understand.
There is indeed a refcounter, but it's used to track references within the C++ code. There are explicit calls to the clone method to make copies of the values when needed.
And you can check the code, there are a lot of clone calls.
Let's check the assignment code.
 
@EliasMårtenson i assume it was just spammed everywhere until bugs disappeared? because otherwise i don't see literally any reason for function args to be copied
@dzaima i guess it makes sense if it always in-place modify instead of using refcounts for that
 
10:44 AM
I haven't checked function args yet. But assignments to variables perform a clone
But as far as I remember, function args are cloned
Yes, it always assumes it can in-place modify. This was where my CoW implementation ground to a halt, because this assumption is everywhere.
That's one of the reasons I decided to not support indexed assignment in Kap. I absolutely did not want to ever have to copy an array.
 
@EliasMårtenson oh, you also don't have modified assignment. So no a,←1 either
 
@dzaima Correct. i don't jave that, and I have to admit I don't know what it does.
I have never seen it :-)
 
@EliasMårtenson it appends a 1 to the vector a. Just as there's a+= 5; in Java, there's a+←5 in APL, but for any arbitrary function
 
(except named ones in dfns)
 
@EliasMårtenson I even added special mostly-otherwise-broken syntax for indexed assignment, full-knowing that it's an O(n) operation :)
 
10:50 AM
Oh I see. So is it identical in behaviour to a←1,a
 
@EliasMårtenson well, a←a,1
well, except that, in dfns, the assignment is done in the original scope of a, not the current one
so a←4⋄{a←a+5}0⋄a is 4 while a←4⋄{a+←5}0⋄a is 9
 
OK, and no. That doesn't exist. In Kap you'd have to make a choice between O(n) in space and time. Or, you could not collapse the result which makes it O(1) in space and time, but once you do many of them, you'll stack a lot of lazy values on top of eachother.
By default, Kap does a collapse when you assign using ←, so in practice the default behaviour would be O(n).
 
@EliasMårtenson right, indeed it would be. Didn't stop me from implementing it. O(n^2) is somewhat better than O(impossible)
 
@dzaima Oh, wow. OK. So arrays aren't immutable? I watched the Dyalog presentation at Google, and Morten said arrays were immutable?
 
@EliasMårtenson arrays are immutable, but variables are not. It's in the name :)
 
10:56 AM
@dzaima OK. I was under the impression that this would modify A: A←1 2 3 4 ⋄ 99 {⍵[2]←⍺} A ⋄ A
Turns out Dyalog gives me a syntax error there.
 
@EliasMårtenson {⍵←⍺}A doesn't work either, for the same reason
you must always assign to proper variables (or funky quads or whatever)
this is the behavior I meant
 
Sorry. I misread.
 
Announcement: A central place to say you want an APL job and to advertise open APL positions: apl.wiki/Job_listings
3
 
12:01 PM
@Adám … and the first listing is in.
 
RGS
Shouldn't the page be split in "needs" and "has"?
Otherwise everything will get intertwined and will be harder to look for whatever you want (offer services or hire services)
And then you'd have a "add listing to offer services" and "add listing to look for services", instead of a single "add listing"..?
 
lol time to quickly learn swedish
 
@EliasMårtenson "immutable" feels like really bad terminology in relation to APL, I still remember my shock when I learned that apparently, computer scientists call our arrays "immutable". I think I prefer to say that arrays are value types, rather than reference types, which I think is the same distinction(?). Namespace references are different in Dyalog APL, and considered to be "voodoo" by a large fraction of APL users.
@rak1507 As I understand it, the Swedish requirement in this job has to do with dealing with the customers and understanding legislation, etc - the "domain" side of the job. I think the organisation itself is actually an international corporation which uses English for internal communications :D.
 
@RGS It is already a bit of a hack as it is. I don't know how to twist MediaWiki that far.
@user41805 Do you know Swedish by now?
 
RGS
@Adám Then maybe two pages acting as sub-pages to this one?
 
12:36 PM
APL arrays are not immutable in the sense of Clojure or Erlang (IMHO).
 
@Adám I suspect you could get away with Norwegian and, if they eventually decide they are desperate, Danish.
 
@MortenKromberg That would be very desperate :)
 
@MortenKromberg Well, if the programmer just needs to understand some legalese, but doesn't actually have to express himself in Swedish, then yeah. I can suggest to them that they consider that. Even some Icelanders and Finnish Finns might do.
@RGS Maybe. Let's see how many listings we end up with. We can always split it later.
 
@Adám Finnish Finns as opposed to non-Finnish Finns?
 
12:53 PM
@rak1507 Yes, there are also Swedish Finns.
 
Oh, I didn't know that, weird
 
Similar to how there are French Canadians and English Canadians. The majority of Finns have Finnish as primary language, and the minority Swedish. So while Swedish Finns are more likely to know Finnish than vice versa, some Finnish Finns might know enough Swedish to pass.
 
Interesting
 
1:11 PM
Some Finnish-speaking Finns will deny being able to speak Swedish (Swedish is the language of the old colonial overlords), but if a job is at stake ... :D
 
Right, my father told me that they'd do that until he told them he was Danish, at which point they'd be happy to speak Swedish to him (Danish and Swedish being mutually intelligible, with some effort).
 
We did used to own them.
 
... with only the Russians probably being slightly more unpopular (the alternating colonial overlords arriving from the right on the map :))
 
@Adám Ah, I was just curious if APL could already do that, so one could design a DSL (as Bubbler pointed out)
 
@user You can override user-defined methods in an APL class in a fairly traditional way help.dyalog.com/18.0/#Language/Object%20Oriented%20Programming/…, but not primitives.
The project that @Adám referred to was a framework we referred to internally as "magic arrays", which would allow you to use a notation similar to our :Class notation to create array types with value semantics, where the internal representation and the implementation of primitive functions applied to arrays of that type would be implemented in user-defined APL code.
The main driver for this project was to allow the creation of sparse arrays with a variety of characteristics.
 
1:22 PM
@MortenKromberg That's really interesting
 
However, the main client for the project got distracted by other things and it was put on the back burner.
 
Oh, that's too bad
 
Yeah... I expect it will be back, some day
The "magic" terminology refers to the practice of implementing some primitives using APL code that is hidden inside the interpreter.
 
J has a notion of sparse arrays, hasn't it.
 
@xpqz Yup, seem to remember I paid for that project in a previous life, when I was the CTO of Adaytum, a BI application implemented in a combination of Dyalog APL and J...
 
1:39 PM
@MortenKromberg when one array language is not enough ...
 
The J component was added as a replacement for a C DLL, which carefully managed hypercubes outside the limited-size APL workspace.
 
1:59 PM
@nathanrogers @Bubbler I think the reason 1 is the only sensible result for the tally of a scalar is that in other cases the tally is always a divisor of the total number of elements. A scalar has 1 element, so the only divisor is 1 (0 isn't a divisor because 1=0×n has no integer solution). There are also a lot of cases where APL or BQN automatically converts a scalar to a list, such as scal↑arr, and it's useful to have tally give the effective length of the left argument in these cases.
The BQN terminology is that non-arrays (such as characters and numbers) are called "atoms", and an atom or array of rank 0 is called a "unit". An array of rank 0 is a "unit array".
 
2:13 PM
@user255568 Hi ariana grande. If you want to participate here, please email access@apl.chat
 
 
2 hours later…
3:51 PM
@Adám thanks for the ping, i'll send you an email
 
Sure.
 
4:34 PM
@Adám does ⊃ or ⌷ work on columns?
 
@nathanrogers Yes, though I can better help you if you tell me exactly what you want to do.
 
I want to select the second column from a 2d matrix
 
2⌷⍉ is probably the easiest method
 
@nathanrogers 2⌷⍤1 would work and be more performant than ^
 
ah yeah clever
 
5:36 PM
@Adám can I use ]load httpcommand in the code for a custom ]usercommand?
(no it would seem)
 
@xpqz ]load is just a convenient cover for ⎕SE.SALT.Load which is what you should use under program control.
 
@Adám when selecting a column, and performing a reduce, if the resuling shape of the selection is 0, I get a DOMAIN ERROR
'
 
can you post an example?
 
@nathanrogers If the function you're reducing with doesn't have a defined identity element, then it won't work. apl.wiki/Identity_element#Reduction_over_a_length-0_axis
 
0⍴⊂' ' for some reason this is the prototype
fn/result,(0≠≢result)/⊂''
something like this I'd imagine
{⍺ ⍵}/{⍵,(0≠≢⍵)/⊂''} that doesn't solve it... should I just use the empty string?
 
5:48 PM
Yes, by adding a single element, that'll become the result.
 
i got the selection wrong
{⍺ ⍵}/{⍵,(0=≢⍵)/''}result
DOMAIN ERROR
now the selection is right but I'm still getting domain error
 
another font query at an inconvenient time: which euro is best?
or propose a different one...
then afterwards, to keep on topic, we can have a golfing CMC to produce the chosen one :)
 
would have to see small versions in text to decide I think
 
6:05 PM
@Wezl Third one looks best, but it's hard to tell
 
3rd looks space invadery
i think the only one that reads like "euro" is the first one
but its too tall for my taste
 
@Adám ok - do I really have to give it an absolute path, or does Dyalog know where it is installed?
⎕SE.SALT.Load '/Applications/Dyalog-18.1.app/Contents/Resources/Dyalog/Library/Conga/HttpCommand.dyalog' ⍝ Eventually found it
 
here's a bit more context:
I may have to change that 7
 
@xpqz ⎕SE.SALT.Load'HttpCommand' should be enough.
 
O: I held down C-z too long because my font editor is a bloated web app and it did everything slow, but when I let go it kept going and deleted literally every change I'd made today
and it doesn't have redo
well, most changes, some it skipped over because they're not undoable
fortunately I'd saved recentlyish
 
6:21 PM
@Adám is there a way to ⎕← with boxing on?
 
@nathanrogers Yes, turn ]boxing on -fns=on
 
6:44 PM
why does 0 1 2⌽↓3 3⍴1 0 give a length error?
 
@Wezl it gives a rank error, and the behavior is equivalent to 0 1 2⌽1 2 3
 
sorry, I meant 0 1 2⌽↓3 3⍴1 0 0
 
@Wezl same thing
 
@Wezl takes as left argument, one scalar per vector in the right argument. A split matrix is a vector of vectors, so there's only one vector, and there must then only be one scalar in the left argument. Maybe you mean 0 1 2⌽¨↓3 3⍴1 0 0 or better ↓0 1 2⌽3 3⍴1 0 0
 
well ↓0 1 2⌽3 3⍴1 0 0 errors for me (not dyalog), but I tryed the other one and it works
 
@Wezl "me"?
 
I see this definition on aplcart :
IsNum←(1=2|⎕DR)
question: why the 1=?
 
@JoshD Heh, good point. I'll remove that.
 
@Wezl what impl?
 
@dzaima ngn
 
6:59 PM
@Wezl ah. I guess it doesn't implement high-rank
 
I guess it's my fault for using it :P
 
ngn
@Wezl what! i thought i deleted that
 
Yeah, it is out of support ;-)
 
I support it :)
 
Thanks. Also, it would be helpful to put somewhere on aplcart.info a way or message to email you for additions, etc. I remember there is an email address for that, but it isn't immediately visible. Maybe one of those buttons on the bottom right of the page?
 
7:01 PM
@ngn ofc not, it's the internet
 
ngn
@Wezl monadic ⊃ and ↓ might be swapped there
 
@JoshD There's the (?) button you can click, and then scroll to the bottom…
@ngn Wat‽
 
Ah, and you can get to it via the github button. Nevermind, I think that's clear enough for now
 
ngn
@Adám earlier versions worked like the wrong ⎕ml in dyalog
but it's not that. it's the ⌽. it doesn't accept vectors on the left.
 
7:08 PM
@JoshD I mean, I guess I could add a (@) button that does a mailto:adam@aplcart.info
 
@Wezl 1st and 4th are the best imo
 
ngn
@ngn i remember being tempted to make a b⌽c equivalent to dyalog's a⊖b⌽c, i.e. each scalar rotates an axis. i probably left it as an error because i couldn't make up my mind and then the years passed..
 
@Wezl I feel like they could be wider
 
@ngn BQN did that :)
 
@user sorry, but no they can't, without stabbing into other characters
 
ngn
7:09 PM
@dzaima really? cool :)
 
@dzaima J did that.
 
@Adám ah, that explains it
 
It is easy to use Rank to map over cells, but hard to map over axes.
 
ngn
the current vec⌽ in dyalog can always be replaced with something involving the rank operator
 
@Wezl Oh, that's too bad.
 
7:11 PM
@Adám There might be merit to an @ or an email icon on the bottom right. We want to maximize user contribution to aplcart, so streamlining the addition/correction process in any way is probably worth it.
 
@user well, it makes it take less space, but it does look "special" sometimes
 
@ngn isn't affected by ⎕ML
 
@ngn right, and in BQN you can even do ⌽˘ for APLs vec⌽
 
ngn
@Adám was it ↑ and ⊂ then? i forget
 
and
@dzaima Uh, no, I don't think so.
 
@Adám i specified being a vector. For higher ranks you need more ˘s but who needs that
(gtg)
 
@Wezl :
 xxx
x x x
x x x
xxxxx
x x x
xx xx
 xxx
 
@Adám no fake diagonals please
 
@Wezl What is the one before ?
 
@Adám ⌾, you can press the edit button or copy paste into a normal font place
 
ngn
7:20 PM
@dzaima re the measurements you sent yesterday - you know they grow the dict to millions of elements? so it all comes down to the time it takes to look up the key (linear in my case), nothing to do with memory reuse
 
key lookup shouldn't be linear though
 
ngn
@rak1507 why?
 
@ngn aren't dictionaries meant to have o(1) lookup?
 
ngn
@rak1507 no, because for the typical sizes linear lookup is faster than hashing
 
7:22 PM
oh
 
ngn
i think k allows 16 or 32.. something like that globals
 
I'm using alists for environments because they have automatic shadowing, which is nice
@ngn wait, so you can have 16 max globals?
 
ngn
@Wezl i don't remember the exact limit, but it wasn't big
@Wezl that's per namespace
if you have too many globals, you're supposed to organize your code in a better way
2
 
@ngn I did explicitly ask you whether you have O(1) read performance..
 
ngn
@dzaima O(32) is O(1) :)
 
7:28 PM
why have O(1) amend if average array size is 1.5?
 
ngn
yeah, what's the point of anything :)
 
@ngn yep. The point of things is only apparent in context. In your context, expecting <32 items is acceptable. In others, absolutely not.
and imo having a special language type that is literally just a pair of lists is pointless. We already have 2-item vectors, and ability to define functions to modify them
 
ngn
@dzaima to answer a bit more seriously: to have dicts as immutable values, while keeping the same performance as if they are mutable (when refcount=1)
@dzaima yeah, but it's tedious to write d[1]⊃⍨d[0]⍳k instead of d[k]
 
@ngn then define a function taking d and k as arguments. I kind of expected you to value simplicitly & minimalism of the language over such a tiny problem :)
 
ngn
@dzaima yeah, maybe that would be simpler in a sense, but since practically everybody needs such functions almost all the time (remember k evolved as a database), why not add them to the language
@dzaima using the same argument: why have tally () when you can implement it as whatever
 
7:40 PM
@ngn sort is also a very common operation (i'd guess more common than dict reading), having a built-in for it would even probably be a reasonable performance improvement
 
ngn
@dzaima i agree
 
@ngn I don't buy into the whole minimalism over everything thing. You do though
but is a couple magnitudes of usefulness above O(n) dictionaries imo
 
ngn
@dzaima can you imagine a db in which you get a column from a table (technically: flipped table) with t[1]@t[0]?c instead of t.c?
 
@ngn for a database, it's useful. For general programming, not so much
 
ngn
dicts are not useful in general programming??
 
7:45 PM
@ngn "not so much" in the literal sense of "somewhat less" not "not useful at all"
though since k doesn't have any closures or lexical scoping or namespaces, dicts are useful for just transferring labeled data. In BQN with separate namespaces and dictionaries, dictionaries would only be needed for the cases of arbitrary keys, which also most likely implies a lot of items
 
ngn
@dzaima k doesn't have closures but it has lexical scoping and namespaces.
just because only the local and global scopes are visible, it doesn't mean it's not lexical
 
If a K is really fast, how bad could the overhead from hash tables inside of it be?
 
ngn
a k function would never modify its caller's locals
 
@ngn I just don't at all consider k's scoping lexical. Does C have lexical scoping? Does Excel?
 
is K not lexically scoped?
 
7:52 PM
@nathanrogers it's not dynamic scoped, but as ngn said, a function can only see its own, and global variables, not anything in the middle
 
so it can't see local scope?
 
example: a:1;{a:2;{a}0}0 gives 1
 
ngn
@Wezl hashing would help for large dicts, but those are rarely needed
 
@dzaima yeah then I agree, it isn't lexically scoped
why would you ever want that behavior?
 
@nathanrogers for a simpler & faster impl :)
 
7:54 PM
impl?
 
implementation
 
it seems like a wound in the language
 
ngn
@nathanrogers the usual argument is: so that serialized functions don't drag their parent scopes along when they are serialized and for instance sent over the network
 
I can see the benefit of having flat scope every time a function is evaluated
but if the goal is expressivity and flexibility
yeah that's awful
 
ngn
@nathanrogers yes, i want full closures too, but it's not up to me :(
 
7:57 PM
@nathanrogers bear in mind in K you can pass up to 8 arguments to a function
 
My guess is that it makes K a more literally functional langauge. globals are the dsl, and the functions operate directly on the globals?
 
ngn
@nathanrogers "dsl"? :)
 
domain language
 
@dzaima oh right, C has lexical scope with {}-blocks. :|
 
I just don't see how you can architect a project in any other way than just a flat directory of files, while being forced to ensure that there is no name clobbering
 
ngn
7:58 PM
@nathanrogers functions see only their own locals (they live on the stack) and the globals
 
that's what I was saying
I'm trying to put it into terms of a broader programming context
 
ngn
@nathanrogers well, there can be a hierarchy of namespaces (in proper k, not in mine)
 

« first day (1499 days earlier)      last day (1156 days later) »