« first day (1442 days earlier)      last day (1509 days later) » 
00:00 - 21:0021:00 - 00:00

00:46
CMC: Given a strictly positive integer as left argument and a vector of 2-element (integer string) vectors as right argument, return ⍳⍺ but with elements divisible by ⊃¨⍵ replaced by 2⊃¨⍵, respectively, while letting later elements of overrule earlier ones.
      20 f (3 'Fizz')(5 'Buzz')(15 'FizzBuzz')
┌─┬─┬────┬─┬────┬────┬─┬─┬────┬────┬──┬────┬──┬──┬────────┬──┬──┬────┬──┬────┐
│1│2│Fizz│4│Buzz│Fizz│7│8│Fizz│Buzz│11│Fizz│13│14│FizzBuzz│16│17│Fizz│19│Buzz│
└─┴─┴────┴─┴────┴────┴─┴─┴────┴────┴──┴────┴──┴──┴────────┴──┴──┴────┴──┴────┘
      18 f (2 'Fizz')(4 'Buzz')(6 'FizzBuzz')
┌─┬────┬─┬────┬─┬────────┬─┬────┬─┬────┬──┬────────┬──┬────┬──┬────┬──┬────────┐
│1│Fizz│3│Buzz│5│FizzBuzz│7│Buzz│9│Fizz│11│FizzBuzz│13│Fizz│15│Buzz│17│FizzBuzz│
└─┴────┴─┴────┴─┴────────┴─┴────┴─┴────┴──┴────────┴──┴────┴──┴────┴──┴────────┘
      f←{w←⍵⋄{⊃⊢/⍵,(2⊃¨w)[⍸~×⍵|⍨⊃¨w]}¨⍳⍺}⋄20 f (3 'Fizz')(5 'Buzz')(15 'FizzBuzz')⋄18 f (2 'Fizz')(4 'Buzz')(6 'FizzBuzz')
┌─┬─┬────┬─┬────┬────┬─┬─┬────┬────┬──┬────┬──┬──┬────────┬──┬──┬────┬──┬────┐
│1│2│Fizz│4│Buzz│Fizz│7│8│Fizz│Buzz│11│Fizz│13│14│FizzBuzz│16│17│Fizz│19│Buzz│
└─┴─┴────┴─┴────┴────┴─┴─┴────┴────┴──┴────┴──┴──┴────────┴──┴──┴────┴──┴────┘
┌─┬────┬─┬────┬─┬────────┬─┬────┬─┬────┬──┬────────┬──┬────┬──┬────┬──┬────────┐
│1│Fizz│3│Buzz│5│FizzBuzz│7│Buzz│9│Fizz│11│FizzBuzz│13│Fizz│15│Buzz│17│FizzBuzz│
@Razetime Nice. ⊃⊢/⊃⌽
-2: {w←⍵⋄{⊃⊢/⍵,(~×⍵|⍨⊃¨w)/2⊃¨w}¨⍳⍺}
@Adám -1: {w←⍵⋄{⊃⌽⍵,(~×⍵|⍨⊃¨w)/2⊃¨w}¨⍳⍺}
@Razetime {⍵∘{⊃⌽⍵,(~×⍵|⍨⊃¨⍺)/2⊃¨⍺}¨⍳⍺}
@Adám can this be made tacit?
01:03
Yes. Is it worth it? No: ⊂⍤⊢{⊃⌽⍵,(~×⍵|⍨⊃¨⍺)/2⊃¨⍺}¨⍳⍤⊣
@Razetime I find a bit odd. Why not 0=?
0= is more idiomatic, yes, but consider: has more symbols
:-/
@Razetime {⊢/⍵,(0=⍵|⍨⊃¨⍺)/2⊃¨⍺}⍤1 0∘⍳⍨
2 bytes shorter
01:12
How so?
oh nvm it wasn't in monospace
hahaha.
New code golf category: Shortest code when written in a specific proportional font.
that actually sounds like a good one-time idea
Well, it potentially renews any code golf challenge.
it's gotta have a dedicated asker though
01:16
Why?
"You will be judged on the pixel length of your code in Times New Roman 12pt font."
someone's gotta measure the code
> Enter your code into this website to measure length.
hmm how do we measure exact pixel length though
JS can easily get the length of an element.
oh alright
01:41
@Adám 30-character solution in BQN. Cool idea but it golfs very poorly.
The right argument format is pretty hostile to array-oriented solutions.
@Adám Tried your table transposing question: Try it online!
@Marshall Ugh.
01:59
@Adám Is this output fine? https://tio.run/##nZDPSsNAEMbvfYrxtC0k1OoTiCAKnqwvEJrtH2gSSVdUOl5UShuboojiUXrKoeBFj17yKPMicbIxlRAE0zlkJ1/mm/y@tc6Gpn1lDb2eKS@VdG1pJ8mYJo9Gk4IXCmfcjgUKI45aNP@qOzR9ZSmOKPxsGBTcCFM0KYwcmjzQfNqk2VJ/u46jeiubNXb0@dTgNXWavVEwoWDZyMaSbmoMFxTcUrii8CN@32UPLZ7bJ/v8PD08aic9nhnzCx9C0P1dF1JrrQcCYQ/60rKlD9y6nupztxaOrZGCjjc8d1wWfQmAIvWYPwW/7R@C1rTnYODzMi6EbSgUguPx7o7n8v2p7EeZpy1ZtPWI710UPapvKSFGMFBba1FsEKl6oOpxNgiTRcmTYDEHllLo@8oBsciLpQR6Ok@ARX4s0evpnB6L7Fgmx2rolcArcf8TW9S@AQ "APL (Dyalog Extended) – Try It Online"
@Razetime No.
i mean, the format
@Razetime There's extra/missing spacing.
Ok, I hope this is correct: https://tio.run/##nVDLSsNAFN37FeNqEkiorV8ggii4sv5AaKYPaBJJxxcdN1VKGztFEcWl1E0WQjd26WY@5f5IvJmYSgiC6V3k3pw5584545z1bffa6Qcdm11x5rvMTZIhjB@tGkQvIKc4DqmglorrMPsy1DJtHkxe8UDFOINcmRZEI2rTGsjYg/EDzCY1mC7wWK5uVGzUM7rV0P3JNFCWakcXPOx5KjZBvjdUjNcYMH2DaAzRwszUSTvdJ@cQ3YL8APmplru4CubPzZN9/J4eHjWTDnKG@IONUri/a5NUutUhVJA90mWOy0KCox/wLk5r4NgZcNIK@ueej2DICBE01dg/RX7HPwCNac1BL8RlWILskEIJ4gW4uxX4@L48uyjTNBmCrqaEwWVRw7sOp3RAenx7DdINIlUPVD3OBmGyKHkSUcwhSin0e@UGRdGvKCXQ7DyBKPoXJfeanbsXRe@i7FxUs17JeCXf/7RNt74B
Looks good.
02:43
@Razetime fyi, I'm down to 40 in Extended.
02:57
It would have been so convenient if Markdown tables supported dfns.box-style boundaries
@Adám cool
 
3 hours later…
05:52
@Adám ⍳0 to get ⎕io was an idiom when I was a lad.
@ngn How would that work with real-time applications? APL was used for quite a few of those. At one time, British Airways decided where to put the curtain between economy and club using an APL program that read real-time data from BABS (the BA real-time reservation system).
@ngn As a matter of interest, what do you think of amazon.co.uk/Working-Effectively-Legacy-Michael-Feathers/dp/…
06:22
Doh! -Systems like that BA app have no data to migrate, so that's a non-issue.
06:32
@RomillyCocking i liked this! the idea of 'software as stored [executable] knowledge' resonated with me, though why it's connected to APL or array transformations more than other languages / data processing was less clear (if that was your point)
(with respect to your draft post)
I assumed everyone thought that software was stored knowledge. It seems this is not so.

It's certainly not the point I was trying to make, beyond the fact that APL is a great tool for *creating* knowledge.
@RomillyCocking maybe it could have some comparisons of how numpy/tensorflow code looks compared to APL, given the same task?
06:56
@Wezl I would.
@Marshall why doesn't the online REPL have syntax highlighting?
@chrispsn I may do that.
@RGS and if you'd like to collaborate on an learnxinyminutes for APL, I'd be up for it.
@Razetime BQN is like the language that needs syntax highlighting the least since you can directly see the role of every symbol and identifier.
Since the snippets had it, I figured it would make sense to have it in the REPL.
Maybe it's much harder.
The REPL is a standard html textarea which means individual characters cannot be formatted.
@RomillyCocking Why would one use that instead of ⎕IO? Sure, it saves you 1 byte, if on its own, otherwise you may well need (⍳⍬) which is longer, and all this at the cost of being very obscure to the reader.
An aversion to anything ?
07:13
@Adám A perverse and misguided desire to look cool.
(The cause of much suffering).
6 hours ago, by Razetime
0= is more idiomatic, yes, but consider: has more symbols
@Razetime Take note ^^^
@Adám umm for what exactly
@Razetime Don't try to look cool when writing APL; it is the cause of much suffering.
alright :(
Golfing is fine, when that's the goal, but if something isn't shorter (or you're not golfing) don't be "clever". APL is cool enough as-is.
I used to be pretty bad regarding this too ― just ask @MortenKromberg!
07:26
> When given a choice between a good option and a funny option, always choose the funny one
-Confucius
07:52
@Adám just remember that you may get called out to fix it at 3AM when a critical batch job is interrupted because of bad input from an external source, and a few $100M worth of trades required to balance the pension funds of tens of thousands of people aren't happening, as required by law. At that point, clarity and the ability to fix it in a few seconds while half-asleep is quite valuable.
@MortenKromberg I work with a treasury system used by a very large proportion of banks, and I know very well the "middle-of-the-night-this-end-of-day-job-must-finish-before-start-of-day" problems.
@EliasMårtenson ... and I assume you are (or at least your boss is) a bit conservative about overly golfing that code ...?
@MortenKromberg Banks are all about managing risk. So they tend to be very wary of changes. That means we have to be as well. It gets tricky when the software is 60+ million lines of code.
That's a long-winded way of saying: Yes, golfed code is frowned upon.
08:11
The bulk of Dyalog's revenue comes from organisations who deliver asset management systems or operate asset management services.
Other significant users are the people who design & manage oil and lubricant production using APL, and the worlds largest electronic patient journal system which manages records for more than half the Swedish population (fun fact: I computed that about 2% of the population of population of Stockholm have user ids in this system as they are somehow involved in Health Care). The latter system is registered as a "medical device".
Much as we are language geeks at Dyalog and enjoy working on proposals to extend the language, we need to be a little bit careful about making changes to the interpreter, since all the carefully crafted application code rides on top of everything that we do.
08:24
@MortenKromberg I think that's why we all write our own implementations. It's the best way to experiment with new things.
@MortenKromberg We (Cocking and Drury) sold mainframe APL into British Airways. If it went down, the whole airline moved from daily profit to loss that day.
In my case, APL is not used in our product. It's mostly C++, Java. And a much of GPU code in CUDA. However, I like using APL when doing things like working on performance statistics logs, etc.
If we had changed APL behaviour that broke their code they would have put us out of business, with an instant loss of 40 jobs.
@RomillyCocking That's a bit of an exaggeration I hope? It's not like you'd deploy a new version without testing?
I mean, we had to stay on Java 8 for way too long, until all our dependencies had been updated to handle all the backwards-incompatible changes in Java 11. It was a pain, but we did it after a couple of years :-)
Of course we and they tested new versions. The point Morten and I are making is that APL has been and still is used for business critical applications. In that environment customers, and responsible vendors, are rightly very cautious about change.
08:32
@RomillyCocking Oh for sure. We have customers still running on 12 year old releases of suff because they are too worried about updating.
Fun story: when BA were about to switch to a non-IBM but allegedly compatible mainframe they paid for the US author of the component file system to fly over on Concorde to discuss the risk of using the new hardware.
There are some customers who, when upgrading, picks a 5 year old version because they feel it's more stable.
@EliasMårtenson I've only migrated to Python 3 in the last couple of years, and that's just personal use.
The Python code we have is still on 2. Redhat is still supporting it.
No one is interested in moving it to 3.
I guess they might change that pov if Red Hat (aka IBM) decides it can price gouge.
Do Red Hat also support all the libraries their customers use? Not just the PSL?
08:39
@RomillyCocking Theys upport all the libraries shipped with a iven version of RHEL, until that version is EOL. I believe Python 2 will be supported until 2025 or something like that.
We might get rid of the python code altogether before then. It's not that much.
So you only use the libraries that Red Hat ship? No 3rd party libraries?
We use some libraries RH ships (openssl, python, some others). But we have a large number of third-party libraries shipped as part of the product. But in those cases we provide support for them, and they are only used by us (i.e. the libraries are not exposed to the customers)
The Python stuff, however, is for the most part customer code. Python can be used by the customer to extend the trade evaluation models used (i.e. computing different payoffs).
And as you know, customers don't like it when things change so we can't just switch to python 3 for payoff calculations.
@EliasMårtenson Interesting - thanks for the background. The world is always more complex than I realise :)
Our system is very large and highly configurable. Some customers allocate 18 months to do a version upgrade.
I'm looking for a terse but readable implementation of the Leaky RELU activation function in APL.
08:53
Hm, I think I saw that somewhere.
Leaky Relu is ⍵ if ⍵ is positive, but 0.01 × ⍵ otherwise. I can write it, no problem, but my solutions are not as concise as I would like. The solution needs to work for ⍵ of arbitrary rank, of course.
@RomillyCocking "Mike Powell's Machine Learning" linked to from apl.wiki/NN
@RomillyCocking I.e. lrelu←{⍵×0.01*⍵≤0}
@Adám Thanks.I'd forgotten about that document. I will refer to it in my blog post. Sadly I think his solution is not much better than mine.
Yeah, after reflection that's probably OK.
@RomillyCocking I doubt 0.01×@(0∘≥) will see any significant speedup.
Another golf-ish problem from MENACE code: I am currently using this to index the last dimension of an array of unknown rank, but I am sure there is a better solution.

`ild←{(⊂⍺)⌷[¯1+⍴⍴⍵]⍵}`
09:04
@RomillyCocking Markdown doesn't work in multi-line messages, but if you split your message into multiple parts, they'll be visually merged.
(⎕io is zero)
oh dear, with axis!
I will try to remember that. (It does in all the tools I use each day, so it's hard to unlearn)
@Adám Yeah, it's dirty.
@RomillyCocking Isn't that {(⊂⍺)⌷⍤1⊢⍵}?
Or even ⌷⍤1⍨∘⊂⍨
Or even ⌷⍤0 1⍤1 99
Doh! Of course it is.
09:08
There are almost no cases left where I'd use bracket axis.
@Adám Your first solution is the one I will use, as I think it has the lowest cognitive load for them given what they have already seen.
@RomillyCocking That's fair. Btw, have you seen my proposal for a Select (a.k.a. "sane indexing) function, usually denoted ? With it, this would be just ⊇⍤1
That was my instinct, which is why I asked.

I have really only grokked rank as a result of recent work on the book, and I wrote ild before then.
@Adám I like that a lot.
@RomillyCocking If you've not seen Richard Park's video series, I highly recommend it.
@Adám I've seen many of them but not all. I will be binge viewing over the next few days.
09:12
@EliasMårtenson Indeed, and the experimental array languages are of great interest and value to us. Apologies in advance to y'all for moving slowly and only occasionally st... er, adopting any of your ideas.
@RomillyCocking I'm talking about these 3 specifically.
APL seems to have gone from too little advice to (almost) too much in the last year or so.
@RomillyCocking I find it interesting that when Replicate has a Boolean left argument, we call it Compress. When Select has a left argument which is a permutation vector, I'd call it Permute.
@Adám I link to those in the latest (unpublished) version of the MENACE book. I think I will now publish (though ti;'s still not quite complete), so y'all can give me more of your excellent feedback.
:-D
09:24
@MortenKromberg Dyalog is welcome to steal any idea I come up with. In case it wasn't obvious from the Kap license. :-)
The new MENACE version is up. Still incomplete, but no longer has porno-Axis specification.

https://romilly.github.io/o-x-o/an-introduction.html
As usual, feedback welcome.
@Adám Yes, permute is a good name and a solution to quite a few problems.
RGS
RGS
09:57
@Adám in my workshop?
@RomillyCocking maybe I can drop you an email?
@RGS There too, but also in Powell's paper.
RGS
RGS
@Adám well, nowadays it's hard to look at neural networks and not trip on the leaky relu
The two of you would have a blast together.
ngn
ngn
10:12
@RomillyCocking without downtime? i have no experience with such migrations but i would expect you'd still need realistic data for testing the new system, and backups made just before flipping the switch. so being able to export the data is still very important.
@RomillyCocking i've never read it
@RomillyCocking i wish i'd read this before i answered :)
10:28
@ngn The site has now been updated with a clarification. Jonas Stensiö did achieve the same score as you, but he sent in all of his submissions at the end of the year, and so wasn't eligible to the other monthly listings. Your score was 270 because you were strict about the scalar vs vector, which is why your score was adjusted to 269. We agree that ⎕SD is wrong and will (hopefully not forget to) update the text file and 267→268 soon.
ngn
ngn
10:42
@Adám you mean 269->268 near the end?
@Adám thanks! better late than never
@ngn No, I mean that since ⎕SD is invalid, the "amalgamated minimum of 267 268"
@ngn Do you still think Dyalog engages in dishonest practices?
ngn
ngn
@Adám if i saw such a thing again i would be thinking the same things
@ngn Doesn't answer my question.
ngn
ngn
@Adám for this particular case probably no, because you corrected it now. of course, the most honest thing to do would have been to publish all participants' submissions.
OK, I can live with that.
ngn
ngn
10:56
@Adám {r⊣{r[i∩i×⍺]←⊂⍵}/¨⍵⊣r←i←⍳⍺} (⎕io←1)
@ngn It's not too late :) And Michael Feathers, the author, 1) is a really likeable, able, humble person and 2) likes APL, J and K.
ngn
ngn
@RomillyCocking why did you say "no data to migrate", by the way? is it a joke i didn't get?
surely a ticket reservation system needs to remember what reservations have been made
That BA system used BABS (the reservation system) but was an entirely separate piece of code. It sucked in real-time data from BABS and emitted decisions but stored no history.
ngn
ngn
ah, so it's just a front-end app, and the data is stored elsewhere. makes sense.
Same for the fuel-buying system, which read real-time jet fuel prices around the world and worked out whether it was cheaper to buy fuel where you were (and pay the fuel cost of flying it back) or to buy when you reached your destination.
Those two apps between them had a major effect on BA's profitability day-to-day.
This was waaay back in the 1980s.
11:12
IIRC, during an aviation crisis where all other airlines lost money, BA was the only one that didn't have a loss, as they were able to quickly adapt their APL code to the new reality.
@Adám Correct. And then they tried (several times) to rewrite the relevant systems in Java. I imagine that they have by now, which imay be why they don't do so well these days :)
ngn
ngn
so easy to adapt to the new market reality and so hard to adapt to ⍳⍬ :)
BA were big customers of ours, but gradually moved to Dyadic (as Dyalog was then called).
@ngn lol
@RomillyCocking Right, with enough effort, any APL code can be rewritten in Java, but a side effect is basically setting the code in stone ― it won't be flexible going forward.
@Adám No, that's not true. Since the efficiency of a team drops quadratically with the number of developers, and requirements are constant changing, there are some apps that cannot be implemented in less productive technologies.
Sadly the managers who need to understand that never do.
(almost never)
11:19
@RomillyCocking It still can be rewritten. Consequences be damned.
But it will no longer be fit for purpose.
So be it ¯\_(⍨)_/¯
OK. 'Cannot' -> 'cannot usefully'.
Such projects usually fail because, as the huge effort required becomes clear, the managers who never understood 'the Mythical Man Month' do the equivalent of asking nine mothers-to-be to make a baby in a month.
RGS
RGS
What is the problem in that...? If a mother takes 9 months to make a baby, surely 9 mothers can make a baby in a month :P
ngn
ngn
there are also "documentaries" in which 9 fathers try to do that with 1 mother :)
RGS
RGS
11:34
Never seen that on National Geographic.
11:47
I knew I could rely on you guys to raise the tone :)
Has everyone read Fred Brooks' "The Mythical Man Month"?

It's (very) old but still good.
RGS
RGS
12:08
I need help D: I thought APL source code (for dfns, namespaces, ...) would preserve its original whitespace if saved in text files..?
I opened a fresh Dyalog interpreter session and linked the root workspace # to a folder, typed )ed f and wrote a basic function with some whitespace in there.
ESC fixed it, and it shows in my file explorer as f.aplf, but )ed f again shows that the whitespace is missing.
@RGS Does the text file have the right whitespace?
RGS
RGS
@Adám Nope.
And I presume you have auto-format off?
RGS
RGS
I think so..?
Options → Configure → Trace/Edit → AutoFormat functions
RGS
RGS
12:12
Was ON, I tried turning it off and did everything again for a new function. Similar issue. The text file now has one less space (ASCII 10) per line of code.
Can you log an issue on GitHub against Link? I thought Link received the raw source (before formatting) from the Editor, and used that.
RGS
RGS
Reopening the function, reformatting however I please and then fixing again preserves the formatting, regardless of auto-format being ON or OFF.
So it looks like an issue of the first fix.
@RGS Aha, make sure to note that in the issue.
@RGS "The average UK woman gives birth to 1.89 children."
RGS
RGS
@Adám Noted ○/
@Adám speaking of the Dyalog comp (am doing the beta testing) -- guidance states that one should seek "proper array solutions, not loops", which is the APL way. But what does that actually mean for the comp? Avoid ∇¨ and possibly \/ and ⌺?
12:33
@xpqz I'd like @Brian to answer that, as it might also need clarification in the instructions. Feel free to include that question in your beta feedback.
12:46
@xpqz I'm not involved in judging the solutions, but as a general rule the best solutions are Pure data-parallel operations, because they will most often consume less memory AND CPU. SHARP APL & J style operators (rank, stencil) try to preserve simple arrays and are often optimised by interpreters, so they should be "cool".
@xpqz APL2 style operators (like each) often lead to less efficient solutions. Of course, there is a trade-off between the efficiency of reading&writing the code, vs the efficiency of execution - nested arrays may lead do "pointer chasing" by the interpreter, but often allow much more readable solutions.
@xpqz Some of the APL2 style operators are also optimisable, at least for primitive operands. At the other end of the spectrum are actual loops, which can still be justified. Judging will always be quite subjective.
12:58
@MortenKromberg yes, that was the reason for asking, really -- obviously "readable" is in the eye of the beholder, but as a relative newcomer to Dyalog and APL, the intuition of what is efficient and what is a performance death-trap does not come easy.
13:14
@xpqz When I write code that I think might be performance sensitive, I use the "cmpx" function from dfns a lot - or the ]runtime user command to verify my intuition. And complain to the developers when my intuition fails ;-)
I like it: if the map differs from the terrain, the map is right by definition :)
@MortenKromberg Same here - except that I complain to @MortenKromberg, who then probably complains to the developers :)
Yup, if the map and terrain differ, bring in the bulldozers.
13:29
<raoul> Hi, I'm used to J but starting something in Dyalog APL. If I want to make a lib, is it correct to just stuff my code into a named workspace, and then import it? Or is there some other idiomatic way? Thx!
raoul: Welcome. I would look into storing things in text files. If your things are currently in the workspace, do ]link.create # /path/libname -source=ns
That should create a directory libname which has text files in it, and can be imported with ]import libname /path/libname
And such a directory of text files is well suited for SCM like Git.
@Razetime The main reason is that you can't highlight a textarea without a bunch of hacks. That's also why dzaima's Paste page has separate edit and view modes. The syntax tree view ("Explain") does highlighting.
@Marshall @Razetime That's also why new TryAPL doesn't do syntax highlighting, even though APL needs it more than BQN.
@Marshall I love the Explain feature
@Razetime I should probably do more to improve it. It wouldn't be too hard to give the primitives short explanations on hover, and link to documentation pages on click.
13:37
@Adám thanks for the explanation
<raoul> @Adám Ah yes, I remember something about a successor to SALTing. What is this successor called, again? (so I can look for it in the doc)
See https://github.com/Dyalog/link/blob/master/README.md (I don't think IRC lets you see the URL in the previous message)
<raoul> @Adám Thanks, I got it!
No problem. We're very happy to have you here.
13:53
@Marshall this was fun (you can wrap in {} to convert to subject)
@Adám but beware, if you are running under linux I think you will need to manually install .Net 3.1
(I certainly did)
<raoul> @Adám I got the 'libhostfxr.so' error. I am on Linux. Does Link require .Net?
@RomillyCocking raoul: You should only need .NET to auto-sync file system changes, e.g. after a git pull ― the message is just a warning.
If you're developing something by yourself, from inside APL, that's not a necessary functionality, even if you use SCM. And you can always ]link.refresh to re-sync if needed.
14:30
<raoul> @Adám My lib requires ⎕IO ← 0. Is there some way to fix that from the lib side instead of the 'client' workspace?
raoul: Yes, you should be able to ]add ⎕IO though this may not work if you're using an older version of Link. You can simply create a ⎕IO.apl file in the directory that has the content 0
15:11
@xpqz What we look for is appropriate application of array-oriented thinking. For instance you could implement summation using recursion or reduction; the judging committee would view the recursive solution as "loopy" whereas reduction is array-oriented. I mention "appropriate application" because not all problems have clean, array-oriented solutions. I hope this helps.
@Brian Should we maybe include what you stated here in the intro text?
@Brian I sort of get it -- I guess it's a little bit confusing if this is a 'problem solving' competition, or 'beauty pagent'. For example -- without any spoiling -- certain problems have trivial regex solutions, but I suspect that's not what the judging panel would look for or expect. Other problems have solutions that can be solved almost completely using functions found in 'dfns' -- again, what say the judges about that?
@Adám I agree we should add something along those lines
@RomillyCocking Huh?
I think he replied to the wrong thing
15:19
In my beta test, I'll exploit the loop holes I find, and you can choose if you want to encourage or ban such approaches.
@rak1507 Very probably. Sorry
Are you testing the problems for this years competition?
@rak1507 yes
Oh cool, I thought you might be entering and going for the best professional entry
I don't think I'd stand much chance against you lot :)
15:22
Afaik you'd only be competing against other professionals not against students
RGS
RGS
@rak1507 Some brilliant people here do not compete as students :)
We're all students in the university of life....
Could bubbler win it twice or are there rules against that?
15:36
@Razetime then someone will use a language with glyphs not in Times and use their 0-width font instead
@Wezl that would be very interesting
@RomillyCocking very neat project will bookmark and read when I have time/interest. 2 years ago i tried some ANN stuff in gnu apl. I got a basic example working, but did run into some difficulties.
1.) because dfuns use tradfuns behind the scenes in gnu apl, i noticed some 'spooky' behavior where ⍺ ⍵ seemed to change values outside of their scope. could not reliably recreate
2.) some numerical calculations seemed to give slightly off values. this was likely due to me not understanding how gnu apl stores values. notably qr decomposition i had issues with (it was an experimental feature when i started).
3.) it was not fast (hard to optimize when the userbase/contributor base is so small and the project is so mature)
i would like to port my math fns to bqn after i get the erlang interpreter working. i looked at some bqn code yesterday and realized that i have not internalized the language like i did w/ apl (yet)
@xpqz Regex solutions are allowed. (Personally, I think anyone who thinks APL is hard to read has never spent much time with regex :)). As for the dfns workspace, it's been the bane of my existence in developing problems for the competition - find problems that John Scholes hadn't already solved in dfns. Participants are allowed to use code from the dfns workspace, but when we judge we take into consideration the originality of the solution.
btw not trying to put gnu apl down i have a lot of respect for Jurgen and gnu apl but its hard to both be an apl2 alternative and also incorporate ideas from the last 40 years
RGS
RGS
@RomillyCocking not sure what is going on, but when I open the appendix A, the table of contents on the left changes slightly :/
15:51
That's a caching
issue
I think
RGS
RGS
I would suspect so, as well. My suggestion would be to delete the HTML page for appendix A and rebuilding the book.
The competition you're talking about - is it about to be published on dyalogaplcompetition.com/?goto=welcome or am I looking at a wrong link?
@MartinJaniczek That's the one.
@RGS looking better here
16:02
@Adám Are folks aware that neither registering nor newsletter subscription forms work? (The message says they've been "notified that sending e-mail failed", so hopefully they weren't notified by e-mail :P )
@MartinJaniczek Huh, no, I'll let them know.
I think it's not any of my adblockers and such.
RGS
RGS
@RomillyCocking same here
@MartinJaniczek Dev will look at it now.
RGS
RGS
@MartinJaniczek I also had similar problems in the past D:
16:09
Wrote an answer for this question: Try it online!
16:20
I think there's some big save which I'm missing
16:54
<raoul> Following Adám's advice above, I've tried to force ⎕IO←0 on import of my lib by creating an ⎕IO.apl file with content 0 in the Linked dir, but the system still tells me ⎕IO=1 even after Link.Refresh. I must be missing something...
<raoul> To clarify, I linked a lib as ]Link.Create lib, where the lib dir contains a file ⎕IO.apl that only contains 0
@Razetime (2-⍨/⊢)\⍵⊢¨⊂⍵ exists
<raoul> Is there something else I should/could do to make the system do ⎕IO←0?
@dzaima I need to stop when all elems are equal
@Razetime oh didn't notice
raoul: Did you check lib.⎕IO or just ⎕IO?
17:03
@dzaima if there was a proper prefixes builtin, the in ((2-⍨/⊢)\⍵⊢¨⊂⍵)~,¨,\0×⍳≢⍵ wouldn't be needed, making it shorter, but alas :/
@dzaima alternatively, ,\⍳⍴⍵ would work if on a 1-element arg wasn't stupid, but alas :/
<raoul> @Adám both ⎕IO & lib.⎕IO
@dzaima regardless, i appear to have a 71-byte solution
<raoul> @Adám 'cat ⎕IO.apl' in the terminal yields '0'
RGS
RGS
17:35
@raoul how'd you create a file with the character ⎕ in the name..?
Stefans-MacBook-Pro:~ stefan$ touch ⎕io
<raoul> @RGS 'touch ⎕IO.apl' at the terminal
RGS
RGS
oh ok, I thought I wouldn't be able to do it in windows but turns out I can :P
Finally, I got custom operators working in Kap, using the syntax proposed by @dzaima
The main difference compared to standard APL is that the function arguments are passed as first-class functions, and are not bound as regular functions in its implementation.
So, a simple test is: ∇ a (OP foo) b { a ⍞OP b }
And then you can call 10 +foo 20
17:56
<raoul> How can I branch without eval'ing the false branch? For example, I'd like to test whether ⍵ is numeric and then if it's positive. {(0<⍵)∘⊣⍣((1=2|⎕DR)⍵)⊢'b'}'c' yields a domain error.
<raoul> in Dyalog APL
raoul: This sounds worrying. Can you try using the latest Link from the master branch at https://github.com/Dyalog/link with installation instructions at https://github.com/Dyalog/link/blob/master/help/Installation.md#standard-installation
<raoul> @Adám OK, will report back
anyone noticed that APL is PLAy in pig latin?
or almost?
RGS
RGS
Is everyone familiar with the "Zen of Python" (see, e.g. mathspp.com/blog/pydonts/pydont-disrespect-the-zen-of-python, or just type import this at a Python REPL)? Would be interesting to have a look at what a "Zen of APL" would look like.
raoul: you can use {cond: trueResult ⋄ falseResult}. There's not much better than that, and the trueResult has to be a single statement
18:12
@RGS Zen of APL would be the inverse of Zen of Python. I detest the Zen of Python almost as much as I detest PEP8.
@xpqz "ugly is better than beautiful", "readability never counts"?
Now we're talking.
RGS
RGS
@xpqz Why do you detest the Zen of Python? :P (I assume you obviously mean that you hate it in the context of programming in Python)
And to be fair I wouldn't think the Zen of APL would be the inverse of the Zen of Python.
"Flat is better than nested." is something that is still true, albeit with a different meaning.
Those kinds of rules are completely subjective and have nothing to do with Python as such. They're also frequently used to batter other Python programmers' code with. Same with the whole 'I'm more Pythonic than you!'.
Don't get me wrong -- I write Python for a living, and it's good at what it does.
RGS
RGS
@xpqz I guess I understand your point of view. I take the Zen of Python as a generic set of guidelines to get you in the right mindset for coding in Python. I agree it is arguable whether that's of any value or not.
18:22
@dzaima {cond: trueResult3⊣trueResult2⊣trueResult3 ⋄ falseResult} :-)
But I get a bit bored with the haughty attitude I sometimes see, often justified by Z-o-P.
RGS
RGS
@xpqz Don't hate the game, hate the man.
I think the Z-o-P serves its purpose, even if some people use it as justification for annoying behaviour.
"We moved reduce() to functools because reduce() isn't Pythonic".
"We don't do tail call optimisation because Guido says recursion isn't Pythonic"
RGS
RGS
XD
Points taken.
Ok, so how would one write a short Zen of APL?
Guido needs to do some APL! And Lisp.
RGS
RGS
18:25
Flat is better than nested.
What more?
@xpqz Maybe he did and hated it :-P
Array-y is better than loopy.
@RGS I don't think any list of usage suggestions for any language ends up being good
RGS
RGS
@dzaima Why won't you indulge me :'(
^what @dzaima said.
I think a lot of the Zen of Python makes sense even for APL.
18:28
I think it makes sense to any form of programming -- vague and generic :)
@RGS Homogenous is better than heterogeneous.
RGS
RGS
@Adám As an addition or replacement?
Addition.
The litmus test is: if the inverse is nonsensical, so is the original. No one would say "ugly is better thab pretty"
@xpqz True, but it is in a pseudo-Zen style. It is intended to make you think. E.g. "Complex is better than complicated." → "Am I over-complicating this?"
E.g. one of my colleagues has a tendency to want to implement an "All-singing all-dancing API" rather than specify a strict but simple API.
18:31
Oh, you have one of those colleagues, too?
"Although never is often better than right now." → "Don't rush the design of your API ― it'll bite you later"
Although I do wish my least favourite Z-o-P rule applied to APL indexing: "There should be one-- and preferably only one --obvious way to do it."
@RGS Aren't a lot of the points in my style guide eligible?
@xpqz unfortunately APL is stuck with the bad starting decisions, which kind of handle most options but everything still sucks.
RGS
RGS
@Adám I would say so, yes.
18:36
@xpqz … namely ⌷⍨∘⊃⍨⍤0 99
@RGS Oh: Leading axis!
RGS
RGS
That is a good one. It doesn't make sense in many popular programming languages.
Exactly.
RGS
RGS
Much like the last sentence in the Z-o-P doesn't make sense in many other popular programming languages.
But works for APL :-)
@Adám A lot more specific ("Avoid diamonds") than the Z-o-P, but that might be a good thing
18:39
<moon-child> @RGS even worse, languages where it does make sense (eg numpy) went with trailing axis
RGS
RGS
moon-child, why would you refer to numpy as a language? You, now, and some other people in here sometimes seem to talk about numpy as if it were a language in its own right.
moon-child: So did APL, but at least we're trying to fix that.
RGS
RGS
Is it because of loose terminology? afaik, numpy is just a Python library.
I think because it allows a radically different way of programming.
<moon-child> @RGS the term 'programming language' is somewhat loosely defined. I would also call unix a programming language, because it allows a certain way of structuring programs and systems in a way that wouldn't be possible otherwise (in other types of operating systems). I think numpy plays a similar role in that it allows a certain way of structuring programs that owuldn't otherwise be possible in python
18:43
a DSL, an embedded language
RGS
RGS
I see.
@dzaima my solutions - one golfier, one more "fun"
ngn
ngn
@DyalogAPL <moon-child> +1. apl is something between a language and a library.
@ngn Also, I'd even call languages with "images" an operating system, in a sense
APL and Smalltalk fit in that category for me
ngn
ngn
@MartinJaniczek initially that was literally true
18:48
<raoul> @Adám overwriting SALT as per installation instructions broke my Dyalog install. Will reinstall latest and retry.
19:26
raoul: You probably overwrote your SALT folder rathert than merging and only overwriting the one included file.
<raoul> @Adám Ah yeah, my bda
<raoul> bad
19:44
haha. apparently nothing's making sure strands don't contain nonsensical things
@dzaima oh, arrays don't either. ¯\_(ツ)_/¯
yay homoiconicity lets make macros
macros don't make much sense because control structures aren't very encouraged in APL
ngn
ngn
@Wezl what. macros in apl? where?
@Wezl well, the compiler just ignores the and ends up just generating no bytecode, quickly erroring due to bad stack size
@ngn nvm I thought that dzaima's arrays were holding ← as data
<raoul> @Adám Ok, the behaviour is as expected with latest Link: ⎕IO is 0, while lib.⎕IO is 1 :-)
<raoul> @Adám So, I guess I am supposed to import my lib names directly into the current workspace for lib.⎕IO to overwrite #.⎕IO and it should all work, right?
<raoul> @Adám Sorry, I meant to write above: ⎕IO is 1, while lib.⎕IO is 0 ! Still, seems to work OK.
<raoul> @Adám The stock Dyalog version distributed on the Dyalog website has Link do the wrong thing, though: both ⎕IO & lib.⎕IO are 0
<raoul> @Adám both ⎕IO & lib.⎕IO are 1 ! I mean 1 !
<raoul> @Adám damn! I'm too used to indexes starting at 0...
20:12
raoul: Importing a library can't (and shouldn't normally) affect the root ⎕IO. However, your import or link your main project to # rather than to a sub-namespace: ]link.create # /path/myproj and myproj's ⎕IO will take effect in the root.
raoul: If you never want to use ⎕IO←1 for your own things, consider setting the environment variable DEFAULT_IO=0.
20:50
/me grumbles that all the good programming languages have 1-based indexing
(except for a few, but all the good languages I use)
<moon-child> which languages?
smalltalk, lua, picolisp, APL
the first two I probably think are good because they have simple, readable syntax ... because they're "easy to learn" ... so they have 1-based indexing
<moon-child> lua was originally intended as a configuration file format. And then it slowly evolved pl features. I think if the creators were making it from scratch they probably would have done 0-based indexing
<moon-child> apl at least you can change the io, and most non-apl apls are 0-based
@Marshall why does require minimum rank of 1 for 𝕩? (finally decided to pull & look at new tests)
ngn
ngn
@Wezl how did you manage to pick exactly the handful of ones that do use 1? :) the vast majority of good languages use 0
00:00 - 21:0021:00 - 00:00

« first day (1442 days earlier)      last day (1509 days later) »