well I'm splitting / up (and making the op part different too) so no compatibility and I'm not going for performance at all. Simplicity probably applies to me here though
@dzaima well, i don't put any ego or emotions into this :) i'm just trying to explain why k's way is more self-consistent, but ofc you're free to implement this any way you like
@ngn I'm more asking whether adding fancy would make arrays enough like k's dicts, hence the :p (though I'd understand if everyone just filters those out as they're at the end of like 50% of my messages)
@ngn well yeah that's what I meant. Keeping both sides the same length means a full pass though only one maps elements O(log n)
@ngn no idea, that doesn't transpile in my brain
@ngn either way, whenever I want I could add K-like maps later (which would make my APLMap not seem so badly named :D ), and I definitely want hashmaps
i think what they meant by should (not: must) is that if you have repeated keys, lookup by key and possibly other operations may return unexpected results, but otherwise the world will not end
@dzaima how about this: another feature of k (not yet in ngn/k) is that a.b.c:1 creates a variable "a" with key "`b" mapped to a dict with a key "`c" mapped to 1
i.. think ill just leave that like that and call it a feature
also another idea that's been bugging me for a while is a statically typed APL. No idea how wrongly that could go but it'd allow much better optimization and actual compilation (to some extend, at least)
So a←b←1 2 3 a and b point to different memory locations both initialized to 1 2 3 or not? possible I wrong because remember C language and assembly ...
@RosLuP really array variables could be thought as pointers to a constant/immutable thing holding the arrays contents & its shape. Even if ← wanted to clone the 1 2 3, the cloning function could just return the same pointer as the array is immutable
@dzaima forcing the user to declare types would be against the spirit of apl, but sometimes types and/or shapes can be inferred automatically - if i remember correctly, Bob Bernecky's and Martin Elsman's impls do something like that
@RosLuP yes, they point to the same memory location, but that's transparent to the user
every apl object has a "reference counter" for the number of other objects pointing to it
@ngn yeah, I did think about making the compiler figure out the types, but allowing declaring types could be useful (though if your program "works" with the types of everything being wrong, it should be obvious)
when you try to modify an array with a refcount of 0 (or 1 in dyalog's impl), the memory can be reused; otherwise a new copy of the array is made at another memory location
@dzaima the problem with static typing (inferred or declared) in array languages is that it's a lot of effort to implement and use, but there's little benefit for performance in practice :|
but if assignament is from one int, i and r are two different location else i think this function would return one number >1e5 and in NARS Apl return something as 3.14
@RosLuP they might point to the same location in memory right after "i←r←0", but once you modify one of them they will become different locations (I mean, if nars behaves as i'd expect)
You feel so accomplished, until you compile the code and realize you forgot to stream, you used the wrong type of argument in collect, your mapToObj takes a wrong argument, the types are wrong, the final product is still a stream, you always forget that stupid double colon, and you forgot the additional arguments for max/min
More high level language one goes more slow it will be especially primitive function are not assembly function... I think 90% programming is find the right function primitives and use them in hope the language not so verbose
But I still love the elegance and feeling of doing it all in one line, especially in Java, which is as verbose as possible
@dzaima In most competitions the difference in speed between C++,Java,Python,etc. doesn't matter, or they have different time limits for different langauges
@ngn you see, not everyone is ngn and we, mortals, can write buggy/bad code. If your goal is to write perfect code from the get-go, why use a C(++) compiler (as it too does a ton of optimizations) and not just write in assembly?
@ngn well if you explicitly don't want any help writing good code and don't want any error messages, the only 2 possibilities for that are either you like bad code or you already write perfect code, and I don't think it's the former
@ngn short error messages only help really if the problem is easy to notice and you know everything about what you're using. If someone didn't know that × on a character throws an error instead of doing nothing (like +), a domain error pointing to × might be pretty confusing. Or the thing that's affected me way too much - value error to a private field
@dzaima of course, i can't and i won't tell you what to do :) everything i say is just an opinion based on my experience
@dzaima i don't know... dyalog is fairly newbie-friendly
i mean the graphical ide for windows with all bells and whistles
the obscurity of apl may be due to other factors: the character set, lack of a decent libre implementation, moore's law eroding the advantages of vector languages...
@chrispsn He uses macOS, so to enter symbols like √ and π (which I have heard testimony that he uses) I suppose he presses Alt+v and ⌥+p. kOS is absolutely still in the works. In fact, he cancelled his attendance at this year's Iverson College at the last minute because he felt he was on a roll with kOS. Specifically, he was succeeding in removing the last few OS dependencies from K.