:( the more and more I use TryAPL the more and more I dislike it. I just accidentally hit Ctrl+R and instead of `+R (for Rho) and lost a 45 minute session
because the new TryApl doesn't cache your most recent session
@code_report In the FILE tab, there's an option called "Save workspace using local storage". I think enabling it will prevent data loss (at least it seems to work for me)
@RikedyP Alt + up / down works :) thanks for adding that. I have Dyalog 17 on 18 on my Windows laptop, but when I tried downloading Dyalog for linux my keyboard setting broke for half a day so I uninstalled it. I personally think Dyalog should be heavily investing in tryapl.org. In C++ land, https://www.godbolt.org/ has become the primary place I write C++ code examples and prototype. Software development (and everything) is headed to the browser/cloud, not to desktops.
@xpqz in python you can use bools as ints: sum(int(d[y][x] == '#') .. ) <-> sum(d[y][x] == '#' ..)
@rak1507 in trav you could have used data directly, without passing it as ⍵. were you deliberately trying to avoid using closures, e.g. for some philosophical or aesthetic reason?
i was asking because k forces you to program like that - there's no support for closures (you can use only locals&globals), but i don't enjoy this style very much and i'm trying to better understand the pros and cons
How do you respond to people saying APL is unreadable, considering the fact that even if you don't know a mainstream programming language, if you know anything similar it is probably readable, whereas APL isn't?
@rak1507 There's no getting around having to learn to read it. Unfortunately many people seem to value being able to guess a few of the most basic primitives over the ability to be more expressive later on
@rak1507 because they learned it just as they learned English needed for mainsteam langs. Nothing's stopping one learning APL the same way, and APL has the advantage that some effort was put in place to make it sensible
@rak1507 It might be as simple as the inertia - they've already put the effort in once to learn the traditional-language thing
@dzaima And maybe they don't take seriously even the idea that having an executable mathematical notation is worthwhile - however there are many senses in which programming languages are more like natural languages than they are like mathematics
@rak1507 In my view, the intial recoil at APL is quite low on the reasons people don't adopt - I think it's more like the inability to do anything exciting without effort at first (unlike, for example, in python where you can recognise digits using a neural net in an hour long tutorial - although you'll just be mindlessly copying and pasting API calls)
@dzaima They can fit more information in a tweet than we can
Yeah I think so, often when I've mentioned APL people have said something along the lines of 'that's cool but it is totally useless to me', which is fair enough
@rak1507 In mainstream languages that use English words, there is, to the uninitiated (and even to the programmer), no visual difference between built-in names and programmer-defined names. If someone doesn't understand any of the APL symbols, they'll only be able to read the programmer's identifiers, and therefore stand a much better chance at gathering what the program is about.
@dzaima I also find (even though I'm not very good or fluent) parsing kanji gives me the "what is this thing" in my brain a lot quicker than parsing words
@dzaima the "chinese" question usually gets the point across: their complaint is about familiarity, not readability. there's no implication of one language being "better" than the other.
If anything it's more extreme, it probably takes about 20 minutes for someone to do it in python, the longest part is probably pip installing all the dependencies.
@ngn I mean, yeah, it refutes the point that it being unreadable is necessarily bad, but not much more. There's still a clear preference one would make between needing to learn a bunch of funny squiggles vs not needing to
I was watching one of his talks the other day and he was comparing the length of a description of some APL with the actual APL, and although I get the point he was making, at least I understand what the description means...
@ngn everyone can understand pretty much any code if given enough time. Readability is more like the amount of code (or maybe amount of stuff done by the code) you can understand per time unit
@ngn he was arguing that it should match the semantic density of the language (long names in java, short names in apl, really short names in macro-heavy arthurese c). i was arguing that shorter is always better, even if the language is forcing verbose syntax on you. somebody else was arguing that longer is always better..
@dzaima that is subjective. it depends on the prior experience of the person reading the code.
@dzaima that also has some variations - certain coding styles would give a higher such readability score for understanding a single function, while sacrificing the score for understanding the entire codebase (and others vice versa)
@ngn I mean, of course it does. I'm not saying readability isn't subjective
@ngn and that also raises another readability factor score - how suited it is for someone with no prior experience. Might matter in some cases, might not in others
@rak1507 More or less what Richard said but there's often no need to respond. I someone just dismisses APL with "that's unreadable", they're likely trying to protect themselves from feeling like not knowing it makes them a bad programmer or FOMO. Frustrating that it comes out looking like an attack but that's a reasonable thing to do, and there's no point in arguing the point: they don't want to debate.
Right makes sense, I guess from my point of view it seems like a shame APL is initially so inaccessible to people as I think learning APL has made me a better programmer in other languages, and I think that can apply to others as well
If someone says they want to learn APL but are worried about the glyphs, you might point out that there aren't very many of them and most are suggestive of their functionality in some way. Or ask for more clarification to see if they have other misconceptions about APL.
@rak1507 A lot of the problem—which was worse historically but is still bad now—is that it's confusing and difficult to find the resources. You need at minimum the ability to execute APL and a decent introductory text and each of these are hard to find. I think the main effect of APL being weird is that people have less patience in initial steps. If they were making obvious progress from the start then it wouldn't matter.
Yeah I agree, and one benefit APL has is that it isn't as confusing in places as other languages, but if you're trying to show that to people who already have overcome those problems, it's not such a benefit
@ngn I think there are cultural and business concerns which probably have more influence - one is if your team of APLers is smaller for the same project, the loss of 1 member is higher percentage loss of (maybe perceived) productivity - another is that since it doesn't look like the other langs you know you have to train people (and not just grab fresh graduates for cheap who've already learned the mainstream langs)
When I came to APL, what attracted me was the fact that the first time I saw it, I really could not relate it to anything else I knew. A mouthwatering challenge. I never saw that as a problem with APL, only my lack of knowledge.
I think many have gotten used to that if they know one c-like language, they can easily pick up -- or at least passably read -- another without much of an effort. So when someone says "APL isn't readable" I hear "APL looks nothing like javascript/go/python".
And next time a recruiter suggests I use whatever language I like for the interview test, I'm 100% submitting golfed-to-death APL :)
Pretty amazed at how quickly the Day 1 AoC solutions run in APL vs Raku. Part 1 is fine in Raku but for Part 2 it takes 30 seconds for Raku to assemble the three-wise cross of the input and then find the triple that sums to 2020 :O
@rak1507 Good question :) ... Looking at just the algorithms, they might be more or less equivalent but I have to admit to not having a great grasp of time complexity in APL. The largest chunk (by far) of the Raku time is spent in constructing the array of triples.
@rak1507 Thanks! I'm going to have to spend a bit of time to fully understand this approach. But I'm also very thankful to find that @data.combinations($times) is much (15x) faster than using [X] @data xx $times in Raku :)
I hadn't bothered timing the day 1 solution, but I get 8 microseconds (?!) from the naive O(n^3) solution p←⍎¨⊃⎕nget'in\1.txt'1 ⋄ f←{×/p[⊃⍸2020=p∘.+⍣⍵⊢p]} ⋄ cmpx 'f¨⍳2' which is pretty crazy
@rak1507 I have been following it since the original RFC process back in 2000 but only really started learning/using it when I was conducting interviews at $work and started converting answers. It didn't take long for me to get hooked on the expressivity!