@TessellatingHeckler That's a great idea. No changes (other than the addition of the actual links) necessary to APLcart; we just need to write those pages and add the links.
@Adám What could we use for the page names on the Wiki? I had a quick look at the .tsv file on your GitHub, and it looks like there is no id or primary key for each row to use; the code itself might break as a URL part or as a wiki name, I think.
Btw, I need to get on with adding TIO examples. Lots more to do there. Only 528 of 2480 entries have examples, though some can't have examples, due to TIO limitations, most certainly can.
We are working (and have almost finished) on TryAPL 3.0, but for now, it isn't running a sandbox, but just takes over the safe execution engine from TryAPL 2.0. We're mainly changing the front end, and getting rid of server state. However, we are in talks with a 3rd party which has developed a sandbox that's simpler to set up than TIO's.
@RGS I wouldn't expect all of them to get entries, but I wouldn't put an arbitrary limit on it; it can potentially fill in over time.
@RGS Something which frustrated me looking at APL from the outside is that there's basic tutorials which spend three pages explaining that 5 + 1 2 3 implicitly maps and how amazing that is, and there's endless places where people will dump a show-off line of codegolf with no comments, and there's a bit of a scarcity of anything in between - bits of code with walkthroughs of how and why they work
for example I've just gone scrolling through AplCart to find the next things to have TIO links, and +⍨N is there. The description says "Double: 2×N" and the help text links to Dyalog's documentation for add. How and why it doubles anything is nowhere to be found.
Nor is the name of the only other symbol there so you can go look it up, and if you do copypaste ⍨ and go to the Dyalog documentation and search for it, the top result is "Power Operator", then "Binding Strength" then "Tilde diaeresis" - without a picture of the symbol you're looking for
and if you open Dyalog, look at the tooltip for ⍨ you'll have to find it as the third example under "Commute (switch)" "demonstrated" with reshape.
@TessellatingHeckler Good point. It'd be better if +⍨ linked to Commute#Examples. I didn't think of linking to APL Wiki, so I though some doc link was better than none.
@TessellatingHeckler Yeah, Dyalog's help system search is rather useless for a language that uses symbols. (You mean "Tilde diaeresis", not "Nor", right?)
Is it helpful to submit TIO links for +⍨5 and similar small code samples as a Github issue? It will surely take you more work to check it works and make the changes and close the issue than it would to make the TIO link yourself?
@TessellatingHeckler True, but if you submit a collection of TIO links to consecutive entries, I'd see that the first few are perfect, and trusting the rest. That said, I'd appreciate PRs instead…
Down to 14 with an obvious trick, but I don't see any way to go further. Group could extend the (depth-1 components of the) left argument to any rank instead of just 1, which would make the ○⥊ unnecessary and bring it down to 12.
@TessellatingHeckler I think pure examples (unless something very "mysterious" is going on) is best for the example links, and easiest to keep consistent. Check out the existing ones' style. Any embellishment should go on the wiki page for the primitive or the example. A short explanation like your comment there, is really what the description entry is for.
Maybe "Double: 2×N" should be expanded to "Double (plus self): 2×N".
@Adám Gotcha, pure examples. If that description section is describing what the code achieves - doubling N - then the Wiki link instead of going to a general commute examples page, could go to a specific page for this saying how doubling works using add-commute, why add is used (performance advantages over using multiplication?) and why that code style is desirable (reduces the need to store and mention variable names, draws more attention to the operation instead of the variables).
Not to let the perfect be the enemy of the good, a link to the commute examples page would be helpful, only to say that what I was picturing was more "APLCart suggests this line of code, what is this line of code, how does it work, why do it this way?" rather than "APLCart suggests this code, here's some expansion on the APL functions and operators it uses"
@Marshall That extension is pretty nice; it means that if 𝕨 consists of natural numbers then each element of 𝕨⊏𝕨⊔𝕩 contains the corresponding cell of 𝕩 among its major cells. For Select (⊏) a rank-k component of 𝕨 sends one argument axis to k result axes; for Group ⊔ it sends k argument axes to one result axis.
Drawbacks are that the extended Group would rely on ravel ordering of left argument components and that it doesn't completely extend to the 1-argument form, because a depth-1 argument is supposed to use single-number indices. That's only possible if such an argument is assumed to have rank 1. Maintaining that requirement means that depth-1 non-lists would be valid left arguments to ⊔ but not valid arguments in the 1-argument case.
@Razetime most of the functions & state are a jumbled inconsistent mess. i did at one point start rewriting it all, but stopped because that too was awful
@Razetime assuming a bash-y enough shell and java 11, ./build and then ./REPL runs the basic dzaima/APL repl. to get graphics, you'd need processing; example programs are here and which is run is hardcoded because i'm lazy and it's very much incomplete
cmc[1]: given two polynomials over {0,1} as length-8 boolean vectors, multiply them modulo the polynomial p(x) = x^8 + x^4 + x^3 + x + 1, i.e. implement multiplication in GF(2^8) with p as the reducing polynomial
i mean, we could use another primitive polynomial as the modulus and still generate GF(2^8) properly. i chose this one because it's been standardized in aes.
@rak1507 Phase I: 97.5% for a 5th place. You only did one problem on phase II, but you did it quite well; 88%, which funnily matches exactly the score of the other two who also only answered that one, though the reason for your scores differed a bit.
Would it be possible to publish (anonymised) examples of real suboptimal and exceptional answers for each question to learn from? Maybe not suboptimal as you wouldn't want your solution to be publically shamed, even if anonymous, but potentially just the really good ones?
@rak1507 Yes, we will publish a cream-of-the-crop set for both phase I and II, but not until the winner has had a chance to present their work themselves. Interestingly, the cream of phase II comes from 9 different participants, one per problem.
Interesting! I can't wait, I definitely have learnt a lot from doing this already, it's just a shame I discovered APL so late this year. I hope next year I can give it a better shot!
Well, really, one participant (the phase II winner) would have contributed two problems' solutions, if going strictly by the average scores, but I chose an alternative for problem 8 due to the other contribution having exceptional performance, even if the code what slightly less clear.
Problem 8 was very interesting regarding performance. (More or less) correct solutions varied greatly in performance, with a factor of almost 20000 between the fastest and slowest correct (enough) solutions (with the fastest one having full correctness, and the slowest one only reasonable correctness).
Those stats at the end are surprising, I would assume there would be more of a balance, but it's impressive that the best solution was both the fastest and fully correct
@RGS Chooses between two different methods depending on the size of the input: If less than 14 then simple exhaustive search, else Horowitz-Sahni method.
@RGS It requires some knowledge about bijective base, and the fact that simply converting the 1-26 digit values in "base 26" is indeed equivalent to converting from bijective base-26 to integer.
I don't understand the question because I don't understand the difficulty... I just read n ⊥ v as the numerical value you get by evaluating a polynomial with coefficients given by v at n
(I feel many people got that problem right by trial and error, not knowing the maths under the hood. If it were a Phase 2 problem, most of them would lose points on that, by failing to explain the required knowledge.)
And I did not write down the proof that this polynomial I want to evaluate at 26 works, but I am used to modular arithmetics enough that going over it in my head convinced me enough
I don't want to be cocky but maybe the point of this "wow factor" is that many participants don't have a maths background?
Because I really can't grasp (yet?) what is so amazing about this working
BUT I'll write it down decently and then it either strikes me or not
@Adám Linear Algebra is nice! but I would say it has little to do with why this problem works. At least when I think about the stuff I learned when I took LinAlg