« first day (639 days earlier)      last day (2034 days later) » 

12:28 AM
there, codepage. Pretty table coming soon
 
nice
 
Ugh, upgraded to macOS Mojave and half my applications are broken
 
 
4 hours later…
4:14 AM
@dzaima Feel free to update
50
A: When can APL characters be counted as 1 byte each?

Adám GNU APL and ngn/apl use UTF-8, so use a byte counting tool. NARS2000 only uses UCS-2, so 2 bytes per character. IBM's APL2 is the only modern APL that natively supports APL EBCDIC, so 1 byte per character. Dyalog APL uses any Unicode format, or the classic Dyalog character set (Table 1 below).* ...

 
 
5 hours later…
ngn
9:06 AM
@zeynel hi! yesterday i wanted to tell you about - it generates consecutive integers like this:
⎕←⍳5
 
@ngn
1 2 3 4 5
 
ngn
^ there's a bot in this room that evaluates messages that start with quad-gets (⎕←)
there's a special variable called ⎕io (pronounced "quad-eye-oh") whose value - 0 or 1 - determines the initial item
⎕←⍳5 ⊣ ⎕io←0
 
@ngn
0 1 2 3 4
 
9:41 AM
@dzaima I've updated the meta post.
 
 
2 hours later…
11:24 AM
@Adám right yeah, I guess it'd make sense to have it there. Gotta remember to update it if/when I decide to update the codepage
 
 
7 hours later…
6:20 PM
@ngn Thanks. My ⎕io is set to 1 and I like this better than 0.
Hello. I never got a response for my request to join Dyalog forums. Is it proper to ask such questions here about APL symbols on MacBook Air keyboard?
 
ngn
@zeynel in my own experience ⎕io←1 almost always feels off by one, but indeed some APL people prefer it, so you are in good company :)
@zeynel sure
 
 
2 hours later…
8:06 PM
Before I start using wrong terminology everywhere (which I already am anyway), a scalar is anything with ⍬≡⍴A, and a primitive is anything with A≡⊃A, right?
 
8:38 PM
no, primitives are functions ._. Is there really not a better name for A≡⊃A than "simple scalar"?
 
and also A≡⊂A in Dyalog :P
 
@EriktheOutgolfer Not a valid java identifier, sadly :p
 
can't "simple scalar" be "simple_scalar" or "simpscalar" or something?
 
@EriktheOutgolfer very long and 2 words/contractions are awkward :p
how bad would it be if I made empty arrays not have prototypes (i.e. '' ≡ ⍬)? I really don't want to deal with them ._.
 
ngn
9:08 PM
@dzaima so what would 1⍴'' and 1⍴⍬ be?
 
@ngn either an error or some equal value whatever it'd be
 
1p'' being '' would make sense to me
 
@Quintec but it doesn't have shape 1 then
 
(On phone don’t mind the fake rho)
 
I prefer errors to sub-optimal/just strange results
 
9:12 PM
@dzaima Rho repeats it until the length is one, which never happens, so I guess error would make the most sense.
 
that's what makes most sense to me too
 
1⍴'' is literally the same as 1⍴' '...
i.e. a vector that contains a whitespace
 
@EriktheOutgolfer but if '' ≡ ⍬ then 1⍴' ' ≡ 1⍴0, which is just nonsense
 
yeah, if '' ≡ ⍬ then (1⍴'') ≡ ,0...wait, what?
yeah, pretty much nonsense
 
Lol
 
9:15 PM
yeah, '' ≡ 1⍴'' wouldn't make sense either for me, an error is better
 
If you disagree you’re probably looking for 1/''
 
that's not the same
 
Exactly
 
ngn
9:34 PM
@dzaima i think a more important question you should ask yourself is how to represent unitype arrays :)
currently you store everything as a generic list - a list of pointers to other objects
 
@ngn that's exactly what I'm working on :)
 
ngn
but if you had a .type field, ''≢⍬ would make more sense than ''≡⍬, even if you discard prototypes for generic arrays
 
now that I have 6 array classes and only one of them is specifically typed (char arrs) it's just a bit annoying to have prototype special-cases for each & for every function that cares about them
@ngn that feels like special-casing for the typed arrays and I'm not planning on having every function work differently for all the types (as that'd get boring fast), so I can't really rely on types
 
ngn
@dzaima well, just 3 types would do - number, char, generic
 
@ngn I want to be able to have long, double & bit arrays though (even if I don't ever really use those much)
right, complex numbers if I decide to want those
 
ngn
9:45 PM
@dzaima you're very far from those optimisations - currently you have a large per-element overhead in both memory and speed
 
@ngn yeah, I know, but I want to leave the possibility to add them without having to rework prototypes
@dzaima what I meant by that is that if I'm very lazy 0⍴'' could very well return a generic array; losing type information is very easy
 
ngn
@dzaima implicit prototypes for unitype arrays are not as scary as sneakily stored prototypes for generic arrays
all you need is a static Arr[] prototypes = {...}; indexed by type, and a few places in the code where it should be used
 
@ngn well yeah, I could make prototypes for unitype arrays work, but as I said being unitype isn't a property that's gonna be kept around for a while
 
ngn
(that's if you decide to have a .type field)
 
@ngn a .type field doesn't make much sense as the class already specifies the type
 
ngn
9:59 PM
@dzaima ok, static Map<Class, Arr> prototypes = ...; then :)
 
@ngn I think a stack of ifs would be better for that :p
 
ngn
@dzaima not if it's used in more than one place
 
@ngn then make it a global method (well, as global as it gets in java)
 
ngn
ok, the details don't matter... the important question is how efficient do you want your apl impl to be? everything follows from there
 
I do already have a Value prototype() method for overriding that returns the prototype actually :|
 
ngn
10:03 PM
@dzaima yeah, i guess that's the proper OOP way
 
@ngn No idea. However efficient it can be without it getting boring to implement I guess :p
 
ngn
@dzaima i don't know if you'd find this boring, but the only way to tell if something is more efficient is to measure it :)
for instance adding two very long double[]-s element by element vs the same thing with unpacking of Num objects
 
for the current moment what I want is to figure out what to do with prototypes since I'm kind of stuck on that. I first need to get a working + :|
completely totally unrelated, does a←5 ⋄ a[]←6 make sense?
 
ngn
10:19 PM
@dzaima it does to me :) a scalar has no dimensions, so there's nothing in the brackets
 
heh, a[1;2;3] for rank 3 has 2 semicolons. a[1;2] for rank 2 has 1 semicolon. a[1] for rank 1 has 0 semicolons. So a[] should have -1 semicolons? :D
 
ngn
@dzaima sounds logical :D
 
(though currently my APL doesn't even use semicolons for [] assignment)
 
ngn
dyalog doesn't accept scalar[] or scalar[]←..., i think it interprets nothing as 1 missing dimension, a la matrix[i;] or matrix[;j]
 
@ngn oh interesting, 1 2[] works but (2 2⍴⍳4)[] doesn't
 
ngn
10:25 PM
@dzaima well, a vector does have 1 dimension
a missing index in the square bracket means "all"
so you get back the vector itself
as for the matrix - there are not enough indices in the square brackets
as you said: "a[1;2] for rank 2 has 1 semicolon" :)
 
ah, so really scalar[] doesn't make sense :D
 
ngn
scalar[;⍣¯1] ⍝ :)
 

« first day (639 days earlier)      last day (2034 days later) »